summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bcmath/bcmath.c132
-rw-r--r--ext/bcmath/libbcmath/src/bcmath.h24
-rw-r--r--ext/bcmath/libbcmath/src/debug.c4
-rw-r--r--ext/bcmath/libbcmath/src/div.c6
-rw-r--r--ext/bcmath/libbcmath/src/divmod.c14
-rw-r--r--ext/bcmath/libbcmath/src/init.c4
-rw-r--r--ext/bcmath/libbcmath/src/output.c32
-rw-r--r--ext/bcmath/libbcmath/src/raise.c10
-rw-r--r--ext/bcmath/libbcmath/src/raisemod.c22
-rw-r--r--ext/bcmath/libbcmath/src/recmul.c24
-rw-r--r--ext/bcmath/libbcmath/src/sqrt.c18
-rw-r--r--ext/bcmath/libbcmath/src/str2num.c2
-rw-r--r--ext/bcmath/libbcmath/src/zero.c2
-rw-r--r--ext/bz2/bz2.c52
-rw-r--r--ext/bz2/bz2_filter.c52
-rw-r--r--ext/bz2/php_bz2.h8
-rw-r--r--ext/calendar/cal_unix.c4
-rw-r--r--ext/calendar/calendar.c38
-rw-r--r--ext/calendar/easter.c4
-rw-r--r--ext/com_dotnet/com_com.c124
-rw-r--r--ext/com_dotnet/com_dotnet.c26
-rw-r--r--ext/com_dotnet/com_extension.c18
-rw-r--r--ext/com_dotnet/com_handlers.c104
-rw-r--r--ext/com_dotnet/com_iterator.c30
-rw-r--r--ext/com_dotnet/com_misc.c20
-rw-r--r--ext/com_dotnet/com_olechar.c8
-rw-r--r--ext/com_dotnet/com_persist.c102
-rw-r--r--ext/com_dotnet/com_saproxy.c92
-rw-r--r--ext/com_dotnet/com_typeinfo.c50
-rw-r--r--ext/com_dotnet/com_variant.c128
-rw-r--r--ext/com_dotnet/com_wrapper.c44
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h68
-rw-r--r--ext/ctype/ctype.c2
-rw-r--r--ext/curl/curl_file.c28
-rw-r--r--ext/curl/interface.c186
-rw-r--r--ext/curl/multi.c35
-rw-r--r--ext/curl/php_curl.h8
-rw-r--r--ext/curl/share.c12
-rw-r--r--ext/date/php_date.c685
-rw-r--r--ext/date/php_date.h10
-rw-r--r--ext/dba/dba.c124
-rw-r--r--ext/dba/dba_cdb.c22
-rw-r--r--ext/dba/dba_db2.c2
-rw-r--r--ext/dba/dba_db3.c5
-rw-r--r--ext/dba/dba_db4.c7
-rw-r--r--ext/dba/dba_dbm.c2
-rw-r--r--ext/dba/dba_flatfile.c16
-rw-r--r--ext/dba/dba_gdbm.c4
-rw-r--r--ext/dba/dba_inifile.c20
-rw-r--r--ext/dba/dba_qdbm.c2
-rw-r--r--ext/dba/dba_tcadb.c2
-rw-r--r--ext/dba/libcdb/cdb.c32
-rw-r--r--ext/dba/libcdb/cdb.h12
-rw-r--r--ext/dba/libcdb/cdb_make.c28
-rw-r--r--ext/dba/libcdb/cdb_make.h10
-rw-r--r--ext/dba/libflatfile/flatfile.c26
-rw-r--r--ext/dba/libflatfile/flatfile.h12
-rw-r--r--ext/dba/libinifile/inifile.c100
-rw-r--r--ext/dba/libinifile/inifile.h18
-rw-r--r--ext/dba/php_dba.h44
-rw-r--r--ext/dom/attr.c44
-rw-r--r--ext/dom/cdatasection.c14
-rw-r--r--ext/dom/characterdata.c30
-rw-r--r--ext/dom/comment.c14
-rw-r--r--ext/dom/document.c278
-rw-r--r--ext/dom/documentfragment.c20
-rw-r--r--ext/dom/documenttype.c32
-rw-r--r--ext/dom/dom_iterators.c20
-rw-r--r--ext/dom/dom_properties.h196
-rw-r--r--ext/dom/domerror.c12
-rw-r--r--ext/dom/domexception.c10
-rw-r--r--ext/dom/domimplementation.c24
-rw-r--r--ext/dom/domimplementationlist.c2
-rw-r--r--ext/dom/domlocator.c10
-rw-r--r--ext/dom/domstringlist.c2
-rw-r--r--ext/dom/element.c130
-rw-r--r--ext/dom/entity.c24
-rw-r--r--ext/dom/entityreference.c16
-rw-r--r--ext/dom/namednodemap.c8
-rw-r--r--ext/dom/namelist.c2
-rw-r--r--ext/dom/node.c204
-rw-r--r--ext/dom/nodelist.c4
-rw-r--r--ext/dom/notation.c8
-rw-r--r--ext/dom/php_dom.c364
-rw-r--r--ext/dom/php_dom.h34
-rw-r--r--ext/dom/processinginstruction.c28
-rw-r--r--ext/dom/text.c24
-rw-r--r--ext/dom/typeinfo.c4
-rw-r--r--ext/dom/xml_common.h10
-rw-r--r--ext/dom/xpath.c57
-rw-r--r--ext/enchant/enchant.c54
-rw-r--r--ext/ereg/ereg.c42
-rw-r--r--ext/ereg/php_ereg.h2
-rw-r--r--ext/exif/exif.c346
-rw-r--r--ext/fileinfo/fileinfo.c52
-rw-r--r--ext/fileinfo/libmagic.patch48
-rw-r--r--ext/fileinfo/libmagic/apprentice.c5
-rw-r--r--ext/fileinfo/libmagic/fsmagic.c1
-rw-r--r--ext/fileinfo/libmagic/funcs.c8
-rw-r--r--ext/fileinfo/libmagic/magic.c1
-rw-r--r--ext/fileinfo/libmagic/print.c3
-rw-r--r--ext/fileinfo/libmagic/softmagic.c10
-rw-r--r--ext/filter/callback_filter.c6
-rw-r--r--ext/filter/filter.c82
-rw-r--r--ext/filter/logical_filters.c34
-rw-r--r--ext/filter/sanitizing_filters.c4
-rw-r--r--ext/ftp/ftp.c91
-rw-r--r--ext/ftp/ftp.h20
-rw-r--r--ext/ftp/php_ftp.c162
-rw-r--r--ext/gd/gd.c408
-rw-r--r--ext/gd/gd_compat.c5
-rw-r--r--ext/gd/gd_ctx.c19
-rw-r--r--ext/gd/libgd/gd.c6
-rw-r--r--ext/gd/libgd/gdft.c3
-rw-r--r--ext/gd/libgd/gdkanji.c3
-rw-r--r--ext/gd/php_gd.h4
-rw-r--r--ext/gettext/gettext.c22
-rw-r--r--ext/gmp/gmp.c308
-rw-r--r--ext/hash/hash.c56
-rw-r--r--ext/hash/hash_md.c4
-rw-r--r--ext/hash/hash_sha.c4
-rw-r--r--ext/iconv/iconv.c228
-rw-r--r--ext/imap/php_imap.c354
-rw-r--r--ext/interbase/ibase_blobs.c66
-rw-r--r--ext/interbase/ibase_events.c28
-rw-r--r--ext/interbase/ibase_query.c172
-rw-r--r--ext/interbase/ibase_service.c28
-rw-r--r--ext/interbase/interbase.c77
-rw-r--r--ext/interbase/php_ibase_includes.h14
-rw-r--r--ext/interbase/php_ibase_udf.c12
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp62
-rw-r--r--ext/intl/breakiterator/breakiterator_class.h8
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.cpp62
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.h6
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.cpp64
-rw-r--r--ext/intl/breakiterator/codepointiterator_methods.cpp2
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp34
-rw-r--r--ext/intl/calendar/calendar_class.cpp66
-rw-r--r--ext/intl/calendar/calendar_class.h10
-rw-r--r--ext/intl/calendar/calendar_methods.cpp272
-rw-r--r--ext/intl/calendar/gregoriancalendar_methods.cpp48
-rw-r--r--ext/intl/collator/collator.c4
-rw-r--r--ext/intl/collator/collator_attr.c16
-rw-r--r--ext/intl/collator/collator_class.c28
-rw-r--r--ext/intl/collator/collator_class.h12
-rw-r--r--ext/intl/collator/collator_compare.c18
-rw-r--r--ext/intl/collator/collator_convert.c11
-rw-r--r--ext/intl/collator/collator_convert.h2
-rw-r--r--ext/intl/collator/collator_create.c10
-rw-r--r--ext/intl/collator/collator_error.c10
-rw-r--r--ext/intl/collator/collator_locale.c10
-rw-r--r--ext/intl/collator/collator_sort.c62
-rw-r--r--ext/intl/collator/collator_sort.h2
-rw-r--r--ext/intl/common/common_date.cpp36
-rw-r--r--ext/intl/common/common_date.h6
-rw-r--r--ext/intl/common/common_enum.cpp84
-rw-r--r--ext/intl/common/common_enum.h16
-rw-r--r--ext/intl/common/common_error.c12
-rw-r--r--ext/intl/converter/converter.c200
-rw-r--r--ext/intl/dateformat/dateformat.c16
-rw-r--r--ext/intl/dateformat/dateformat_attr.c28
-rw-r--r--ext/intl/dateformat/dateformat_attrcpp.cpp42
-rw-r--r--ext/intl/dateformat/dateformat_class.c32
-rw-r--r--ext/intl/dateformat/dateformat_class.h4
-rw-r--r--ext/intl/dateformat/dateformat_create.cpp22
-rw-r--r--ext/intl/dateformat/dateformat_data.c12
-rw-r--r--ext/intl/dateformat/dateformat_data.h6
-rw-r--r--ext/intl/dateformat/dateformat_format.c24
-rw-r--r--ext/intl/dateformat/dateformat_format_object.cpp36
-rw-r--r--ext/intl/dateformat/dateformat_helpers.cpp14
-rw-r--r--ext/intl/dateformat/dateformat_helpers.h2
-rw-r--r--ext/intl/dateformat/dateformat_parse.c34
-rw-r--r--ext/intl/formatter/formatter.c4
-rw-r--r--ext/intl/formatter/formatter_attr.c40
-rw-r--r--ext/intl/formatter/formatter_class.c30
-rw-r--r--ext/intl/formatter/formatter_class.h4
-rw-r--r--ext/intl/formatter/formatter_data.c12
-rw-r--r--ext/intl/formatter/formatter_data.h6
-rw-r--r--ext/intl/formatter/formatter_format.c24
-rw-r--r--ext/intl/formatter/formatter_main.c18
-rw-r--r--ext/intl/formatter/formatter_parse.c10
-rw-r--r--ext/intl/grapheme/grapheme.h2
-rw-r--r--ext/intl/grapheme/grapheme_string.c106
-rw-r--r--ext/intl/grapheme/grapheme_util.c16
-rw-r--r--ext/intl/grapheme/grapheme_util.h10
-rw-r--r--ext/intl/idn/idn.c42
-rw-r--r--ext/intl/intl_data.h20
-rw-r--r--ext/intl/intl_error.c78
-rw-r--r--ext/intl/intl_error.h26
-rw-r--r--ext/intl/locale/locale.c6
-rw-r--r--ext/intl/locale/locale_class.c4
-rw-r--r--ext/intl/locale/locale_class.h4
-rw-r--r--ext/intl/locale/locale_methods.c146
-rw-r--r--ext/intl/msgformat/msgformat.c22
-rw-r--r--ext/intl/msgformat/msgformat_attr.c14
-rw-r--r--ext/intl/msgformat/msgformat_class.c32
-rw-r--r--ext/intl/msgformat/msgformat_class.h4
-rw-r--r--ext/intl/msgformat/msgformat_data.c12
-rw-r--r--ext/intl/msgformat/msgformat_data.h6
-rw-r--r--ext/intl/msgformat/msgformat_format.c26
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp70
-rw-r--r--ext/intl/msgformat/msgformat_helpers.h2
-rw-r--r--ext/intl/msgformat/msgformat_parse.c24
-rw-r--r--ext/intl/normalizer/normalizer.c4
-rw-r--r--ext/intl/normalizer/normalizer_class.c4
-rw-r--r--ext/intl/normalizer/normalizer_class.h2
-rw-r--r--ext/intl/normalizer/normalizer_normalize.c30
-rw-r--r--ext/intl/php_intl.c38
-rw-r--r--ext/intl/php_intl.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle.c6
-rw-r--r--ext/intl/resourcebundle/resourcebundle.h2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c80
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.h4
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.c34
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.h2
-rw-r--r--ext/intl/spoofchecker/spoofchecker.c2
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c40
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.h14
-rw-r--r--ext/intl/spoofchecker/spoofchecker_main.c16
-rw-r--r--ext/intl/timezone/timezone_class.cpp86
-rw-r--r--ext/intl/timezone/timezone_class.h10
-rw-r--r--ext/intl/timezone/timezone_methods.cpp154
-rw-r--r--ext/intl/transliterator/transliterator.c4
-rw-r--r--ext/intl/transliterator/transliterator_class.c76
-rw-r--r--ext/intl/transliterator/transliterator_class.h6
-rw-r--r--ext/intl/transliterator/transliterator_methods.c96
-rw-r--r--ext/json/JSON_parser.c26
-rw-r--r--ext/json/JSON_parser.h6
-rw-r--r--ext/json/json.c78
-rw-r--r--ext/json/php_json.h8
-rw-r--r--ext/ldap/ldap.c223
-rw-r--r--ext/libxml/libxml.c118
-rw-r--r--ext/libxml/php_libxml.h22
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_htmlent.c8
-rw-r--r--ext/mbstring/mb_gpc.c22
-rw-r--r--ext/mbstring/mb_gpc.h2
-rw-r--r--ext/mbstring/mbstring.c354
-rw-r--r--ext/mbstring/mbstring.h16
-rw-r--r--ext/mbstring/php_mbregex.c96
-rw-r--r--ext/mbstring/php_mbregex.h12
-rw-r--r--ext/mbstring/php_unicode.c22
-rw-r--r--ext/mbstring/php_unicode.h2
-rw-r--r--ext/mcrypt/mcrypt.c118
-rw-r--r--ext/mcrypt/mcrypt_filter.c42
-rw-r--r--ext/mssql/php_mssql.c169
-rw-r--r--ext/mssql/php_mssql.h2
-rw-r--r--ext/mysql/php_mysql.c214
-rw-r--r--ext/mysqli/mysqli.c240
-rw-r--r--ext/mysqli/mysqli_api.c232
-rw-r--r--ext/mysqli/mysqli_driver.c24
-rw-r--r--ext/mysqli/mysqli_embedded.c2
-rw-r--r--ext/mysqli/mysqli_exception.c14
-rw-r--r--ext/mysqli/mysqli_nonapi.c140
-rw-r--r--ext/mysqli/mysqli_priv.h20
-rw-r--r--ext/mysqli/mysqli_prop.c36
-rw-r--r--ext/mysqli/mysqli_report.c12
-rw-r--r--ext/mysqli/mysqli_result_iterator.c22
-rw-r--r--ext/mysqli/mysqli_warning.c46
-rw-r--r--ext/mysqli/php_mysqli_structs.h30
-rw-r--r--ext/mysqlnd/mysqlnd.c550
-rw-r--r--ext/mysqlnd/mysqlnd.h246
-rw-r--r--ext/mysqlnd/mysqlnd_alloc.c6
-rw-r--r--ext/mysqlnd/mysqlnd_auth.c48
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.c14
-rw-r--r--ext/mysqlnd/mysqlnd_block_alloc.h4
-rw-r--r--ext/mysqlnd/mysqlnd_charset.c8
-rw-r--r--ext/mysqlnd/mysqlnd_charset.h10
-rw-r--r--ext/mysqlnd/mysqlnd_debug.c18
-rw-r--r--ext/mysqlnd/mysqlnd_debug.h6
-rw-r--r--ext/mysqlnd/mysqlnd_driver.c50
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.c18
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.h36
-rw-r--r--ext/mysqlnd/mysqlnd_loaddata.c34
-rw-r--r--ext/mysqlnd/mysqlnd_net.c142
-rw-r--r--ext/mysqlnd/mysqlnd_net.h4
-rw-r--r--ext/mysqlnd/mysqlnd_plugin.c33
-rw-r--r--ext/mysqlnd/mysqlnd_priv.h22
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c278
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c72
-rw-r--r--ext/mysqlnd/mysqlnd_result.c228
-rw-r--r--ext/mysqlnd/mysqlnd_result.h10
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.c32
-rw-r--r--ext/mysqlnd/mysqlnd_result_meta.h4
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.c18
-rw-r--r--ext/mysqlnd/mysqlnd_reverse_api.h12
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.c4
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.h6
-rw-r--r--ext/mysqlnd/mysqlnd_structs.h438
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c200
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.h22
-rw-r--r--ext/mysqlnd/php_mysqlnd.c18
-rw-r--r--ext/oci8/oci8.c352
-rw-r--r--ext/oci8/oci8_collection.c104
-rw-r--r--ext/oci8/oci8_interface.c430
-rw-r--r--ext/oci8/oci8_lob.c133
-rw-r--r--ext/oci8/oci8_statement.c183
-rw-r--r--ext/oci8/php_oci8_int.h130
-rw-r--r--ext/odbc/birdstep.c72
-rw-r--r--ext/odbc/php_odbc.c232
-rw-r--r--ext/odbc/php_odbc_includes.h2
-rw-r--r--ext/opcache/Optimizer/block_pass.c42
-rw-r--r--ext/opcache/Optimizer/compact_literals.c6
-rw-r--r--ext/opcache/Optimizer/optimize_func_calls.c2
-rw-r--r--ext/opcache/Optimizer/pass1_5.c48
-rw-r--r--ext/opcache/Optimizer/pass2.c12
-rw-r--r--ext/opcache/Optimizer/pass3.c2
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c56
-rw-r--r--ext/opcache/Optimizer/zend_optimizer_internal.h26
-rw-r--r--ext/opcache/ZendAccelerator.c404
-rw-r--r--ext/opcache/ZendAccelerator.h24
-rw-r--r--ext/opcache/shared_alloc_win32.c1
-rw-r--r--ext/opcache/zend_accelerator_blacklist.c9
-rw-r--r--ext/opcache/zend_accelerator_blacklist.h4
-rw-r--r--ext/opcache/zend_accelerator_debug.c1
-rw-r--r--ext/opcache/zend_accelerator_module.c64
-rw-r--r--ext/opcache/zend_accelerator_module.h4
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c101
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.h8
-rw-r--r--ext/opcache/zend_persist.c92
-rw-r--r--ext/opcache/zend_persist.h4
-rw-r--r--ext/opcache/zend_persist_calc.c60
-rw-r--r--ext/opcache/zend_shared_alloc.c14
-rw-r--r--ext/opcache/zend_shared_alloc.h10
-rwxr-xr-xext/openssl/openssl.c617
-rw-r--r--ext/openssl/xp_ssl.c305
-rw-r--r--ext/pcntl/pcntl.c86
-rw-r--r--ext/pcntl/php_signal.c3
-rw-r--r--ext/pcre/php_pcre.c150
-rw-r--r--ext/pcre/php_pcre.h16
-rw-r--r--ext/pdo/pdo.c14
-rw-r--r--ext/pdo/pdo_dbh.c228
-rw-r--r--ext/pdo/pdo_sql_parser.c22
-rw-r--r--ext/pdo/pdo_sql_parser.re22
-rw-r--r--ext/pdo/pdo_stmt.c463
-rw-r--r--ext/pdo/php_pdo.h8
-rw-r--r--ext/pdo/php_pdo_driver.h66
-rw-r--r--ext/pdo/php_pdo_error.h6
-rw-r--r--ext/pdo/php_pdo_int.h24
-rw-r--r--ext/pdo_dblib/dblib_driver.c40
-rw-r--r--ext/pdo_dblib/dblib_stmt.c26
-rw-r--r--ext/pdo_dblib/pdo_dblib.c2
-rw-r--r--ext/pdo_firebird/firebird_driver.c42
-rw-r--r--ext/pdo_firebird/firebird_statement.c32
-rw-r--r--ext/pdo_firebird/php_pdo_firebird_int.h2
-rw-r--r--ext/pdo_mysql/mysql_driver.c92
-rw-r--r--ext/pdo_mysql/mysql_statement.c42
-rw-r--r--ext/pdo_mysql/pdo_mysql.c12
-rw-r--r--ext/pdo_mysql/php_pdo_mysql_int.h6
-rw-r--r--ext/pdo_oci/oci_driver.c38
-rw-r--r--ext/pdo_oci/oci_statement.c49
-rw-r--r--ext/pdo_oci/php_pdo_oci_int.h8
-rw-r--r--ext/pdo_odbc/odbc_driver.c32
-rw-r--r--ext/pdo_odbc/odbc_stmt.c24
-rw-r--r--ext/pdo_odbc/pdo_odbc.c2
-rw-r--r--ext/pdo_odbc/php_pdo_odbc_int.h8
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c96
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c20
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h12
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite_int.h6
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c102
-rw-r--r--ext/pdo_sqlite/sqlite_statement.c18
-rw-r--r--ext/pgsql/pgsql.c654
-rw-r--r--ext/pgsql/php_pgsql.h28
-rw-r--r--ext/phar/dirstream.c118
-rw-r--r--ext/phar/dirstream.h18
-rw-r--r--ext/phar/func_interceptors.c110
-rw-r--r--ext/phar/func_interceptors.h12
-rw-r--r--ext/phar/phar.c287
-rw-r--r--ext/phar/phar_internal.h120
-rwxr-xr-xext/phar/phar_object.c988
-rw-r--r--ext/phar/php_phar.h2
-rw-r--r--ext/phar/stream.c182
-rw-r--r--ext/phar/stream.h24
-rw-r--r--ext/phar/stub.h2
-rw-r--r--ext/phar/tar.c106
-rw-r--r--ext/phar/util.c242
-rw-r--r--ext/phar/zip.c76
-rw-r--r--ext/posix/posix.c68
-rw-r--r--ext/pspell/pspell.c74
-rw-r--r--ext/readline/readline.c32
-rw-r--r--ext/readline/readline_cli.c81
-rw-r--r--ext/recode/recode.c16
-rw-r--r--ext/reflection/php_reflection.c658
-rw-r--r--ext/reflection/php_reflection.h2
-rw-r--r--ext/session/mod_files.c46
-rw-r--r--ext/session/mod_mm.c19
-rw-r--r--ext/session/mod_user.c28
-rw-r--r--ext/session/mod_user_class.c28
-rw-r--r--ext/session/php_session.h24
-rw-r--r--ext/session/session.c388
-rw-r--r--ext/shmop/shmop.c36
-rw-r--r--ext/simplexml/php_simplexml_exports.h4
-rw-r--r--ext/simplexml/simplexml.c438
-rw-r--r--ext/simplexml/sxe.c10
-rw-r--r--ext/skeleton/skeleton.c2
-rw-r--r--ext/snmp/php_snmp.h6
-rw-r--r--ext/snmp/snmp.c244
-rw-r--r--ext/soap/php_encoding.c493
-rw-r--r--ext/soap/php_encoding.h16
-rw-r--r--ext/soap/php_http.c76
-rw-r--r--ext/soap/php_http.h8
-rw-r--r--ext/soap/php_packet_soap.c54
-rw-r--r--ext/soap/php_packet_soap.h2
-rw-r--r--ext/soap/php_schema.c18
-rw-r--r--ext/soap/php_schema.h2
-rw-r--r--ext/soap/php_sdl.c63
-rw-r--r--ext/soap/php_sdl.h6
-rw-r--r--ext/soap/php_soap.h2
-rw-r--r--ext/soap/php_xml.c11
-rw-r--r--ext/soap/php_xml.h2
-rw-r--r--ext/soap/soap.c544
-rw-r--r--ext/sockets/conversions.c20
-rw-r--r--ext/sockets/conversions.h2
-rw-r--r--ext/sockets/multicast.c130
-rw-r--r--ext/sockets/multicast.h22
-rw-r--r--ext/sockets/php_sockets.h8
-rw-r--r--ext/sockets/sendrecvmsg.c34
-rw-r--r--ext/sockets/sendrecvmsg.h4
-rw-r--r--ext/sockets/sockaddr_conv.c22
-rw-r--r--ext/sockets/sockaddr_conv.h6
-rw-r--r--ext/sockets/sockets.c164
-rw-r--r--ext/spl/php_spl.c102
-rw-r--r--ext/spl/php_spl.h2
-rw-r--r--ext/spl/spl_array.c430
-rw-r--r--ext/spl/spl_array.h4
-rw-r--r--ext/spl/spl_directory.c550
-rw-r--r--ext/spl/spl_directory.h12
-rw-r--r--ext/spl/spl_dllist.c196
-rw-r--r--ext/spl/spl_engine.c4
-rw-r--r--ext/spl/spl_engine.h22
-rw-r--r--ext/spl/spl_exceptions.c2
-rw-r--r--ext/spl/spl_fixedarray.c172
-rw-r--r--ext/spl/spl_functions.c36
-rw-r--r--ext/spl/spl_functions.h36
-rw-r--r--ext/spl/spl_heap.c182
-rw-r--r--ext/spl/spl_iterators.c652
-rw-r--r--ext/spl/spl_iterators.h4
-rw-r--r--ext/spl/spl_observer.c168
-rw-r--r--ext/sqlite3/sqlite3.c166
-rw-r--r--ext/standard/array.c500
-rw-r--r--ext/standard/assert.c40
-rw-r--r--ext/standard/base64.c6
-rw-r--r--ext/standard/basic_functions.c326
-rw-r--r--ext/standard/basic_functions.h16
-rw-r--r--ext/standard/browscap.c34
-rw-r--r--ext/standard/crc32.c2
-rw-r--r--ext/standard/credits.c4
-rw-r--r--ext/standard/credits.h2
-rw-r--r--ext/standard/crypt.c6
-rw-r--r--ext/standard/css.c2
-rw-r--r--ext/standard/css.h2
-rw-r--r--ext/standard/cyr_convert.c12
-rw-r--r--ext/standard/datetime.c6
-rw-r--r--ext/standard/datetime.h2
-rw-r--r--ext/standard/dir.c52
-rw-r--r--ext/standard/dl.c46
-rw-r--r--ext/standard/dl.h4
-rw-r--r--ext/standard/dns.c34
-rw-r--r--ext/standard/dns_win32.c16
-rw-r--r--ext/standard/exec.c32
-rw-r--r--ext/standard/exec.h2
-rw-r--r--ext/standard/file.c238
-rw-r--r--ext/standard/file.h20
-rw-r--r--ext/standard/filestat.c136
-rw-r--r--ext/standard/filters.c114
-rw-r--r--ext/standard/formatted_print.c46
-rw-r--r--ext/standard/fsock.c4
-rw-r--r--ext/standard/ftok.c10
-rw-r--r--ext/standard/ftp_fopen_wrapper.c158
-rw-r--r--ext/standard/head.c40
-rw-r--r--ext/standard/head.h4
-rw-r--r--ext/standard/html.c42
-rw-r--r--ext/standard/html.h6
-rw-r--r--ext/standard/http.c12
-rw-r--r--ext/standard/http_fopen_wrapper.c58
-rw-r--r--ext/standard/image.c154
-rw-r--r--ext/standard/incomplete_class.c40
-rw-r--r--ext/standard/info.c103
-rw-r--r--ext/standard/info.h12
-rw-r--r--ext/standard/iptc.c60
-rw-r--r--ext/standard/lcg.c12
-rw-r--r--ext/standard/levenshtein.c14
-rw-r--r--ext/standard/link.c52
-rw-r--r--ext/standard/link_win32.c46
-rw-r--r--ext/standard/mail.c40
-rw-r--r--ext/standard/math.c111
-rw-r--r--ext/standard/md5.c4
-rw-r--r--ext/standard/metaphone.c2
-rw-r--r--ext/standard/microtime.c6
-rw-r--r--ext/standard/pack.c38
-rw-r--r--ext/standard/pageinfo.c24
-rw-r--r--ext/standard/pageinfo.h8
-rw-r--r--ext/standard/password.c30
-rw-r--r--ext/standard/php_array.h12
-rw-r--r--ext/standard/php_filestat.h4
-rw-r--r--ext/standard/php_fopen_wrapper.c56
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_http.h4
-rw-r--r--ext/standard/php_image.h2
-rw-r--r--ext/standard/php_incomplete_class.h2
-rw-r--r--ext/standard/php_lcg.h2
-rw-r--r--ext/standard/php_mail.h2
-rw-r--r--ext/standard/php_math.h4
-rw-r--r--ext/standard/php_rand.h12
-rw-r--r--ext/standard/php_string.h18
-rw-r--r--ext/standard/php_var.h18
-rw-r--r--ext/standard/proc_open.c48
-rw-r--r--ext/standard/quot_print.c4
-rw-r--r--ext/standard/rand.c36
-rw-r--r--ext/standard/scanf.c21
-rw-r--r--ext/standard/scanf.h2
-rw-r--r--ext/standard/sha1.c4
-rw-r--r--ext/standard/soundex.c2
-rw-r--r--ext/standard/streamsfuncs.c224
-rw-r--r--ext/standard/string.c313
-rw-r--r--ext/standard/syslog.c4
-rw-r--r--ext/standard/type.c36
-rw-r--r--ext/standard/uniqid.c6
-rw-r--r--ext/standard/url.c16
-rw-r--r--ext/standard/url_scanner_ex.c30
-rw-r--r--ext/standard/url_scanner_ex.h6
-rw-r--r--ext/standard/url_scanner_ex.re30
-rw-r--r--ext/standard/user_filters.c70
-rw-r--r--ext/standard/uuencode.c6
-rw-r--r--ext/standard/var.c136
-rw-r--r--ext/standard/var_unserializer.c22
-rw-r--r--ext/standard/var_unserializer.re22
-rw-r--r--ext/standard/versioning.c2
-rw-r--r--ext/sybase_ct/php_sybase_ct.c206
-rw-r--r--ext/sysvmsg/sysvmsg.c34
-rw-r--r--ext/sysvsem/sysvsem.c32
-rw-r--r--ext/sysvshm/sysvshm.c40
-rw-r--r--ext/tidy/tidy.c211
-rw-r--r--ext/tokenizer/tokenizer.c18
-rw-r--r--ext/wddx/php_wddx_api.h2
-rw-r--r--ext/wddx/wddx.c68
-rw-r--r--ext/xml/xml.c75
-rw-r--r--ext/xmlreader/php_xmlreader.c150
-rw-r--r--ext/xmlreader/php_xmlreader.h2
-rw-r--r--ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c3
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c80
-rw-r--r--ext/xmlwriter/php_xmlwriter.c120
-rw-r--r--ext/xsl/php_xsl.c20
-rw-r--r--ext/xsl/php_xsl.h12
-rw-r--r--ext/xsl/xsltprocessor.c107
-rw-r--r--ext/zip/php_zip.c264
-rw-r--r--ext/zip/php_zip.h8
-rw-r--r--ext/zip/zip_stream.c20
-rw-r--r--ext/zlib/php_zlib.h2
-rw-r--r--ext/zlib/zlib.c138
-rw-r--r--ext/zlib/zlib_filter.c52
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c18
552 files changed, 17776 insertions, 17954 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 11f30e47c3..b72b2ac1fe 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -147,7 +147,7 @@ static PHP_GINIT_FUNCTION(bcmath)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
bcmath_globals->bc_precision = 0;
- bc_init_numbers(TSRMLS_C);
+ bc_init_numbers();
}
/* }}} */
@@ -194,16 +194,16 @@ PHP_MINFO_FUNCTION(bcmath)
/* {{{ php_str2num
Convert to bc_num detecting scale */
-static void php_str2num(bc_num *num, char *str TSRMLS_DC)
+static void php_str2num(bc_num *num, char *str)
{
char *p;
if (!(p = strchr(str, '.'))) {
- bc_str2num(num, str, 0 TSRMLS_CC);
+ bc_str2num(num, str, 0);
return;
}
- bc_str2num(num, str, strlen(p+1) TSRMLS_CC);
+ bc_str2num(num, str, strlen(p+1));
}
/* }}} */
@@ -217,7 +217,7 @@ PHP_FUNCTION(bcadd)
size_t left_len, right_len;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -225,11 +225,11 @@ PHP_FUNCTION(bcadd)
scale = (int) (scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
bc_add (first, second, &result, scale);
if (result->n_scale > scale) {
@@ -254,7 +254,7 @@ PHP_FUNCTION(bcsub)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -262,11 +262,11 @@ PHP_FUNCTION(bcsub)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
bc_sub (first, second, &result, scale);
if (result->n_scale > scale) {
@@ -291,7 +291,7 @@ PHP_FUNCTION(bcmul)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -299,12 +299,12 @@ PHP_FUNCTION(bcmul)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- bc_multiply (first, second, &result, scale TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ bc_multiply (first, second, &result, scale);
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -328,7 +328,7 @@ PHP_FUNCTION(bcdiv)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -336,13 +336,13 @@ PHP_FUNCTION(bcdiv)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
- switch (bc_divide(first, second, &result, scale TSRMLS_CC)) {
+ switch (bc_divide(first, second, &result, scale)) {
case 0: /* OK */
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -350,7 +350,7 @@ PHP_FUNCTION(bcdiv)
RETVAL_STR(bc_num2str(result));
break;
case -1: /* division by zero */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
break;
}
@@ -369,22 +369,22 @@ PHP_FUNCTION(bcmod)
size_t left_len, right_len;
bc_num first, second, result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &left, &left_len, &right, &right_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &left, &left_len, &right, &right_len) == FAILURE) {
return;
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- bc_str2num(&first, left, 0 TSRMLS_CC);
- bc_str2num(&second, right, 0 TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ bc_str2num(&first, left, 0);
+ bc_str2num(&second, right, 0);
- switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) {
+ switch (bc_modulo(first, second, &result, 0)) {
case 0:
RETVAL_STR(bc_num2str(result));
break;
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
break;
}
@@ -405,21 +405,21 @@ PHP_FUNCTION(bcpowmod)
zend_long scale = BCG(bc_precision);
int scale_int;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
return;
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&mod TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- php_str2num(&mod, modulous TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&mod);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ php_str2num(&mod, modulous);
scale_int = (int) ((int)scale < 0 ? 0 : scale);
- if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) {
+ if (bc_raisemod(first, second, mod, &result, scale_int) != -1) {
if (result->n_scale > scale) {
result->n_scale = (int)scale;
}
@@ -446,7 +446,7 @@ PHP_FUNCTION(bcpow)
bc_num first, second, result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -454,12 +454,12 @@ PHP_FUNCTION(bcpow)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&first, left TSRMLS_CC);
- php_str2num(&second, right TSRMLS_CC);
- bc_raise (first, second, &result, scale TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
+ bc_init_num(&result);
+ php_str2num(&first, left);
+ php_str2num(&second, right);
+ bc_raise (first, second, &result, scale);
if (result->n_scale > scale) {
result->n_scale = scale;
@@ -483,7 +483,7 @@ PHP_FUNCTION(bcsqrt)
bc_num result;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|l", &left, &left_len, &scale_param) == FAILURE) {
return;
}
@@ -491,16 +491,16 @@ PHP_FUNCTION(bcsqrt)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&result TSRMLS_CC);
- php_str2num(&result, left TSRMLS_CC);
+ bc_init_num(&result);
+ php_str2num(&result, left);
- if (bc_sqrt (&result, scale TSRMLS_CC) != 0) {
+ if (bc_sqrt (&result, scale) != 0) {
if (result->n_scale > scale) {
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number");
+ php_error_docref(NULL, E_WARNING, "Square root of negative number");
}
bc_free_num(&result);
@@ -518,7 +518,7 @@ PHP_FUNCTION(bccomp)
bc_num first, second;
int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
@@ -526,11 +526,11 @@ PHP_FUNCTION(bccomp)
scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
- bc_init_num(&first TSRMLS_CC);
- bc_init_num(&second TSRMLS_CC);
+ bc_init_num(&first);
+ bc_init_num(&second);
- bc_str2num(&first, left, scale TSRMLS_CC);
- bc_str2num(&second, right, scale TSRMLS_CC);
+ bc_str2num(&first, left, scale);
+ bc_str2num(&second, right, scale);
RETVAL_LONG(bc_compare(first, second));
bc_free_num(&first);
@@ -545,7 +545,7 @@ PHP_FUNCTION(bcscale)
{
zend_long new_scale;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_scale) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &new_scale) == FAILURE) {
return;
}
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h
index 1e75cbdca3..f091f8ba31 100644
--- a/ext/bcmath/libbcmath/src/bcmath.h
+++ b/ext/bcmath/libbcmath/src/bcmath.h
@@ -99,7 +99,7 @@ typedef struct bc_struct
#endif
#endif
-_PROTOTYPE(void bc_init_numbers, (TSRMLS_D));
+_PROTOTYPE(void bc_init_numbers, (void));
_PROTOTYPE(bc_num _bc_new_num_ex, (int length, int scale, int persistent));
@@ -107,9 +107,9 @@ _PROTOTYPE(void _bc_free_num_ex, (bc_num *num, int persistent));
_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
-_PROTOTYPE(void bc_init_num, (bc_num *num TSRMLS_DC));
+_PROTOTYPE(void bc_init_num, (bc_num *num));
-_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale TSRMLS_DC));
+_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
_PROTOTYPE(zend_string *bc_num2str, (bc_num num));
@@ -119,7 +119,7 @@ _PROTOTYPE(long bc_num2long, (bc_num num));
_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
-_PROTOTYPE(char bc_is_zero, (bc_num num TSRMLS_DC));
+_PROTOTYPE(char bc_is_zero, (bc_num num));
_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
@@ -129,26 +129,26 @@ _PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
-_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC));
+_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
-_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC));
+_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
- int scale TSRMLS_DC));
+ int scale));
_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
- bc_num *rem, int scale TSRMLS_DC));
+ bc_num *rem, int scale));
_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
- bc_num *result, int scale TSRMLS_DC));
+ bc_num *result, int scale));
_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
- int scale TSRMLS_DC));
+ int scale));
-_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale TSRMLS_DC));
+_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
- int leading_zero TSRMLS_DC));
+ int leading_zero));
/* Prototypes needed for external utility routines. */
diff --git a/ext/bcmath/libbcmath/src/debug.c b/ext/bcmath/libbcmath/src/debug.c
index 52e4e044d5..0e3b64ac01 100644
--- a/ext/bcmath/libbcmath/src/debug.c
+++ b/ext/bcmath/libbcmath/src/debug.c
@@ -48,9 +48,9 @@ out_char (int c)
void
-pn (bc_num num TSRMLS_DC)
+pn (bc_num num)
{
- bc_out_num (num, 10, out_char, 0 TSRMLS_CC);
+ bc_out_num (num, 10, out_char, 0);
out_char ('\n');
}
diff --git a/ext/bcmath/libbcmath/src/div.c b/ext/bcmath/libbcmath/src/div.c
index 8c05170c7e..61d9496617 100644
--- a/ext/bcmath/libbcmath/src/div.c
+++ b/ext/bcmath/libbcmath/src/div.c
@@ -85,7 +85,7 @@ _one_mult (num, size, digit, result)
by zero is tried. The algorithm is found in Knuth Vol 2. p237. */
int
-bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
+bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale)
{
bc_num qval;
unsigned char *num1, *num2;
@@ -98,7 +98,7 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
unsigned int norm;
/* Test for divide by zero. */
- if (bc_is_zero (n2 TSRMLS_CC)) return -1;
+ if (bc_is_zero (n2)) return -1;
/* Test for divide by 1. If it is we must truncate. */
if (n2->n_scale == 0)
@@ -259,7 +259,7 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale TSRMLS_DC)
/* Clean up and return the number. */
qval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS );
- if (bc_is_zero (qval TSRMLS_CC)) qval->n_sign = PLUS;
+ if (bc_is_zero (qval)) qval->n_sign = PLUS;
_bc_rm_leading_zeros (qval);
bc_free_num (quot);
*quot = qval;
diff --git a/ext/bcmath/libbcmath/src/divmod.c b/ext/bcmath/libbcmath/src/divmod.c
index 2949bd10d4..09d43756c2 100644
--- a/ext/bcmath/libbcmath/src/divmod.c
+++ b/ext/bcmath/libbcmath/src/divmod.c
@@ -45,24 +45,24 @@
*/
int
-bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS_DC)
+bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
{
bc_num quotient = NULL;
bc_num temp;
int rscale;
/* Check for correct numbers. */
- if (bc_is_zero (num2 TSRMLS_CC)) return -1;
+ if (bc_is_zero (num2)) return -1;
/* Calculate final scale. */
rscale = MAX (num1->n_scale, num2->n_scale+scale);
- bc_init_num(&temp TSRMLS_CC);
+ bc_init_num(&temp);
/* Calculate it. */
- bc_divide (num1, num2, &temp, scale TSRMLS_CC);
+ bc_divide (num1, num2, &temp, scale);
if (quot)
quotient = bc_copy_num (temp);
- bc_multiply (temp, num2, &temp, rscale TSRMLS_CC);
+ bc_multiply (temp, num2, &temp, rscale);
bc_sub (num1, temp, rem, rscale);
bc_free_num (&temp);
@@ -80,8 +80,8 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale TSRMLS
result in RESULT. */
int
-bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
+bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale)
{
- return bc_divmod (num1, num2, NULL, result, scale TSRMLS_CC);
+ return bc_divmod (num1, num2, NULL, result, scale);
}
diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c
index 986ad1df24..6ceb480d8c 100644
--- a/ext/bcmath/libbcmath/src/init.c
+++ b/ext/bcmath/libbcmath/src/init.c
@@ -101,7 +101,7 @@ _bc_free_num_ex (num, persistent)
/* Intitialize the number package! */
void
-bc_init_numbers (TSRMLS_D)
+bc_init_numbers (void)
{
BCG(_zero_) = _bc_new_num_ex (1,0,1);
BCG(_one_) = _bc_new_num_ex (1,0,1);
@@ -124,7 +124,7 @@ bc_copy_num (bc_num num)
/* Initialize a number NUM by making it a copy of zero. */
void
-bc_init_num (bc_num *num TSRMLS_DC)
+bc_init_num (bc_num *num)
{
*num = bc_copy_num (BCG(_zero_));
}
diff --git a/ext/bcmath/libbcmath/src/output.c b/ext/bcmath/libbcmath/src/output.c
index ad4e375467..9358c6b1f5 100644
--- a/ext/bcmath/libbcmath/src/output.c
+++ b/ext/bcmath/libbcmath/src/output.c
@@ -87,9 +87,9 @@ bc_out_long (val, size, space, out_char)
void
#ifdef __STDC__
-bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero TSRMLS_DC)
+bc_out_num (bc_num num, int o_base, void (*out_char)(int), int leading_zero)
#else
-bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_DC)
+bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero)
#endif
{
char *nptr;
@@ -101,7 +101,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
if (num->n_sign == MINUS) (*out_char) ('-');
/* Output the number. */
- if (bc_is_zero (num TSRMLS_CC))
+ if (bc_is_zero (num))
(*out_char) ('0');
else
if (o_base == 10)
@@ -114,7 +114,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
else
nptr++;
- if (leading_zero && bc_is_zero (num TSRMLS_CC))
+ if (leading_zero && bc_is_zero (num))
(*out_char) ('0');
/* Now the fraction. */
@@ -128,36 +128,36 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
else
{
/* special case ... */
- if (leading_zero && bc_is_zero (num TSRMLS_CC))
+ if (leading_zero && bc_is_zero (num))
(*out_char) ('0');
/* The number is some other base. */
digits = NULL;
- bc_init_num (&int_part TSRMLS_CC);
- bc_divide (num, BCG(_one_), &int_part, 0 TSRMLS_CC);
- bc_init_num (&frac_part TSRMLS_CC);
- bc_init_num (&cur_dig TSRMLS_CC);
- bc_init_num (&base TSRMLS_CC);
+ bc_init_num (&int_part);
+ bc_divide (num, BCG(_one_), &int_part, 0);
+ bc_init_num (&frac_part);
+ bc_init_num (&cur_dig);
+ bc_init_num (&base);
bc_sub (num, int_part, &frac_part, 0);
/* Make the INT_PART and FRAC_PART positive. */
int_part->n_sign = PLUS;
frac_part->n_sign = PLUS;
bc_int2num (&base, o_base);
- bc_init_num (&max_o_digit TSRMLS_CC);
+ bc_init_num (&max_o_digit);
bc_int2num (&max_o_digit, o_base-1);
/* Get the digits of the integer part and push them on a stack. */
- while (!bc_is_zero (int_part TSRMLS_CC))
+ while (!bc_is_zero (int_part))
{
- bc_modulo (int_part, base, &cur_dig, 0 TSRMLS_CC);
+ bc_modulo (int_part, base, &cur_dig, 0);
/* PHP Change: malloc() -> emalloc() */
temp = (stk_rec *) emalloc (sizeof(stk_rec));
if (temp == NULL) bc_out_of_memory();
temp->digit = bc_num2long (cur_dig);
temp->next = digits;
digits = temp;
- bc_divide (int_part, base, &int_part, 0 TSRMLS_CC);
+ bc_divide (int_part, base, &int_part, 0);
}
/* Print the digits on the stack. */
@@ -183,7 +183,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
pre_space = 0;
t_num = bc_copy_num (BCG(_one_));
while (t_num->n_len <= num->n_scale) {
- bc_multiply (frac_part, base, &frac_part, num->n_scale TSRMLS_CC);
+ bc_multiply (frac_part, base, &frac_part, num->n_scale);
fdigit = bc_num2long (frac_part);
bc_int2num (&int_part, fdigit);
bc_sub (frac_part, int_part, &frac_part, 0);
@@ -193,7 +193,7 @@ bc_out_num (bc_num num, int o_base, void (*out_char)(), int leading_zero TSRMLS_
bc_out_long (fdigit, max_o_digit->n_len, pre_space, out_char);
pre_space = 1;
}
- bc_multiply (t_num, base, &t_num, 0 TSRMLS_CC);
+ bc_multiply (t_num, base, &t_num, 0);
}
bc_free_num (&t_num);
}
diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c
index f2f4f4a1d7..ee454fa5d2 100644
--- a/ext/bcmath/libbcmath/src/raise.c
+++ b/ext/bcmath/libbcmath/src/raise.c
@@ -44,7 +44,7 @@
only the integer part is used. */
void
-bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
+bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale)
{
bc_num temp, power;
long exponent;
@@ -87,7 +87,7 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
while ((exponent & 1) == 0)
{
pwrscale = 2*pwrscale;
- bc_multiply (power, power, &power, pwrscale TSRMLS_CC);
+ bc_multiply (power, power, &power, pwrscale);
exponent = exponent >> 1;
}
temp = bc_copy_num (power);
@@ -98,10 +98,10 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
while (exponent > 0)
{
pwrscale = 2*pwrscale;
- bc_multiply (power, power, &power, pwrscale TSRMLS_CC);
+ bc_multiply (power, power, &power, pwrscale);
if ((exponent & 1) == 1) {
calcscale = pwrscale + calcscale;
- bc_multiply (temp, power, &temp, calcscale TSRMLS_CC);
+ bc_multiply (temp, power, &temp, calcscale);
}
exponent = exponent >> 1;
}
@@ -109,7 +109,7 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale TSRMLS_DC)
/* Assign the value. */
if (neg)
{
- bc_divide (BCG(_one_), temp, result, rscale TSRMLS_CC);
+ bc_divide (BCG(_one_), temp, result, rscale);
bc_free_num (&temp);
}
else
diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c
index 58964bec58..4c3c417760 100644
--- a/ext/bcmath/libbcmath/src/raisemod.c
+++ b/ext/bcmath/libbcmath/src/raisemod.c
@@ -43,20 +43,20 @@
only the integer part is used. */
int
-bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSRMLS_DC)
+bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
{
bc_num power, exponent, parity, temp;
int rscale;
/* Check for correct numbers. */
- if (bc_is_zero(mod TSRMLS_CC)) return -1;
+ if (bc_is_zero(mod)) return -1;
if (bc_is_neg(expo)) return -1;
/* Set initial values. */
power = bc_copy_num (base);
exponent = bc_copy_num (expo);
temp = bc_copy_num (BCG(_one_));
- bc_init_num(&parity TSRMLS_CC);
+ bc_init_num(&parity);
/* Check the base for scale digits. */
if (base->n_scale != 0)
@@ -66,7 +66,7 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSR
if (exponent->n_scale != 0)
{
bc_rt_warn ("non-zero scale in exponent");
- bc_divide (exponent, BCG(_one_), &exponent, 0 TSRMLS_CC); /*truncate */
+ bc_divide (exponent, BCG(_one_), &exponent, 0); /*truncate */
}
/* Check the modulus for scale digits. */
@@ -75,17 +75,17 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale TSR
/* Do the calculation. */
rscale = MAX(scale, base->n_scale);
- while ( !bc_is_zero(exponent TSRMLS_CC) )
+ while ( !bc_is_zero(exponent) )
{
- (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0 TSRMLS_CC);
- if ( !bc_is_zero(parity TSRMLS_CC) )
+ (void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
+ if ( !bc_is_zero(parity) )
{
- bc_multiply (temp, power, &temp, rscale TSRMLS_CC);
- (void) bc_modulo (temp, mod, &temp, scale TSRMLS_CC);
+ bc_multiply (temp, power, &temp, rscale);
+ (void) bc_modulo (temp, mod, &temp, scale);
}
- bc_multiply (power, power, &power, rscale TSRMLS_CC);
- (void) bc_modulo (power, mod, &power, scale TSRMLS_CC);
+ bc_multiply (power, power, &power, rscale);
+ (void) bc_modulo (power, mod, &power, scale);
}
/* Assign the value. */
diff --git a/ext/bcmath/libbcmath/src/recmul.c b/ext/bcmath/libbcmath/src/recmul.c
index 64014f3a6e..65e3a623c5 100644
--- a/ext/bcmath/libbcmath/src/recmul.c
+++ b/ext/bcmath/libbcmath/src/recmul.c
@@ -180,7 +180,7 @@ _bc_shift_addsub (bc_num accum, bc_num val, int shift, int sub)
*/
static void
_bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
- int full_scale TSRMLS_DC)
+ int full_scale)
{
bc_num u0, u1, v0, v1;
bc_num m1, m2, m3, d1, d2;
@@ -218,12 +218,12 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
_bc_rm_leading_zeros (v1);
_bc_rm_leading_zeros (v0);
- m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC);
+ m1zero = bc_is_zero(u1) || bc_is_zero(v1);
/* Calculate sub results ... */
- bc_init_num(&d1 TSRMLS_CC);
- bc_init_num(&d2 TSRMLS_CC);
+ bc_init_num(&d1);
+ bc_init_num(&d2);
bc_sub (u1, u0, &d1, 0);
d1len = d1->n_len;
bc_sub (v0, v1, &d2, 0);
@@ -234,17 +234,17 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
if (m1zero)
m1 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0 TSRMLS_CC);
+ _bc_rec_mul (u1, u1->n_len, v1, v1->n_len, &m1, 0);
- if (bc_is_zero(d1 TSRMLS_CC) || bc_is_zero(d2 TSRMLS_CC))
+ if (bc_is_zero(d1) || bc_is_zero(d2))
m2 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0 TSRMLS_CC);
+ _bc_rec_mul (d1, d1len, d2, d2len, &m2, 0);
- if (bc_is_zero(u0 TSRMLS_CC) || bc_is_zero(v0 TSRMLS_CC))
+ if (bc_is_zero(u0) || bc_is_zero(v0))
m3 = bc_copy_num (BCG(_zero_));
else
- _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0 TSRMLS_CC);
+ _bc_rec_mul (u0, u0->n_len, v0, v0->n_len, &m3, 0);
/* Initialize product */
prodlen = ulen+vlen+1;
@@ -275,7 +275,7 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
*/
void
-bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
+bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale)
{
bc_num pval;
int len1, len2;
@@ -288,7 +288,7 @@ bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
prod_scale = MIN(full_scale,MAX(scale,MAX(n1->n_scale,n2->n_scale)));
/* Do the multiply */
- _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale TSRMLS_CC);
+ _bc_rec_mul (n1, len1, n2, len2, &pval, full_scale);
/* Assign to prod and clean up the number. */
pval->n_sign = ( n1->n_sign == n2->n_sign ? PLUS : MINUS );
@@ -296,7 +296,7 @@ bc_multiply (bc_num n1, bc_num n2, bc_num *prod, int scale TSRMLS_DC)
pval->n_len = len2 + len1 + 1 - full_scale;
pval->n_scale = prod_scale;
_bc_rm_leading_zeros (pval);
- if (bc_is_zero (pval TSRMLS_CC))
+ if (bc_is_zero (pval))
pval->n_sign = PLUS;
bc_free_num (prod);
*prod = pval;
diff --git a/ext/bcmath/libbcmath/src/sqrt.c b/ext/bcmath/libbcmath/src/sqrt.c
index 5db5113eb5..61d3d9484f 100644
--- a/ext/bcmath/libbcmath/src/sqrt.c
+++ b/ext/bcmath/libbcmath/src/sqrt.c
@@ -42,7 +42,7 @@
after the decimal place. */
int
-bc_sqrt (bc_num *num, int scale TSRMLS_DC)
+bc_sqrt (bc_num *num, int scale)
{
int rscale, cmp_res, done;
int cscale;
@@ -71,9 +71,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
/* Initialize the variables. */
rscale = MAX (scale, (*num)->n_scale);
- bc_init_num(&guess TSRMLS_CC);
- bc_init_num(&guess1 TSRMLS_CC);
- bc_init_num(&diff TSRMLS_CC);
+ bc_init_num(&guess);
+ bc_init_num(&guess1);
+ bc_init_num(&diff);
point5 = bc_new_num (1,1);
point5->n_value[1] = 5;
@@ -91,9 +91,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
bc_int2num (&guess,10);
bc_int2num (&guess1,(*num)->n_len);
- bc_multiply (guess1, point5, &guess1, 0 TSRMLS_CC);
+ bc_multiply (guess1, point5, &guess1, 0);
guess1->n_scale = 0;
- bc_raise (guess, guess1, &guess, 0 TSRMLS_CC);
+ bc_raise (guess, guess1, &guess, 0);
bc_free_num (&guess1);
cscale = 3;
}
@@ -104,9 +104,9 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
{
bc_free_num (&guess1);
guess1 = bc_copy_num (guess);
- bc_divide (*num, guess, &guess, cscale TSRMLS_CC);
+ bc_divide (*num, guess, &guess, cscale);
bc_add (guess, guess1, &guess, 0);
- bc_multiply (guess, point5, &guess, cscale TSRMLS_CC);
+ bc_multiply (guess, point5, &guess, cscale);
bc_sub (guess, guess1, &diff, cscale+1);
if (bc_is_near_zero (diff, cscale))
{
@@ -119,7 +119,7 @@ bc_sqrt (bc_num *num, int scale TSRMLS_DC)
/* Assign the number and clean up. */
bc_free_num (num);
- bc_divide (guess,BCG(_one_),num,rscale TSRMLS_CC);
+ bc_divide (guess,BCG(_one_),num,rscale);
bc_free_num (&guess);
bc_free_num (&guess1);
bc_free_num (&point5);
diff --git a/ext/bcmath/libbcmath/src/str2num.c b/ext/bcmath/libbcmath/src/str2num.c
index c484c158e5..18776c6308 100644
--- a/ext/bcmath/libbcmath/src/str2num.c
+++ b/ext/bcmath/libbcmath/src/str2num.c
@@ -41,7 +41,7 @@
/* Convert strings to bc numbers. Base 10 only.*/
void
-bc_str2num (bc_num *num, char *str, int scale TSRMLS_DC)
+bc_str2num (bc_num *num, char *str, int scale)
{
int digits, strscale;
char *ptr, *nptr;
diff --git a/ext/bcmath/libbcmath/src/zero.c b/ext/bcmath/libbcmath/src/zero.c
index 4ee249ee71..4a7589eb96 100644
--- a/ext/bcmath/libbcmath/src/zero.c
+++ b/ext/bcmath/libbcmath/src/zero.c
@@ -41,7 +41,7 @@
/* In some places we need to check if the number NUM is zero. */
char
-bc_is_zero (bc_num num TSRMLS_DC)
+bc_is_zero (bc_num num)
{
int count;
char *nptr;
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index d49be40d35..8a3eb7f6b0 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -135,7 +135,7 @@ struct php_bz2_stream_data_t {
/* {{{ BZip2 stream implementation */
-static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
size_t ret = 0;
@@ -158,7 +158,7 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS
return ret;
}
-static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count)
{
size_t wrote = 0;
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
@@ -182,7 +182,7 @@ static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count
return wrote;
}
-static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_bz2iop_close(php_stream *stream, int close_handle)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
int ret = EOF;
@@ -200,7 +200,7 @@ static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
return ret;
}
-static int php_bz2iop_flush(php_stream *stream TSRMLS_DC)
+static int php_bz2iop_flush(php_stream *stream)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
return BZ2_bzflush(self->bz_file);
@@ -219,7 +219,7 @@ php_stream_ops php_stream_bz2io_ops = {
/* {{{ Bzip2 stream openers */
PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
- const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
+ const char *mode, php_stream *innerstream STREAMS_DC)
{
struct php_bz2_stream_data_t *self;
@@ -236,7 +236,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
const char *mode,
int options,
char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *retstream = NULL, *stream = NULL;
char *path_copy = NULL;
@@ -250,12 +250,12 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
}
#ifdef VIRTUAL_DIR
- virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC);
+ virtual_filepath_ex(path, &path_copy, NULL);
#else
path_copy = path;
#endif
- if (php_check_open_basedir(path_copy TSRMLS_CC)) {
+ if (php_check_open_basedir(path_copy)) {
#ifdef VIRTUAL_DIR
efree(path_copy);
#endif
@@ -301,7 +301,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
}
if (bz_file) {
- retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
+ retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC);
if (retstream) {
return retstream;
}
@@ -341,15 +341,15 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
static PHP_MINIT_FUNCTION(bz2)
{
- php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
- php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper);
+ php_stream_filter_register_factory("bzip2.*", &php_bz2_filter_factory);
return SUCCESS;
}
static PHP_MSHUTDOWN_FUNCTION(bz2)
{
- php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
- php_stream_filter_unregister_factory("bzip2.*" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("compress.bzip2");
+ php_stream_filter_unregister_factory("bzip2.*");
return SUCCESS;
}
@@ -373,14 +373,14 @@ static PHP_FUNCTION(bzread)
php_stream *stream;
zend_string *data;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &bz, &len)) {
RETURN_FALSE;
}
php_stream_from_zval(stream, bz);
if ((len + 1) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
+ php_error_docref(NULL, E_WARNING, "length may not be negative");
RETURN_FALSE;
}
data = zend_string_alloc(len, 0);
@@ -402,19 +402,19 @@ static PHP_FUNCTION(bzopen)
BZFILE *bz; /* The compressed file stream */
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &file, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &file, &mode, &mode_len) == FAILURE) {
return;
}
if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode);
+ php_error_docref(NULL, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode);
RETURN_FALSE;
}
/* If it's not a resource its a string containing the filename to open */
if (Z_TYPE_P(file) == IS_STRING) {
if (Z_STRLEN_P(file) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty");
+ php_error_docref(NULL, E_WARNING, "filename cannot be empty");
RETURN_FALSE;
}
@@ -432,10 +432,10 @@ static PHP_FUNCTION(bzopen)
stream_mode_len = strlen(stream->mode);
if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
RETURN_FALSE;
} else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
+ php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
RETURN_FALSE;
}
@@ -443,7 +443,7 @@ static PHP_FUNCTION(bzopen)
case 'r':
/* only "r" and "rb" are supported */
if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read from a stream opened in write only mode");
+ php_error_docref(NULL, E_WARNING, "cannot read from a stream opened in write only mode");
RETURN_FALSE;
}
break;
@@ -452,7 +452,7 @@ static PHP_FUNCTION(bzopen)
if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])
&& stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a')
&& stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write to a stream opened in read only mode");
+ php_error_docref(NULL, E_WARNING, "cannot write to a stream opened in read only mode");
RETURN_FALSE;
}
break;
@@ -469,7 +469,7 @@ static PHP_FUNCTION(bzopen)
stream = php_stream_bz2open_from_BZFILE(bz, mode, stream);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "first parameter has to be string or file-resource");
+ php_error_docref(NULL, E_WARNING, "first parameter has to be string or file-resource");
RETURN_FALSE;
}
@@ -522,7 +522,7 @@ static PHP_FUNCTION(bzcompress)
argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &source, &source_len, &zblock_size, &zwork_factor) == FAILURE) {
return;
}
@@ -573,7 +573,7 @@ static PHP_FUNCTION(bzdecompress)
#endif
bz_stream bzs;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &small)) {
RETURN_FALSE;
}
@@ -624,7 +624,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
int errnum; /* Error number */
struct php_bz2_stream_data_t *self;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &bzp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &bzp) == FAILURE) {
return;
}
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index a2a21d765b..8b9ee99804 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -91,13 +91,13 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < bucket->buflen) {
if (data->status == PHP_BZ2_UNITIALIZED) {
status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint);
if (BZ_OK != status) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
@@ -127,7 +127,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
}
} else if (status != BZ_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -139,19 +139,19 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
} else if (status == BZ_STREAM_END && data->strm.avail_out >= data->outbuf_len) {
/* no more data to decompress, and nothing was spat out */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_PASS_ON;
}
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if ((data->status == PHP_BZ2_RUNNING) && (flags & PSFS_FLAG_FLUSH_CLOSE)) {
@@ -162,8 +162,8 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -180,7 +180,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
return exit_status;
}
-static void php_bz2_decompress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_bz2_decompress_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_bz2_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -227,7 +227,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < bucket->buflen) {
desired = bucket->buflen - bin;
@@ -240,7 +240,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
status = BZ2_bzCompress(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? BZ_FINISH : (flags & PSFS_FLAG_FLUSH_INC ? BZ_FLUSH : BZ_RUN));
if (status != BZ_RUN_OK && status != BZ_FLUSH_OK && status != BZ_FINISH_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -253,14 +253,14 @@ static php_stream_filter_status_t php_bz2_compress_filter(
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -271,8 +271,8 @@ static php_stream_filter_status_t php_bz2_compress_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -286,7 +286,7 @@ static php_stream_filter_status_t php_bz2_compress_filter(
return exit_status;
}
-static void php_bz2_compress_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_bz2_compress_dtor(php_stream_filter *thisfilter)
{
if (Z_PTR(thisfilter->abstract)) {
php_bz2_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -307,7 +307,7 @@ static php_stream_filter_ops php_bz2_compress_ops = {
/* {{{ bzip2.* common factory */
-static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_bz2_filter_data *data;
@@ -316,7 +316,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
/* Create this filter */
data = pecalloc(1, sizeof(php_bz2_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data));
return NULL;
}
@@ -329,14 +329,14 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048;
data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent);
if (!data->inbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len);
pefree(data, persistent);
return NULL;
}
data->strm.avail_in = 0;
data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent);
if (!data->outbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
@@ -351,7 +351,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
if (Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) {
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "concatenated", sizeof("concatenated")-1))) {
- data->expect_concatenated = zend_is_true(tmpzval TSRMLS_CC);
+ data->expect_concatenated = zend_is_true(tmpzval);
tmpzval = NULL;
}
@@ -361,7 +361,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
}
if (tmpzval) {
- data->small_footprint = zend_is_true(tmpzval TSRMLS_CC);
+ data->small_footprint = zend_is_true(tmpzval);
}
}
@@ -382,7 +382,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
ZVAL_DUP(&tmp, tmpzval);
convert_to_long(&tmp);
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
} else {
blockSize100k = (int)Z_LVAL(tmp);
}
@@ -396,7 +396,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
convert_to_long(&tmp);
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
} else {
workFactor = (int)Z_LVAL(tmp);
}
diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h
index 6e90e8d67f..dd226a20ad 100644
--- a/ext/bz2/php_bz2.h
+++ b/ext/bz2/php_bz2.h
@@ -47,11 +47,11 @@ extern zend_module_entry bz2_module_entry;
# define PHP_BZ2_API
#endif
-PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC);
-#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
-#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
+#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC)
+#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC)
extern php_stream_filter_factory php_bz2_filter_factory;
extern php_stream_ops php_stream_bz2io_ops;
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index 3dd16ce45b..438bf38527 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -31,7 +31,7 @@ PHP_FUNCTION(unixtojd)
time_t ts = 0;
struct tm *ta, tmbuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &ts) == FAILURE) {
return;
}
@@ -55,7 +55,7 @@ PHP_FUNCTION(jdtounix)
{
zend_long uday;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &uday) == FAILURE) {
return;
}
uday -= 2440588 /* J.D. of 1.1.1970 */;
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 50385482a7..3de1202772 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -292,7 +292,7 @@ PHP_FUNCTION(cal_info)
zend_long cal = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &cal) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &cal) == FAILURE) {
RETURN_FALSE;
}
@@ -311,7 +311,7 @@ PHP_FUNCTION(cal_info)
if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -328,12 +328,12 @@ PHP_FUNCTION(cal_days_in_month)
struct cal_entry_t *calendar;
zend_long sdn_start, sdn_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &cal, &month, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &cal, &month, &year) == FAILURE) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -342,7 +342,7 @@ PHP_FUNCTION(cal_days_in_month)
sdn_start = calendar->to_jd(year, month, 1);
if (sdn_start == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date.");
+ php_error_docref(NULL, E_WARNING, "invalid date.");
RETURN_FALSE;
}
@@ -370,12 +370,12 @@ PHP_FUNCTION(cal_to_jd)
{
zend_long cal, month, day, year;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "llll", &cal, &month, &day, &year) != SUCCESS) {
RETURN_FALSE;
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd.", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
RETURN_FALSE;
}
@@ -397,7 +397,7 @@ PHP_FUNCTION(cal_from_jd)
}
if (cal < 0 || cal >= CAL_NUM_CALS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid calendar ID %pd", cal);
+ php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd", cal);
RETURN_FALSE;
}
calendar = &cal_conversion_table[cal];
@@ -438,7 +438,7 @@ PHP_FUNCTION(jdtogregorian)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -455,7 +455,7 @@ PHP_FUNCTION(gregoriantojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -471,7 +471,7 @@ PHP_FUNCTION(jdtojulian)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -488,7 +488,7 @@ PHP_FUNCTION(juliantojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -601,7 +601,7 @@ PHP_FUNCTION(jdtojewish)
char date[16], hebdate[32];
char *dayp, *yearp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|bl", &julday, &heb, &fl) == FAILURE) {
RETURN_FALSE;
}
@@ -611,7 +611,7 @@ PHP_FUNCTION(jdtojewish)
RETURN_STRING(date);
} else {
if (year <= 0 || year > 9999) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Year out of range (0-9999).");
+ php_error_docref(NULL, E_WARNING, "Year out of range (0-9999).");
RETURN_FALSE;
}
@@ -636,7 +636,7 @@ PHP_FUNCTION(jewishtojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -652,7 +652,7 @@ PHP_FUNCTION(jdtofrench)
int year, month, day;
char date[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &julday) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &julday) == FAILURE) {
RETURN_FALSE;
}
@@ -669,7 +669,7 @@ PHP_FUNCTION(frenchtojd)
{
zend_long year, month, day;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
@@ -685,7 +685,7 @@ PHP_FUNCTION(jddayofweek)
int day;
char *daynamel, *daynames;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &julday, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -716,7 +716,7 @@ PHP_FUNCTION(jdmonthname)
char *monthname = NULL;
int month, day, year;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &julday, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &julday, &mode) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index b6dc135d33..90e93cb54b 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -46,13 +46,13 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, zend_long gm)
}
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(),
"|ll", &year, &method) == FAILURE) {
return;
}
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive");
+ php_error_docref(NULL, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive");
RETURN_FALSE;
}
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 7de6d949bb..9dc6f23801 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -53,19 +53,19 @@ PHP_FUNCTION(com_create_instance)
&authid, EOAC_NONE
};
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "s|s!ls",
+ ZEND_NUM_ARGS(), "s|s!ls",
&module_name, &module_name_len, &server_name, &server_name_len,
&obj->code_page, &typelib_name, &typelib_name_len) &&
FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "sa|ls",
+ ZEND_NUM_ARGS(), "sa|ls",
&module_name, &module_name_len, &server_params, &obj->code_page,
&typelib_name, &typelib_name_len)) {
- php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -114,21 +114,21 @@ PHP_FUNCTION(com_create_instance)
}
if (server_name && !COMG(allow_dcom)) {
- php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]" TSRMLS_CC);
+ php_com_throw_exception(E_ERROR, "DCOM has been disabled by your administrator [com.allow_dcom=0]");
return;
}
- moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page TSRMLS_CC);
+ moniker = php_com_string_to_olestring(module_name, module_name_len, obj->code_page);
/* if instantiating a remote object, either directly, or via
* a moniker, fill in the relevant info */
if (server_name) {
info.dwReserved1 = 0;
info.dwReserved2 = 0;
- info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page TSRMLS_CC);
+ info.pwszName = php_com_string_to_olestring(server_name, server_name_len, obj->code_page);
if (user_name) {
- authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC);
+ authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page);
authid.UserLength = (ULONG)user_name_len;
if (password) {
@@ -228,7 +228,7 @@ PHP_FUNCTION(com_create_instance)
spprintf(&msg, 0, "Failed to create COM object `%s': %s", module_name, werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
ZEND_CTOR_MAKE_NULL();
return;
@@ -241,11 +241,11 @@ PHP_FUNCTION(com_create_instance)
/* load up the library from the named file */
int cached;
- TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached TSRMLS_CC);
+ TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached);
if (TL) {
if (COMG(autoreg_on) && !cached) {
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
}
/* cross your fingers... there is no guarantee that this ITypeInfo
@@ -261,10 +261,10 @@ PHP_FUNCTION(com_create_instance)
BSTR name;
if (SUCCEEDED(ITypeLib_GetDocumentation(TL, -1, &name, NULL, NULL, NULL))) {
- typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page TSRMLS_CC);
+ typelib_name = php_com_olestring_to_string(name, &typelib_name_len, obj->code_page);
if (NULL != zend_ts_hash_str_add_ptr(&php_com_typelibraries, typelib_name, typelib_name_len, TL)) {
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
/* add a reference for the hash */
ITypeLib_AddRef(TL);
@@ -272,7 +272,7 @@ PHP_FUNCTION(com_create_instance)
} else {
/* try it anyway */
- php_com_import_typelib(TL, mode, obj->code_page TSRMLS_CC);
+ php_com_import_typelib(TL, mode, obj->code_page);
}
ITypeLib_Release(TL);
@@ -295,32 +295,32 @@ PHP_FUNCTION(com_get_active_object)
HRESULT res;
OLECHAR *module = NULL;
- php_com_initialize(TSRMLS_C);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ php_com_initialize();
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
&module_name, &module_name_len, &code_page)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments!");
return;
}
- module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page TSRMLS_CC);
+ module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page);
res = CLSIDFromString(module, &clsid);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
res = GetActiveObject(&clsid, NULL, &unk);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else if (obj) {
/* we got our dispatchable object */
- php_com_wrap_dispatch(return_value, obj, (int)code_page TSRMLS_CC);
+ php_com_wrap_dispatch(return_value, obj, (int)code_page);
}
}
}
@@ -338,7 +338,7 @@ PHP_FUNCTION(com_get_active_object)
/* Performs an Invoke on the given com object.
* returns a failure code and creates an exception if there was an error */
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
- WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC)
+ WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg)
{
HRESULT hr;
unsigned int arg_err;
@@ -354,11 +354,11 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
switch (hr) {
case DISP_E_EXCEPTION:
if (e.bstrSource) {
- source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page TSRMLS_CC);
+ source = php_com_olestring_to_string(e.bstrSource, &source_len, obj->code_page);
SysFreeString(e.bstrSource);
}
if (e.bstrDescription) {
- desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page TSRMLS_CC);
+ desc = php_com_olestring_to_string(e.bstrDescription, &desc_len, obj->code_page);
SysFreeString(e.bstrDescription);
}
if (PG(html_errors)) {
@@ -406,7 +406,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
}
if (msg) {
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
}
}
@@ -416,7 +416,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
/* map an ID to a name */
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- size_t namelen, DISPID *dispid TSRMLS_DC)
+ size_t namelen, DISPID *dispid)
{
OLECHAR *olename;
HRESULT hr;
@@ -431,7 +431,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
return S_OK;
}
- olename = php_com_string_to_olestring(name, namelen, obj->code_page TSRMLS_CC);
+ olename = php_com_string_to_olestring(name, namelen, obj->code_page);
if (obj->typeinfo) {
hr = ITypeInfo_GetIDsOfNames(obj->typeinfo, &olename, 1, dispid);
@@ -465,7 +465,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
/* the core of COM */
int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f,
- WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args)
{
DISPID dispid, altdispid;
DISPPARAMS disp_params;
@@ -478,7 +478,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
return FAILURE;
}
- hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC);
+ hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid);
if (FAILED(hr)) {
char *winerr = NULL;
@@ -486,7 +486,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
winerr = php_win32_error_to_msg(hr);
spprintf(&msg, 0, "Unable to lookup `%s': %s", f->function_name->val, winerr);
LocalFree(winerr);
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
return FAILURE;
}
@@ -509,7 +509,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
for (j = 0, i = 0; i < nargs; i++) {
if (f->arg_info[nargs - i - 1].pass_by_reference) {
/* put the value into byref_vals instead */
- php_com_variant_from_zval(&byref_vals[j], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&byref_vals[j], &args[nargs - i - 1], obj->code_page);
/* if it is already byref, "move" it into the vargs array, otherwise
* make vargs a reference to this value */
@@ -524,14 +524,14 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
}
j++;
} else {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
}
} else {
/* Invoke'd args are in reverse order */
for (i = 0; i < nargs; i++) {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
}
@@ -547,7 +547,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
}
/* this will create an exception if needed */
- hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0 TSRMLS_CC);
+ hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0);
/* release variants */
if (vargs) {
@@ -564,13 +564,13 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
/* copy that value */
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
- obj->code_page TSRMLS_CC);
+ obj->code_page);
}
} else {
/* not sure if this can ever happen; the variant we marked as BYREF
* is no longer BYREF - copy its value */
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
- obj->code_page TSRMLS_CC);
+ obj->code_page);
}
VariantClear(&byref_vals[j]);
j++;
@@ -591,7 +591,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
- WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg)
{
DISPID altdispid;
DISPPARAMS disp_params;
@@ -605,7 +605,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
/* Invoke'd args are in reverse order */
for (i = 0; i < nargs; i++) {
- php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&vargs[i], &args[nargs - i - 1], obj->code_page);
}
disp_params.cArgs = nargs;
@@ -620,7 +620,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
/* this will create an exception if needed */
- hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, allow_noarg TSRMLS_CC);
+ hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, allow_noarg);
/* release variants */
if (vargs) {
@@ -638,25 +638,25 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
- WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC)
+ WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg)
{
DISPID dispid;
HRESULT hr;
char *winerr = NULL;
char *msg = NULL;
- hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC);
+ hr = php_com_get_id_of_name(obj, name, namelen, &dispid);
if (FAILED(hr)) {
winerr = php_win32_error_to_msg(hr);
spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr);
LocalFree(winerr);
- php_com_throw_exception(hr, msg TSRMLS_CC);
+ php_com_throw_exception(hr, msg);
efree(msg);
return FAILURE;
}
- return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg TSRMLS_CC);
+ return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, allow_noarg);
}
/* {{{ proto string com_create_guid()
@@ -670,12 +670,12 @@ PHP_FUNCTION(com_create_guid)
return;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
size_t len;
char *str;
- str = php_com_olestring_to_string(guid_string, &len, CP_ACP TSRMLS_CC);
+ str = php_com_olestring_to_string(guid_string, &len, CP_ACP);
RETVAL_STRINGL(str, len);
// TODO: avoid reallocation ???
efree(str);
@@ -698,12 +698,12 @@ PHP_FUNCTION(com_event_sink)
RETVAL_FALSE;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Oo|z/",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Oo|z/",
&object, php_com_variant_class_entry, &sinkobject, &sink)) {
RETURN_FALSE;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = CDNO_FETCH(object);
if (sink && Z_TYPE_P(sink) == IS_ARRAY) {
@@ -719,20 +719,20 @@ PHP_FUNCTION(com_event_sink)
dispname = Z_STRVAL_P(sink);
}
- typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC);
+ typeinfo = php_com_locate_typeinfo(typelibname, obj, dispname, 1);
if (typeinfo) {
HashTable *id_to_name;
ALLOC_HASHTABLE(id_to_name);
- if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page TSRMLS_CC)) {
+ if (php_com_process_typeinfo(typeinfo, id_to_name, 0, &obj->sink_id, obj->code_page)) {
/* Create the COM wrapper for this sink */
- obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name TSRMLS_CC);
+ obj->sink_dispatch = php_com_wrapper_export_as_sink(sinkobject, &obj->sink_id, id_to_name);
/* Now hook it up to the source */
- php_com_object_enable_event_sink(obj, TRUE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, TRUE);
RETVAL_TRUE;
} else {
@@ -759,12 +759,12 @@ PHP_FUNCTION(com_print_typeinfo)
php_com_dotnet_object *obj = NULL;
ITypeInfo *typeinfo;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|s!b", &arg1, &ifacename,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z/|s!b", &arg1, &ifacename,
&ifacelen, &wantsink)) {
RETURN_FALSE;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (Z_TYPE_P(arg1) == IS_OBJECT) {
CDNO_FETCH_VERIFY(obj, arg1);
} else {
@@ -772,9 +772,9 @@ PHP_FUNCTION(com_print_typeinfo)
typelibname = Z_STRVAL_P(arg1);
}
- typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0 TSRMLS_CC);
+ typeinfo = php_com_locate_typeinfo(typelibname, obj, ifacename, wantsink ? 1 : 0);
if (typeinfo) {
- php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page) TSRMLS_CC);
+ php_com_process_typeinfo(typeinfo, NULL, 1, NULL, obj ? obj->code_page : COMG(code_page));
ITypeInfo_Release(typeinfo);
RETURN_TRUE;
} else {
@@ -792,10 +792,10 @@ PHP_FUNCTION(com_message_pump)
MSG msg;
DWORD result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timeoutms) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &timeoutms) == FAILURE)
RETURN_FALSE;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
result = MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD)timeoutms, QS_ALLINPUT);
if (result == WAIT_OBJECT_0) {
@@ -823,18 +823,18 @@ PHP_FUNCTION(com_load_typelib)
int codepage = COMG(code_page);
int cached = 0;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &name, &namelen, &cs)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &name, &namelen, &cs)) {
return;
}
RETVAL_FALSE;
- php_com_initialize(TSRMLS_C);
- pTL = php_com_load_typelib_via_cache(name, codepage, &cached TSRMLS_CC);
+ php_com_initialize();
+ pTL = php_com_load_typelib_via_cache(name, codepage, &cached);
if (pTL) {
if (cached) {
RETVAL_TRUE;
- } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage TSRMLS_CC) == SUCCESS) {
+ } else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
RETVAL_TRUE;
}
diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c
index ae2c6ee2f0..35f795187a 100644
--- a/ext/com_dotnet/com_dotnet.c
+++ b/ext/com_dotnet/com_dotnet.c
@@ -121,7 +121,7 @@ struct dotnet_runtime_stuff {
DISPID create_instance;
};
-static HRESULT dotnet_init(char **p_where TSRMLS_DC)
+static HRESULT dotnet_init(char **p_where)
{
HRESULT hr;
struct dotnet_runtime_stuff *stuff;
@@ -197,17 +197,17 @@ PHP_FUNCTION(com_dotnet_create_instance)
char *where = "";
IUnknown *unk = NULL;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff);
if (stuff == NULL) {
- hr = dotnet_init(&where TSRMLS_CC);
+ hr = dotnet_init(&where);
if (FAILED(hr)) {
char buf[1024];
char *err = php_win32_error_to_msg(hr);
snprintf(buf, sizeof(buf), "Failed to init .Net runtime [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -222,7 +222,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZVAL_NULL(object);
return;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
snprintf(buf, sizeof(buf), "Failed to re-init .Net domain [%s] %s", where, err);
if (err)
LocalFree(err);
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZVAL_NULL(object);
return;
}
@@ -243,17 +243,17 @@ PHP_FUNCTION(com_dotnet_create_instance)
obj = CDNO_FETCH(object);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l",
&assembly_name, &assembly_name_len,
&datatype_name, &datatype_name_len,
&obj->code_page)) {
- php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!");
ZEND_CTOR_MAKE_NULL();
return;
}
- oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
- oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
+ oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page);
+ oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page);
oletype_sys = SysAllocString(oletype);
oleassembly_sys = SysAllocString(oleassembly);
where = "CreateInstance";
@@ -313,14 +313,14 @@ PHP_FUNCTION(com_dotnet_create_instance)
if (err && err[0]) {
LocalFree(err);
}
- php_com_throw_exception(hr, buf TSRMLS_CC);
+ php_com_throw_exception(hr, buf);
ZEND_CTOR_MAKE_NULL();
return;
}
}
/* }}} */
-void php_com_dotnet_mshutdown(TSRMLS_D)
+void php_com_dotnet_mshutdown(void)
{
struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);
@@ -336,7 +336,7 @@ void php_com_dotnet_mshutdown(TSRMLS_D)
COMG(dotnet_runtime_stuff) = NULL;
}
-void php_com_dotnet_rshutdown(TSRMLS_D)
+void php_com_dotnet_rshutdown(void)
{
struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index 35fda89963..4498a84e42 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -312,9 +312,9 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
ptr--;
}
- if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached TSRMLS_CC)) != NULL) {
+ if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached)) != NULL) {
if (!cached) {
- php_com_import_typelib(pTL, mode, COMG(code_page) TSRMLS_CC);
+ php_com_import_typelib(pTL, mode, COMG(code_page));
}
ITypeLib_Release(pTL);
}
@@ -358,24 +358,24 @@ PHP_MINIT_FUNCTION(com_dotnet)
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
- php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
- php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_com_saproxy_class_entry = zend_register_internal_class(&ce);
php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL;
/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
INIT_CLASS_ENTRY(ce, "variant", NULL);
ce.create_object = php_com_object_new;
- php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_com_variant_class_entry = zend_register_internal_class(&ce);
php_com_variant_class_entry->get_iterator = php_com_iter_get;
INIT_CLASS_ENTRY(ce, "com", NULL);
ce.create_object = php_com_object_new;
- tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry TSRMLS_CC);
+ tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp->get_iterator = php_com_iter_get;
zend_ts_hash_init(&php_com_typelibraries, 0, NULL, php_com_typelibrary_dtor, 1);
@@ -383,7 +383,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
#if HAVE_MSCOREE_H
INIT_CLASS_ENTRY(ce, "dotnet", NULL);
ce.create_object = php_com_object_new;
- tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry TSRMLS_CC);
+ tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
tmp->get_iterator = php_com_iter_get;
#endif
@@ -475,7 +475,7 @@ PHP_MSHUTDOWN_FUNCTION(com_dotnet)
UNREGISTER_INI_ENTRIES();
#if HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
- php_com_dotnet_mshutdown(TSRMLS_C);
+ php_com_dotnet_mshutdown();
}
#endif
@@ -499,7 +499,7 @@ PHP_RSHUTDOWN_FUNCTION(com_dotnet)
{
#if HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
- php_com_dotnet_rshutdown(TSRMLS_C);
+ php_com_dotnet_rshutdown();
}
#endif
COMG(rshutdown_started) = 1;
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 8b721393fd..60830dc599 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -29,7 +29,7 @@
#include "php_com_dotnet_internal.h"
#include "Zend/zend_exceptions.h"
-static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv TSRMLS_DC)
+static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -45,22 +45,22 @@ static zval *com_property_read(zval *object, zval *member, int type, void **cahc
convert_to_string_ex(member);
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1 TSRMLS_CC);
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1);
if (res == SUCCESS) {
- php_com_zval_from_variant(rv, &v, obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(rv, &v, obj->code_page);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
- php_com_saproxy_create(object, rv, member TSRMLS_CC);
+ php_com_saproxy_create(object, rv, member);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant has no properties");
}
return rv;
}
-static void com_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void com_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -72,15 +72,15 @@ static void com_property_write(zval *object, zval *member, zval *value, void **c
convert_to_string_ex(member);
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
- DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, value, 0 TSRMLS_CC)) {
+ DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &v, 1, value, 0)) {
VariantClear(&v);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant has no properties");
}
}
-static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -93,30 +93,30 @@ static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv T
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, offset, 0, 0 TSRMLS_CC)) {
- php_com_zval_from_variant(rv, &v, obj->code_page TSRMLS_CC);
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, offset, 0, 0)) {
+ php_com_zval_from_variant(rv, &v, obj->code_page);
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
convert_to_long(offset);
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
- if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset) TSRMLS_CC)) {
- php_com_wrap_variant(rv, &v, obj->code_page TSRMLS_CC);
+ if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset))) {
+ php_com_wrap_variant(rv, &v, obj->code_page);
VariantClear(&v);
}
} else {
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant is not an array type");
}
return rv;
}
-static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void com_write_dimension(zval *object, zval *offset, zval *value)
{
php_com_dotnet_object *obj;
zval args[2];
@@ -132,7 +132,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args, 0, 0 TSRMLS_CC)) {
+ DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args, 0, 0)) {
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
@@ -148,7 +148,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
indices = (LONG)Z_LVAL_P(offset);
VariantInit(&v);
- php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&v, value, obj->code_page);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
@@ -163,32 +163,32 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
VariantClear(&v);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions");
}
} else {
- php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "this variant is not an array type");
}
}
#if 0
-static void com_object_set(zval **property, zval *value TSRMLS_DC)
+static void com_object_set(zval **property, zval *value)
{
/* Not yet implemented in the engine */
}
-static zval *com_object_get(zval *property TSRMLS_DC)
+static zval *com_object_get(zval *property)
{
/* Not yet implemented in the engine */
return NULL;
}
#endif
-static int com_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int com_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
DISPID dispid;
php_com_dotnet_object *obj;
@@ -197,7 +197,7 @@ static int com_property_exists(zval *object, zval *member, int check_empty, void
if (V_VT(&obj->v) == VT_DISPATCH) {
convert_to_string_ex(member);
- if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid TSRMLS_CC))) {
+ if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid))) {
/* TODO: distinguish between property and method! */
return 1;
}
@@ -208,23 +208,23 @@ static int com_property_exists(zval *object, zval *member, int check_empty, void
return 0;
}
-static int com_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int com_dimension_exists(zval *object, zval *member, int check_empty)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object");
+ php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object");
return 0;
}
-static void com_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void com_property_delete(zval *object, zval *member, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static void com_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void com_dimension_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static HashTable *com_properties_get(zval *object TSRMLS_DC)
+static HashTable *com_properties_get(zval *object)
{
/* TODO: use type-info to get all the names and values ?
* DANGER: if we do that, there is a strong possibility for
@@ -255,7 +255,7 @@ static PHP_FUNCTION(com_method_handler)
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
-static union _zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key TSRMLS_DC)
+static union _zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key)
{
zend_internal_function f, *fptr = NULL;
union _zend_function *func;
@@ -266,7 +266,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
return NULL;
}
- if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy TSRMLS_CC))) {
+ if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy))) {
return NULL;
}
@@ -293,7 +293,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
int i;
if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) {
- olename = php_com_string_to_olestring(name->val, name->len, obj->code_page TSRMLS_CC);
+ olename = php_com_string_to_olestring(name->val, name->len, obj->code_page);
lhash = LHashValOfNameSys(SYS_WIN32, LOCALE_SYSTEM_DEFAULT, olename);
if (SUCCEEDED(ITypeComp_Bind(comp, olename, lhash, INVOKE_FUNC, &TI, &kind, &bindptr))) {
@@ -378,8 +378,8 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU
VariantInit(&v);
- if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) {
- php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
+ if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args)) {
+ php_com_zval_from_variant(return_value, &v, obj->code_page);
ret = SUCCESS;
VariantClear(&v);
}
@@ -391,7 +391,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU
return ret;
}
-static union _zend_function *com_constructor_get(zend_object *object TSRMLS_DC)
+static union _zend_function *com_constructor_get(zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object *) object;
static zend_internal_function c, d, v;
@@ -423,7 +423,7 @@ static union _zend_function *com_constructor_get(zend_object *object TSRMLS_DC)
}
}
-static zend_string* com_class_name_get(const zend_object *object TSRMLS_DC)
+static zend_string* com_class_name_get(const zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object *)object;
@@ -431,7 +431,7 @@ static zend_string* com_class_name_get(const zend_object *object TSRMLS_DC)
}
/* This compares two variants for equality */
-static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int com_objects_compare(zval *object1, zval *object2)
{
php_com_dotnet_object *obja, *objb;
int ret;
@@ -463,7 +463,7 @@ static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
return ret;
}
-static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int com_object_cast(zval *readobj, zval *writeobj, int type)
{
php_com_dotnet_object *obj;
VARIANT v;
@@ -476,7 +476,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
if (V_VT(&obj->v) == VT_DISPATCH) {
if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE,
- DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1, 0 TSRMLS_CC)) {
+ DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL, 1, 0)) {
VariantCopy(&v, &obj->v);
}
} else {
@@ -506,7 +506,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
}
if (SUCCEEDED(res)) {
- php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(writeobj, &v, obj->code_page);
}
VariantClear(&v);
@@ -515,10 +515,10 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
return SUCCESS;
}
- return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC);
+ return zend_std_cast_object_tostring(readobj, writeobj, type);
}
-static int com_object_count(zval *object, zend_long *count TSRMLS_DC)
+static int com_object_count(zval *object, zend_long *count)
{
php_com_dotnet_object *obj;
LONG ubound = 0, lbound = 0;
@@ -566,7 +566,7 @@ zend_object_handlers php_com_object_handlers = {
NULL, /* get_gc */
};
-void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC)
+void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable)
{
if (obj->sink_dispatch) {
IConnectionPointContainer *cont;
@@ -590,7 +590,7 @@ void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSR
}
}
-void php_com_object_free_storage(zend_object *object TSRMLS_DC)
+void php_com_object_free_storage(zend_object *object)
{
php_com_dotnet_object *obj = (php_com_dotnet_object*)object;
@@ -600,7 +600,7 @@ void php_com_object_free_storage(zend_object *object TSRMLS_DC)
}
if (obj->sink_dispatch) {
- php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, FALSE);
IDispatch_Release(obj->sink_dispatch);
obj->sink_dispatch = NULL;
}
@@ -617,7 +617,7 @@ void php_com_object_free_storage(zend_object *object TSRMLS_DC)
}
}
-zend_object* php_com_object_clone(zval *object TSRMLS_DC)
+zend_object* php_com_object_clone(zval *object)
{
php_com_dotnet_object *cloneobj, *origobject;
@@ -641,11 +641,11 @@ zend_object* php_com_object_clone(zval *object TSRMLS_DC)
return (zend_object*)cloneobj;
}
-zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC)
+zend_object* php_com_object_new(zend_class_entry *ce)
{
php_com_dotnet_object *obj;
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
obj = emalloc(sizeof(*obj));
memset(obj, 0, sizeof(*obj));
@@ -653,7 +653,7 @@ zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC)
obj->code_page = CP_ACP;
obj->ce = ce;
- zend_object_std_init(&obj->zo, ce TSRMLS_CC);
+ zend_object_std_init(&obj->zo, ce);
obj->zo.handlers = &php_com_object_handlers;
return (zend_object*)obj;
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index a7614673f8..20cf6bfc19 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -41,7 +41,7 @@ struct php_com_iterator {
zval zdata;
};
-static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void com_iter_dtor(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -53,7 +53,7 @@ static void com_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
zval_ptr_dtor(&I->zdata);
}
-static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int com_iter_valid(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -64,14 +64,14 @@ static int com_iter_valid(zend_object_iterator *iter TSRMLS_DC)
return FAILURE;
}
-static zval* com_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval* com_iter_get_data(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
return &I->zdata;
}
-static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void com_iter_get_key(zend_object_iterator *iter, zval *key)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
@@ -82,7 +82,7 @@ static void com_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
}
}
-static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static int com_iter_move_forwards(zend_object_iterator *iter)
{
struct php_com_iterator *I = (struct php_com_iterator*)Z_PTR(iter->data);
unsigned long n_fetched;
@@ -112,15 +112,15 @@ static int com_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
return FAILURE;
}
I->key++;
- if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key TSRMLS_CC) == 0) {
+ if (php_com_safearray_get_elem(&I->safe_array, &I->v, (LONG)I->key) == 0) {
I->key = (ulong)-1;
return FAILURE;
}
}
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
- /* php_com_wrap_variant(ptr, &I->v, I->code_page TSRMLS_CC); */
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
+ /* php_com_wrap_variant(ptr, &I->v, I->code_page); */
ZVAL_COPY_VALUE(&I->zdata, &ptr);
return SUCCESS;
}
@@ -135,7 +135,7 @@ static zend_object_iterator_funcs com_iter_funcs = {
NULL
};
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
php_com_dotnet_object *obj;
struct php_com_iterator *I;
@@ -152,7 +152,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v));
+ php_error_docref(NULL, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v));
return NULL;
}
@@ -160,7 +160,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
VariantInit(&v);
I = (struct php_com_iterator*)ecalloc(1, sizeof(*I));
- zend_iterator_init(&I->iter TSRMLS_CC);
+ zend_iterator_init(&I->iter);
I->iter.funcs = &com_iter_funcs;
Z_PTR(I->iter.data) = I;
I->code_page = obj->code_page;
@@ -175,7 +175,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
dims = SafeArrayGetDim(V_ARRAY(&obj->v));
if (dims != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Can only handle single dimension variant arrays (this array has %d)", dims);
goto fail;
}
@@ -189,10 +189,10 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
SafeArrayGetUBound(V_ARRAY(&I->safe_array), 1, &I->sa_max);
/* pre-fetch the element */
- if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound TSRMLS_CC)) {
+ if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound)) {
I->key = bound;
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
ZVAL_COPY_VALUE(&I->zdata, &ptr);
} else {
I->key = (ulong)-1;
@@ -226,7 +226,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
/* indicate that we have element 0 */
I->key = 0;
ZVAL_NULL(&ptr);
- php_com_zval_from_variant(&ptr, &I->v, I->code_page TSRMLS_CC);
+ php_com_zval_from_variant(&ptr, &I->v, I->code_page);
ZVAL_COPY_VALUE(&I->zdata, &ptr);
} else {
/* indicate that there are no more items */
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index f0b21ff014..f776cb4d32 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -29,7 +29,7 @@
#include "php_com_dotnet_internal.h"
#include "Zend/zend_exceptions.h"
-void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
+void php_com_throw_exception(HRESULT code, char *message)
{
int free_msg = 0;
if (message == NULL) {
@@ -37,9 +37,9 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
free_msg = 1;
}
#if SIZEOF_ZEND_LONG == 8
- zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code TSRMLS_CC);
+ zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code);
#else
- zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code TSRMLS_CC);
+ zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code);
#endif
if (free_msg) {
LocalFree(message);
@@ -47,7 +47,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
- int codepage TSRMLS_DC)
+ int codepage)
{
php_com_dotnet_object *obj;
@@ -64,13 +64,13 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
IDispatch_AddRef(V_DISPATCH(&obj->v));
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo);
- zend_object_std_init(&obj->zo, php_com_variant_class_entry TSRMLS_CC);
+ zend_object_std_init(&obj->zo, php_com_variant_class_entry);
obj->zo.handlers = &php_com_object_handlers;
ZVAL_OBJ(z, &obj->zo);
}
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
- int codepage TSRMLS_DC)
+ int codepage)
{
php_com_dotnet_object *obj;
@@ -88,14 +88,14 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo);
}
- zend_object_std_init(&obj->zo, php_com_variant_class_entry TSRMLS_CC);
+ zend_object_std_init(&obj->zo, php_com_variant_class_entry);
obj->zo.handlers = &php_com_object_handlers;
ZVAL_OBJ(z, &obj->zo);
}
/* this is a convenience function for fetching a particular
* element from a (possibly multi-dimensional) safe array */
-PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1)
{
UINT dims;
LONG lbound, ubound;
@@ -109,7 +109,7 @@ PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest,
dims = SafeArrayGetDim(V_ARRAY(array));
if (dims != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Can only handle single dimension variant arrays (this array has %d)", dims);
return 0;
}
@@ -124,7 +124,7 @@ PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest,
/* check bounds */
if (dim1 < lbound || dim1 > ubound) {
- php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds");
return 0;
}
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index 2e0b558288..30389ffb8c 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
-PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t string_len, int codepage)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -62,7 +62,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
if (!ok) {
char *msg = php_win32_error_to_msg(GetLastError());
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not convert string to unicode: `%s'", msg);
LocalFree(msg);
@@ -71,7 +71,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
return olestring;
}
-PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t *string_len, int codepage)
{
char *string;
uint length = 0;
@@ -93,7 +93,7 @@ PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, size_t
if (!ok) {
char *msg = php_win32_error_to_msg(GetLastError());
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not convert string from unicode: `%s'", msg);
LocalFree(msg);
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index dbe8b45300..eec1389ade 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -45,12 +45,12 @@ typedef struct {
} php_istream;
static int le_istream;
-static void istream_destructor(php_istream *stm TSRMLS_DC);
+static void istream_destructor(php_istream *stm);
-static void istream_dtor(zend_resource *rsrc TSRMLS_DC)
+static void istream_dtor(zend_resource *rsrc)
{
php_istream *stm = (php_istream *)rsrc->ptr;
- istream_destructor(stm TSRMLS_CC);
+ istream_destructor(stm);
}
#define FETCH_STM() \
@@ -249,7 +249,7 @@ static struct IStreamVtbl php_istream_vtbl = {
stm_clone
};
-static void istream_destructor(php_istream *stm TSRMLS_DC)
+static void istream_destructor(php_istream *stm)
{
if (stm->res) {
zend_resource *res = stm->res;
@@ -268,7 +268,7 @@ static void istream_destructor(php_istream *stm TSRMLS_DC)
}
/* }}} */
-PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
+PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
zval *tmp;
@@ -283,7 +283,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR
stm->stream = stream;
GC_REFCOUNT(stream->res)++;
- tmp = zend_list_insert(stm, le_istream TSRMLS_CC);
+ tmp = zend_list_insert(stm, le_istream);
stm->res = Z_RES_P(tmp);
return (IStream*)stm;
@@ -295,7 +295,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSR
#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)Z_OBJ_P(getThis());
-#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; }
+#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance"); return; }
typedef struct {
zend_object std;
@@ -351,7 +351,7 @@ CPH_METHOD(GetCurFileName)
if (res == S_OK) {
size_t len;
char *str = php_com_olestring_to_string(olename,
- &len, helper->codepage TSRMLS_CC);
+ &len, helper->codepage);
RETVAL_STRINGL(str, len);
// TODO: avoid reallocarion???
efree(str);
@@ -361,9 +361,9 @@ CPH_METHOD(GetCurFileName)
CoTaskMemFree(olename);
RETURN_FALSE;
}
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -384,24 +384,24 @@ CPH_METHOD(SaveToFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!|b",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p!|b",
&filename, &filename_len, &remember)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
if (filename) {
- fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+ fullpath = expand_filepath(filename, NULL);
if (!fullpath) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
RETURN_FALSE;
}
- olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
+ olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage);
efree(fullpath);
}
res = IPersistFile_Save(helper->ipf, olefilename, remember);
@@ -423,11 +423,11 @@ CPH_METHOD(SaveToFile)
}
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -448,33 +448,33 @@ CPH_METHOD(LoadFromFile)
res = get_persist_file(helper);
if (helper->ipf) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|l",
&filename, &filename_len, &flags)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
- if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if (!(fullpath = expand_filepath(filename, NULL))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
RETURN_FALSE;
}
- olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC);
+ olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage);
efree(fullpath);
res = IPersistFile_Load(helper->ipf, olefilename, (DWORD)flags);
efree(olefilename);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -497,13 +497,13 @@ CPH_METHOD(GetMaxStreamSize)
if (helper->ips) {
res = IPersistStream_GetSizeMax(helper->ips, &size);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
return;
}
}
if (res != S_OK) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
/* TODO: handle 64 bit properly */
RETURN_LONG((zend_long)size.QuadPart);
@@ -525,12 +525,12 @@ CPH_METHOD(InitNew)
res = IPersistStreamInit_InitNew(helper->ipsi);
if (res != S_OK) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
} else {
RETURN_TRUE;
}
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
}
/* }}} */
@@ -545,21 +545,21 @@ CPH_METHOD(LoadFromStream)
HRESULT res;
CPH_FETCH();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
php_stream_from_zval_no_verify(stream, zstm);
if (stream == NULL) {
- php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "expected a stream");
return;
}
- stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
+ stm = php_com_wrapper_export_stream(stream);
if (stm == NULL) {
- php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
+ php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream");
return;
}
@@ -573,7 +573,7 @@ CPH_METHOD(LoadFromStream)
res = OleLoadFromStream(stm, &IID_IDispatch, &disp);
if (SUCCEEDED(res)) {
- php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC);
+ php_com_wrap_dispatch(return_value, disp, COMG(code_page));
}
} else {
res = get_persist_stream_init(helper);
@@ -589,7 +589,7 @@ CPH_METHOD(LoadFromStream)
IStream_Release(stm);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
RETURN_NULL();
}
}
@@ -607,21 +607,21 @@ CPH_METHOD(SaveToStream)
CPH_NO_OBJ();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstm)) {
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
php_stream_from_zval_no_verify(stream, zstm);
if (stream == NULL) {
- php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "expected a stream");
return;
}
- stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
+ stm = php_com_wrapper_export_stream(stream);
if (stm == NULL) {
- php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
+ php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream");
return;
}
@@ -638,7 +638,7 @@ CPH_METHOD(SaveToStream)
IStream_Release(stm);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
return;
}
@@ -654,9 +654,9 @@ CPH_METHOD(__construct)
zval *zobj = NULL;
CPH_FETCH();
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!",
&zobj, php_com_variant_class_entry)) {
- php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "invalid arguments");
return;
}
@@ -667,7 +667,7 @@ CPH_METHOD(__construct)
obj = CDNO_FETCH(zobj);
if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) {
- php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object");
return;
}
@@ -693,7 +693,7 @@ static const zend_function_entry com_persist_helper_methods[] = {
PHP_FE_END
};
-static void helper_free_storage(zend_object *obj TSRMLS_DC)
+static void helper_free_storage(zend_object *obj)
{
php_com_persist_helper *object = (php_com_persist_helper*)obj;
@@ -709,18 +709,18 @@ static void helper_free_storage(zend_object *obj TSRMLS_DC)
if (object->unk) {
IUnknown_Release(object->unk);
}
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
}
-static zend_object* helper_clone(zval *obj TSRMLS_DC)
+static zend_object* helper_clone(zval *obj)
{
php_com_persist_helper *clone, *object = (php_com_persist_helper*)Z_OBJ_P(obj);
clone = emalloc(sizeof(*object));
memcpy(clone, object, sizeof(*object));
- zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC);
+ zend_object_std_init(&clone->std, object->std.ce);
if (clone->ipf) {
IPersistFile_AddRef(clone->ipf);
@@ -737,14 +737,14 @@ static zend_object* helper_clone(zval *obj TSRMLS_DC)
return (zend_object*)clone;
}
-static zend_object* helper_new(zend_class_entry *ce TSRMLS_DC)
+static zend_object* helper_new(zend_class_entry *ce)
{
php_com_persist_helper *helper;
helper = emalloc(sizeof(*helper));
memset(helper, 0, sizeof(*helper));
- zend_object_std_init(&helper->std, helper_ce TSRMLS_CC);
+ zend_object_std_init(&helper->std, helper_ce);
helper->std.handlers = &helper_handlers;
return &helper->std;
@@ -760,7 +760,7 @@ int php_com_persist_minit(INIT_FUNC_ARGS)
INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods);
ce.create_object = helper_new;
- helper_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ helper_ce = zend_register_internal_class(&ce);
helper_ce->ce_flags |= ZEND_ACC_FINAL;
le_istream = zend_register_list_destructors_ex(istream_dtor,
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 1d187a77bf..481e95a2bd 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -71,21 +71,21 @@ static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, in
}
}
-static zval *saproxy_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv TSRMLS_DC)
+static zval *saproxy_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv)
{
ZVAL_NULL(rv);
- php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
return rv;
}
-static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void saproxy_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "safearray has no properties");
}
-static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *rv)
{
php_com_saproxy *proxy = SA_FETCH(object);
UINT dims, i;
@@ -114,20 +114,20 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
res = php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
Z_STRLEN(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
- proxy->dimensions, args, 0 TSRMLS_CC);
+ proxy->dimensions, args, 0);
if (res == SUCCESS) {
- php_com_zval_from_variant(rv, &v, proxy->obj->code_page TSRMLS_CC);
+ php_com_zval_from_variant(rv, &v, proxy->obj->code_page);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
/* return another proxy */
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
return rv;
} else if (!V_ISARRAY(&proxy->obj->v)) {
- php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object");
return rv;
}
@@ -141,7 +141,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
if ((UINT) proxy->dimensions >= dims) {
/* too many dimensions */
- php_com_throw_exception(E_INVALIDARG, "too many dimensions!" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "too many dimensions!");
return rv;
}
@@ -150,7 +150,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
SafeArrayGetUBound(sa, proxy->dimensions, &ubound);
if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) {
- php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
+ php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds");
return rv;
}
@@ -188,22 +188,22 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
efree(indices);
if (SUCCEEDED(res)) {
- php_com_wrap_variant(rv, &v, proxy->obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(rv, &v, proxy->obj->code_page);
} else {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
VariantClear(&v);
} else {
/* return another proxy */
- php_com_saproxy_create(object, rv, offset TSRMLS_CC);
+ php_com_saproxy_create(object, rv, offset);
}
return rv;
}
-static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void saproxy_write_dimension(zval *object, zval *offset, zval *value)
{
php_com_saproxy *proxy = SA_FETCH(object);
UINT dims, i;
@@ -226,7 +226,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VariantInit(&v);
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL(proxy->indices[0]),
Z_STRLEN(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
- args, 0 TSRMLS_CC)) {
+ args, 0)) {
VariantClear(&v);
}
@@ -253,7 +253,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
}
VariantInit(&v);
- php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&v, value, proxy->obj->code_page);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
@@ -269,54 +269,54 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VariantClear(&v);
if (FAILED(res)) {
- php_com_throw_exception(res, NULL TSRMLS_CC);
+ php_com_throw_exception(res, NULL);
}
} else {
- php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC);
+ php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object");
}
}
#if 0
-static void saproxy_object_set(zval **property, zval *value TSRMLS_DC)
+static void saproxy_object_set(zval **property, zval *value)
{
}
-static zval *saproxy_object_get(zval *property TSRMLS_DC)
+static zval *saproxy_object_get(zval *property)
{
/* Not yet implemented in the engine */
return NULL;
}
#endif
-static int saproxy_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int saproxy_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
/* no properties */
return 0;
}
-static int saproxy_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int saproxy_dimension_exists(zval *object, zval *member, int check_empty)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation not yet supported on a COM object");
+ php_error_docref(NULL, E_WARNING, "Operation not yet supported on a COM object");
return 0;
}
-static void saproxy_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void saproxy_property_delete(zval *object, zval *member, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static void saproxy_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void saproxy_dimension_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a COM object");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a COM object");
}
-static HashTable *saproxy_properties_get(zval *object TSRMLS_DC)
+static HashTable *saproxy_properties_get(zval *object)
{
/* no properties */
return NULL;
}
-static union _zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key TSRMLS_DC)
+static union _zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key)
{
/* no methods */
return NULL;
@@ -327,28 +327,28 @@ static int saproxy_call_method(zend_string *method, zend_object *object, INTERNA
return FAILURE;
}
-static union _zend_function *saproxy_constructor_get(zend_object *object TSRMLS_DC)
+static union _zend_function *saproxy_constructor_get(zend_object *object)
{
/* user cannot instantiate */
return NULL;
}
-static zend_string* saproxy_class_name_get(const zend_object *object TSRMLS_DC)
+static zend_string* saproxy_class_name_get(const zend_object *object)
{
return zend_string_copy(php_com_saproxy_class_entry->name);
}
-static int saproxy_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int saproxy_objects_compare(zval *object1, zval *object2)
{
return -1;
}
-static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int saproxy_object_cast(zval *readobj, zval *writeobj, int type)
{
return FAILURE;
}
-static int saproxy_count_elements(zval *object, zend_long *count TSRMLS_DC)
+static int saproxy_count_elements(zval *object, zend_long *count)
{
php_com_saproxy *proxy = SA_FETCH(object);
LONG ubound, lbound;
@@ -365,7 +365,7 @@ static int saproxy_count_elements(zval *object, zend_long *count TSRMLS_DC)
return SUCCESS;
}
-static void saproxy_free_storage(zend_object *object TSRMLS_DC)
+static void saproxy_free_storage(zend_object *object)
{
php_com_saproxy *proxy = (php_com_saproxy *)object;
//??? int i;
@@ -380,7 +380,7 @@ static void saproxy_free_storage(zend_object *object TSRMLS_DC)
efree(proxy->indices);
}
-static zend_object* saproxy_clone(zval *object TSRMLS_DC)
+static zend_object* saproxy_clone(zval *object)
{
php_com_saproxy *proxy = (php_com_saproxy *)Z_OBJ_P(object);
php_com_saproxy *cloneproxy;
@@ -421,7 +421,7 @@ zend_object_handlers php_com_saproxy_handlers = {
saproxy_count_elements
};
-int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC)
+int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index)
{
php_com_saproxy *proxy, *rel = NULL;
@@ -447,7 +447,7 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
ZVAL_DUP(&proxy->indices[proxy->dimensions-1], index);
- zend_object_std_init(&proxy->std, php_com_saproxy_class_entry TSRMLS_CC);
+ zend_object_std_init(&proxy->std, php_com_saproxy_class_entry);
proxy->std.handlers = &php_com_saproxy_handlers;
ZVAL_OBJ(proxy_out, &proxy->std);
@@ -456,7 +456,7 @@ int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS
/* iterator */
-static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void saproxy_iter_dtor(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -466,14 +466,14 @@ static void saproxy_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
efree(I);
}
-static int saproxy_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int saproxy_iter_valid(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
return (I->key < I->imax) ? SUCCESS : FAILURE;
}
-static zval* saproxy_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval* saproxy_iter_get_data(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
VARIANT v;
@@ -497,13 +497,13 @@ static zval* saproxy_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
}
ZVAL_NULL(&I->data);
- php_com_wrap_variant(&I->data, &v, I->proxy->obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(&I->data, &v, I->proxy->obj->code_page);
VariantClear(&v);
return &I->data;
}
-static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -514,7 +514,7 @@ static void saproxy_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC
}
}
-static int saproxy_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static int saproxy_iter_move_forwards(zend_object_iterator *iter)
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)Z_PTR(iter->data);
@@ -535,7 +535,7 @@ static zend_object_iterator_funcs saproxy_iter_funcs = {
};
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
php_com_saproxy *proxy = SA_FETCH(object);
php_com_saproxy_iter *I;
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index f07d7ff65d..2e2732afcd 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
-PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -52,7 +52,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
major = php_strtok_r(NULL, ",", &strtok_buf);
minor = php_strtok_r(NULL, ",", &strtok_buf);
- p = php_com_string_to_olestring(search_string, strlen(search_string), codepage TSRMLS_CC);
+ p = php_com_string_to_olestring(search_string, strlen(search_string), codepage);
if (SUCCEEDED(CLSIDFromString(p, &clsid))) {
WORD major_i = 1, minor_i = 0;
@@ -129,7 +129,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
spprintf(&str, 0, "%s,%d,%d", keyname, major_tmp, minor_tmp);
/* recurse */
- TL = php_com_load_typelib(str, codepage TSRMLS_CC);
+ TL = php_com_load_typelib(str, codepage);
efree(str);
break;
@@ -153,7 +153,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
/* Given a type-library, merge it into the current engine state */
-PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -185,7 +185,7 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
continue;
}
- const_name = php_com_olestring_to_string(bstr_ids, &len, codepage TSRMLS_CC);
+ const_name = php_com_olestring_to_string(bstr_ids, &len, codepage);
c.name = zend_string_init(const_name, len, 1);
// TODO: avoid reallocation???
efree(const_name);
@@ -197,9 +197,9 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
SysFreeString(bstr_ids);
/* sanity check for the case where the constant is already defined */
- if ((exists = zend_get_constant(c.name TSRMLS_CC)) != NULL) {
- if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type library constant %s is already defined", c.name);
+ if ((exists = zend_get_constant(c.name)) != NULL) {
+ if (COMG(autoreg_verbose) && !compare_function(&results, &c.value, exists)) {
+ php_error_docref(NULL, E_WARNING, "Type library constant %s is already defined", c.name);
}
zend_string_release(c.name);
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
@@ -207,12 +207,12 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa
}
/* register the constant */
- php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage TSRMLS_CC);
+ php_com_zval_from_variant(&value, pVarDesc->lpvarValue, codepage);
if (Z_TYPE(value) == IS_LONG) {
c.flags = mode;
ZVAL_LONG(&c.value, Z_LVAL(value));
c.module_number = 0;
- zend_register_constant(&c TSRMLS_CC);
+ zend_register_constant(&c);
}
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
}
@@ -230,7 +230,7 @@ void php_com_typelibrary_dtor(void *pDest)
}
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
- int codepage, int *cached TSRMLS_DC)
+ int codepage, int *cached)
{
ITypeLib *TL;
char *name_dup;
@@ -247,7 +247,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
*cached = 0;
name_dup = estrndup(search_string, l);
- TL = php_com_load_typelib(name_dup, codepage TSRMLS_CC);
+ TL = php_com_load_typelib(name_dup, codepage);
efree(name_dup);
if (TL) {
@@ -261,7 +261,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
return TL;
}
-ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC)
+ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink)
{
ITypeInfo *typeinfo = NULL;
ITypeLib *typelib = NULL;
@@ -280,7 +280,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
if (!gotguid && SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), &IID_IProvideClassInfo, (void**)&pci))) {
/* examine the available interfaces */
/* TODO: write some code here */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IProvideClassInfo: this code not yet written!");
+ php_error_docref(NULL, E_WARNING, "IProvideClassInfo: this code not yet written!");
IProvideClassInfo_Release(pci);
}
} else if (dispname == NULL) {
@@ -312,13 +312,13 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
}
} else if (typelibname) {
/* Fetch the typelibrary and use that to look things up */
- typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP TSRMLS_CC);
+ typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP);
}
if (!gotguid && dispname && typelib) {
unsigned short cfound;
MEMBERID memid;
- OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP TSRMLS_CC);
+ OLECHAR *olename = php_com_string_to_olestring(dispname, strlen(dispname), CP_ACP);
cfound = 1;
if (FAILED(ITypeLib_FindName(typelib, olename, 0, &typeinfo, &memid, &cfound)) || cfound == 0) {
@@ -417,20 +417,20 @@ static inline const char *vt_to_string(VARTYPE vt)
return "?";
}
-static char *php_com_string_from_clsid(const CLSID *clsid, int codepage TSRMLS_DC)
+static char *php_com_string_from_clsid(const CLSID *clsid, int codepage)
{
LPOLESTR ole_clsid;
char *clsid_str;
StringFromCLSID(clsid, &ole_clsid);
- clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage TSRMLS_CC);
+ clsid_str = php_com_olestring_to_string(ole_clsid, NULL, codepage);
LocalFree(ole_clsid);
return clsid_str;
}
-int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC)
+int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage)
{
TYPEATTR *attr;
FUNCDESC *func;
@@ -455,10 +455,10 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
char *guidstring;
ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL);
- ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC);
+ ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage);
SysFreeString(olename);
- guidstring = php_com_string_from_clsid(&attr->guid, codepage TSRMLS_CC);
+ guidstring = php_com_string_from_clsid(&attr->guid, codepage);
php_printf("class %s { /* GUID=%s */\n", ansiname, guidstring);
efree(guidstring);
@@ -485,7 +485,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
lastid = func->memid;
ITypeInfo_GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL);
- ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage TSRMLS_CC);
+ ansiname = php_com_olestring_to_string(olename, &ansinamelen, codepage);
SysFreeString(olename);
if (printdef) {
@@ -514,7 +514,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
- funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage);
SysFreeString(olename);
php_printf("\t/* %s */\n", funcdesc);
efree(funcdesc);
@@ -547,7 +547,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
/* when we handle prop put and get, this will look nicer */
if (j+1 < (int)cnames) {
- funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(names[j+1], &funcdesclen, codepage);
SysFreeString(names[j+1]);
} else {
funcdesc = "???";
@@ -568,7 +568,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
ITypeInfo_GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL);
if (olename) {
- funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage TSRMLS_CC);
+ funcdesc = php_com_olestring_to_string(olename, &funcdesclen, codepage);
SysFreeString(olename);
php_printf("\t\t/* %s */\n", funcdesc);
efree(funcdesc);
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 7317b8d0e4..ce919d8a03 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -32,7 +32,7 @@
* Only creates a single-dimensional array of variants.
* The keys of the PHP hash MUST be numeric. If the array
* is sparse, then the gaps will be filled with NULL variants */
-static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
+static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
{
SAFEARRAY *sa = NULL;
SAFEARRAYBOUND bound;
@@ -54,7 +54,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
} else if (HASH_KEY_NON_EXISTENT == keytype) {
break;
} else if (intindex > UINT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
+ php_error_docref(NULL, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
break;
}
}
@@ -75,7 +75,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
break;
}
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &intindex, 0, &pos);
- php_com_variant_from_zval(&va[intindex], item, codepage TSRMLS_CC);
+ php_com_variant_from_zval(&va[intindex], item, codepage);
}
/* Unlock it and stuff it into our variant */
@@ -86,7 +86,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
return;
bogus:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
+ php_error_docref(NULL, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
V_VT(v) = VT_NULL;
@@ -96,7 +96,7 @@ bogus:
}
}
-PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -118,7 +118,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
break;
case IS_OBJECT:
- if (php_com_is_valid_object(z TSRMLS_CC)) {
+ if (php_com_is_valid_object(z)) {
obj = CDNO_FETCH(z);
if (V_VT(&obj->v) == VT_DISPATCH) {
/* pass the underlying object */
@@ -135,13 +135,13 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
} else {
/* export the PHP object using our COM wrapper */
V_VT(v) = VT_DISPATCH;
- V_DISPATCH(v) = php_com_wrapper_export(z TSRMLS_CC);
+ V_DISPATCH(v) = php_com_wrapper_export(z);
}
break;
case IS_ARRAY:
/* map as safe array */
- safe_array_from_zval(v, z, codepage TSRMLS_CC);
+ safe_array_from_zval(v, z, codepage);
break;
case IS_LONG:
@@ -161,7 +161,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
- olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
+ olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage);
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(wcslen(olestring) * sizeof(OLECHAR)));
} else {
@@ -179,7 +179,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
}
}
-PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -236,7 +236,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
if (olestring) {
size_t len;
char *str = php_com_olestring_to_string(olestring,
- &len, codepage TSRMLS_CC);
+ &len, codepage);
ZVAL_STRINGL(z, str, len);
// TODO: avoid reallocation???
efree(str);
@@ -248,7 +248,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
IDispatch *disp;
if (SUCCEEDED(IUnknown_QueryInterface(V_UNKNOWN(v), &IID_IDispatch, &disp))) {
- php_com_wrap_dispatch(z, disp, codepage TSRMLS_CC);
+ php_com_wrap_dispatch(z, disp, codepage);
IDispatch_Release(disp);
} else {
ret = FAILURE;
@@ -258,16 +258,16 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
case VT_DISPATCH:
if (V_DISPATCH(v) != NULL) {
- php_com_wrap_dispatch(z, V_DISPATCH(v), codepage TSRMLS_CC);
+ php_com_wrap_dispatch(z, V_DISPATCH(v), codepage);
}
break;
case VT_VARIANT:
/* points to another variant */
- return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage TSRMLS_CC);
+ return php_com_zval_from_variant(z, V_VARIANTREF(v), codepage);
default:
- php_com_wrap_variant(z, v, codepage TSRMLS_CC);
+ php_com_wrap_variant(z, v, codepage);
}
if (olestring) {
@@ -275,14 +275,14 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
}
if (ret == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret);
+ php_error_docref(NULL, E_WARNING, "variant->zval: conversion from 0x%x ret=%d", V_VT(v), ret);
}
return ret;
}
-PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar)
{
int ret = SUCCESS;
@@ -422,10 +422,10 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR
break;
case VT_VARIANT:
- return php_com_copy_variant(V_VARIANTREF(dstvar), srcvar TSRMLS_CC);
+ return php_com_copy_variant(V_VARIANTREF(dstvar), srcvar);
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variant->variant: failed to copy from 0x%x to 0x%x", V_VT(dstvar), V_VT(srcvar));
+ php_error_docref(NULL, E_WARNING, "variant->variant: failed to copy from 0x%x to 0x%x", V_VT(dstvar), V_VT(srcvar));
ret = FAILURE;
}
return ret;
@@ -448,19 +448,19 @@ PHP_FUNCTION(com_variant_create_instance)
obj = CDNO_FETCH(object);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!|ll", &zvalue, &vt, &codepage)) {
- php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
+ php_com_throw_exception(E_INVALIDARG, "Invalid arguments");
return;
}
- php_com_initialize(TSRMLS_C);
+ php_com_initialize();
if (ZEND_NUM_ARGS() == 3) {
obj->code_page = (int)codepage;
}
if (zvalue) {
- php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&obj->v, zvalue, obj->code_page);
}
/* Only perform conversion if variant not already of type passed */
@@ -490,7 +490,7 @@ PHP_FUNCTION(com_variant_create_instance)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
}
@@ -510,7 +510,7 @@ PHP_FUNCTION(variant_set)
zval *zobj, *zvalue = NULL;
php_com_dotnet_object *obj;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Oz!", &zobj, php_com_variant_class_entry, &zvalue)) {
return;
}
@@ -523,14 +523,14 @@ PHP_FUNCTION(variant_set)
obj->typeinfo = NULL;
}
if (obj->sink_dispatch) {
- php_com_object_enable_event_sink(obj, FALSE TSRMLS_CC);
+ php_com_object_enable_event_sink(obj, FALSE);
IDispatch_Release(obj->sink_dispatch);
obj->sink_dispatch = NULL;
}
VariantClear(&obj->v);
- php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
+ php_com_variant_from_zval(&obj->v, zvalue, obj->code_page);
/* remember we modified this variant */
obj->modified = 1;
}
@@ -561,33 +561,33 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "OO", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "OO", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Oz!", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "Oz!", &zleft, php_com_variant_class_entry,
&zright)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "z!O", &zleft, &zright, php_com_variant_class_entry)) {
+ ZEND_NUM_ARGS(), "z!O", &zleft, &zright, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ php_com_variant_from_zval(vleft, zleft, codepage);
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!z!", &zleft, &zright)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else {
return;
@@ -639,9 +639,9 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
}
if (SUCCEEDED(result)) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
} else {
- php_com_throw_exception(result, NULL TSRMLS_CC);
+ php_com_throw_exception(result, NULL);
}
VariantClear(&vres);
@@ -768,13 +768,13 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "O", &zleft, php_com_variant_class_entry)) {
+ ZEND_NUM_ARGS(), "O", &zleft, php_com_variant_class_entry)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!", &zleft)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
} else {
return;
}
@@ -800,9 +800,9 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
}
if (SUCCEEDED(result)) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
} else {
- php_com_throw_exception(result, NULL TSRMLS_CC);
+ php_com_throw_exception(result, NULL);
}
VariantClear(&vres);
@@ -866,19 +866,19 @@ PHP_FUNCTION(variant_round)
VariantInit(&vres);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &zleft, php_com_variant_class_entry, &decimals)) {
+ ZEND_NUM_ARGS(), "Ol", &zleft, php_com_variant_class_entry, &decimals)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!l", &zleft, &decimals)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
} else {
return;
}
if (SUCCEEDED(VarRound(vleft, (int)decimals, &vres))) {
- php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, codepage);
}
VariantClear(&vres);
@@ -904,34 +904,34 @@ PHP_FUNCTION(variant_cmp)
VariantInit(&right_val);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "OO|ll", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "Oz!|ll", &zleft, php_com_variant_class_entry,
&zright, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
+ ZEND_NUM_ARGS(), "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
&lcid, &flags)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
- } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ php_com_variant_from_zval(vleft, zleft, codepage);
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(),
"z!z!|ll", &zleft, &zright, &lcid, &flags)) {
vleft = &left_val;
- php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vleft, zleft, codepage);
vright = &right_val;
- php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
+ php_com_variant_from_zval(vright, zright, codepage);
} else {
return;
@@ -954,7 +954,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
VariantInit(&vres);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"O", &zleft, php_com_variant_class_entry)) {
return;
}
@@ -993,13 +993,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
struct tm *tmv;
VARIANT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l",
&timestamp)) {
return;
}
if (timestamp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timestamp value must be a positive value.");
+ php_error_docref(NULL, E_WARNING, "Timestamp value must be a positive value.");
RETURN_FALSE;
}
@@ -1019,7 +1019,7 @@ PHP_FUNCTION(variant_date_from_timestamp)
V_VT(&res) = VT_DATE;
SystemTimeToVariantTime(&systime, &V_DATE(&res));
- php_com_wrap_variant(return_value, &res, CP_ACP TSRMLS_CC);
+ php_com_wrap_variant(return_value, &res, CP_ACP);
VariantClear(&res);
}
@@ -1032,7 +1032,7 @@ PHP_FUNCTION(variant_get_type)
zval *zobj;
php_com_dotnet_object *obj;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"O", &zobj, php_com_variant_class_entry)) {
return;
}
@@ -1051,7 +1051,7 @@ PHP_FUNCTION(variant_set_type)
/* VARTYPE == unsigned short */ zend_long vt;
HRESULT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
@@ -1071,7 +1071,7 @@ PHP_FUNCTION(variant_set_type)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
}
@@ -1087,7 +1087,7 @@ PHP_FUNCTION(variant_cast)
VARIANT vres;
HRESULT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
"Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
@@ -1097,7 +1097,7 @@ PHP_FUNCTION(variant_cast)
res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt);
if (SUCCEEDED(res)) {
- php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC);
+ php_com_wrap_variant(return_value, &vres, obj->code_page);
} else {
char *werr, *msg;
@@ -1105,7 +1105,7 @@ PHP_FUNCTION(variant_cast)
spprintf(&msg, 0, "Variant type conversion failed: %s", werr);
LocalFree(werr);
- php_com_throw_exception(res, msg TSRMLS_CC);
+ php_com_throw_exception(res, msg);
efree(msg);
}
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index f7dd7fd463..aa1c21c8f0 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -52,12 +52,12 @@ typedef struct {
static int le_dispatch;
-static void disp_destructor(php_dispatchex *disp TSRMLS_DC);
+static void disp_destructor(php_dispatchex *disp);
-static void dispatch_dtor(zend_resource *rsrc TSRMLS_DC)
+static void dispatch_dtor(zend_resource *rsrc)
{
php_dispatchex *disp = (php_dispatchex *)rsrc->ptr;
- disp_destructor(disp TSRMLS_CC);
+ disp_destructor(disp);
}
int php_com_wrapper_minit(INIT_FUNC_ARGS)
@@ -179,7 +179,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
size_t namelen;
zval *tmp;
- name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page) TSRMLS_CC);
+ name = php_com_olestring_to_string(rgszNames[i], &namelen, COMG(code_page));
/* Lookup the name in the hash */
if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) == NULL) {
@@ -224,7 +224,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
zval *tmp;
FETCH_DISP("GetDispID");
- name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page) TSRMLS_CC);
+ name = php_com_olestring_to_string(bstrName, &namelen, COMG(code_page));
trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid);
@@ -273,7 +273,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
- php_com_wrap_variant(&params[i], arg, COMG(code_page) TSRMLS_CC);
+ php_com_wrap_variant(&params[i], arg, COMG(code_page));
}
}
@@ -283,14 +283,14 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
* and expose it as a COM exception */
if (wFlags & DISPATCH_PROPERTYGET) {
- retval = zend_read_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1 TSRMLS_CC);
+ retval = zend_read_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name)+1, 1);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
- zend_update_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name), &params[0] TSRMLS_CC);
+ zend_update_property(Z_OBJCE(disp->object), &disp->object, Z_STRVAL_P(name), Z_STRLEN_P(name), &params[0]);
} else if (wFlags & DISPATCH_METHOD) {
zend_try {
retval = &rv;
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, name,
- retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
+ retval, pdp->cArgs, params, 1, NULL)) {
ret = S_OK;
trace("function called ok\n");
@@ -301,7 +301,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
VARIANT *dstvar = &pdp->rgvarg[ pdp->cArgs - 1 - i];
if ((V_VT(dstvar) & VT_BYREF) && obj->modified ) {
trace("percolate modified value for arg %d VT=%08x\n", i, V_VT(dstvar));
- php_com_copy_variant(dstvar, srcvar TSRMLS_CC);
+ php_com_copy_variant(dstvar, srcvar);
}
}
} else {
@@ -328,7 +328,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
if (retval) {
if (pvarRes) {
VariantInit(pvarRes);
- php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
+ php_com_variant_from_zval(pvarRes, retval, COMG(code_page));
}
zval_ptr_dtor(retval);
} else if (pvarRes) {
@@ -385,7 +385,7 @@ static HRESULT STDMETHODCALLTYPE disp_getmembername(
FETCH_DISP("GetMemberName");
if (NULL != (name = zend_hash_index_find(disp->dispid_to_name, id))) {
- OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page) TSRMLS_CC);
+ OLECHAR *olestr = php_com_string_to_olestring(Z_STRVAL_P(name), Z_STRLEN_P(name), COMG(code_page));
*pbstrName = SysAllocString(olestr);
efree(olestr);
return S_OK;
@@ -444,7 +444,7 @@ static struct IDispatchExVtbl php_dispatch_vtbl = {
/* enumerate functions and properties of the object and assign
* dispatch ids */
-static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
+static void generate_dispids(php_dispatchex *disp)
{
HashPosition pos;
zend_string *name = NULL;
@@ -529,7 +529,7 @@ static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
}
}
-static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
+static php_dispatchex *disp_constructor(zval *object)
{
php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex));
zval *tmp;
@@ -552,13 +552,13 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
ZVAL_UNDEF(&disp->object);
}
- tmp = zend_list_insert(disp, le_dispatch TSRMLS_CC);
+ tmp = zend_list_insert(disp, le_dispatch);
disp->res = Z_RES_P(tmp);
return disp;
}
-static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
+static void disp_destructor(php_dispatchex *disp)
{
/* Object store not available during request shutdown */
if (COMG(rshutdown_started)) {
@@ -583,9 +583,9 @@ static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
- HashTable *id_to_name TSRMLS_DC)
+ HashTable *id_to_name)
{
- php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
+ php_dispatchex *disp = disp_constructor(val);
HashPosition pos;
zend_string *name = NULL;
zval tmp, *ntmp;
@@ -618,7 +618,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
return (IDispatch*)disp;
}
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val)
{
php_dispatchex *disp = NULL;
@@ -626,7 +626,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
return NULL;
}
- if (php_com_is_valid_object(val TSRMLS_CC)) {
+ if (php_com_is_valid_object(val)) {
/* pass back its IDispatch directly */
php_com_dotnet_object *obj = CDNO_FETCH(val);
@@ -641,8 +641,8 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
return NULL;
}
- disp = disp_constructor(val TSRMLS_CC);
- generate_dispids(disp TSRMLS_CC);
+ disp = disp_constructor(val);
+ generate_dispids(disp);
return (IDispatch*)disp;
}
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index e06f50c7d6..518e27af1f 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -54,7 +54,7 @@ typedef struct _php_com_dotnet_object {
HashTable *id_of_name_cache;
} php_com_dotnet_object;
-static inline int php_com_is_valid_object(zval *zv TSRMLS_DC)
+static inline int php_com_is_valid_object(zval *zv)
{
zend_class_entry *ce = Z_OBJCE_P(zv);
return strcmp("com", ce->name->val) == 0 ||
@@ -64,8 +64,8 @@ static inline int php_com_is_valid_object(zval *zv TSRMLS_DC)
#define CDNO_FETCH(zv) (php_com_dotnet_object*)Z_OBJ_P(zv)
#define CDNO_FETCH_VERIFY(obj, zv) do { \
- if (!php_com_is_valid_object(zv TSRMLS_CC)) { \
- php_com_throw_exception(E_UNEXPECTED, "expected a variant object" TSRMLS_CC); \
+ if (!php_com_is_valid_object(zv)) { \
+ php_com_throw_exception(E_UNEXPECTED, "expected a variant object"); \
return; \
} \
obj = (php_com_dotnet_object*)Z_OBJ_P(zv); \
@@ -76,21 +76,21 @@ TsHashTable php_com_typelibraries;
zend_class_entry *php_com_variant_class_entry, *php_com_exception_class_entry, *php_com_saproxy_class_entry;
/* com_handlers.c */
-zend_object* php_com_object_new(zend_class_entry *ce TSRMLS_DC);
-zend_object* php_com_object_clone(zval *object TSRMLS_DC);
-void php_com_object_free_storage(zend_object *object TSRMLS_DC);
+zend_object* php_com_object_new(zend_class_entry *ce);
+zend_object* php_com_object_clone(zval *object);
+void php_com_object_free_storage(zend_object *object);
zend_object_handlers php_com_object_handlers;
-void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC);
+void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable);
/* com_saproxy.c */
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
-int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref);
+int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index);
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
- size_t *string_len, int codepage TSRMLS_DC);
+ size_t *string_len, int codepage);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
- size_t string_len, int codepage TSRMLS_DC);
+ size_t string_len, int codepage);
/* com_com.c */
@@ -103,20 +103,20 @@ PHP_FUNCTION(com_load_typelib);
PHP_FUNCTION(com_get_active_object);
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
- WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg TSRMLS_DC);
+ WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, int allow_noarg);
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
- size_t namelen, DISPID *dispid TSRMLS_DC);
+ size_t namelen, DISPID *dispid);
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
- WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg);
int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
- WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg);
int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f,
- WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC);
+ WORD flags, VARIANT *v, int nargs, zval *args);
/* com_wrapper.c */
int php_com_wrapper_minit(INIT_FUNC_ARGS);
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
-PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -150,36 +150,36 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
-PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
+PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage);
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage);
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage);
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src);
/* com_dotnet.c */
PHP_FUNCTION(com_dotnet_create_instance);
-void php_com_dotnet_rshutdown(TSRMLS_D);
-void php_com_dotnet_mshutdown(TSRMLS_D);
+void php_com_dotnet_rshutdown(void);
+void php_com_dotnet_mshutdown(void);
/* com_misc.c */
-void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
+void php_com_throw_exception(HRESULT code, char *message);
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
- int codepage TSRMLS_DC);
+ int codepage);
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
- int codepage TSRMLS_DC);
-PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
+ int codepage);
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1);
/* com_typeinfo.c */
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
- int codepage, int *cached TSRMLS_DC);
-PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
+ int codepage, int *cached);
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
- int codepage TSRMLS_DC);
+ int codepage);
void php_com_typelibrary_dtor(void *pDest);
-ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
-int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC);
+ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink);
+int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage);
/* com_iterator.c */
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref);
#endif
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index b03afe05f0..da04f1fad0 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -144,7 +144,7 @@ static PHP_MINFO_FUNCTION(ctype)
*/
#define CTYPE(iswhat) \
zval *c, tmp; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &c) == FAILURE) \
return; \
if (Z_TYPE_P(c) == IS_LONG) { \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c
index 6b0e5462a1..a544035630 100644
--- a/ext/curl/curl_file.c
+++ b/ext/curl/curl_file.c
@@ -35,20 +35,20 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
size_t fname_len, mime_len, postname_len;
zval *cf = return_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", &fname, &fname_len, &mime, &mime_len, &postname, &postname_len) == FAILURE) {
return;
}
if (fname) {
- zend_update_property_string(curl_CURLFile_class, cf, "name", sizeof("name")-1, fname TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "name", sizeof("name")-1, fname);
}
if (mime) {
- zend_update_property_string(curl_CURLFile_class, cf, "mime", sizeof("mime")-1, mime TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "mime", sizeof("mime")-1, mime);
}
if (postname) {
- zend_update_property_string(curl_CURLFile_class, cf, "postname", sizeof("postname")-1, postname TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, cf, "postname", sizeof("postname")-1, postname);
}
}
@@ -76,7 +76,7 @@ static void curlfile_get_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- res = zend_read_property(curl_CURLFile_class, getThis(), name, strlen(name), 1 TSRMLS_CC);
+ res = zend_read_property(curl_CURLFile_class, getThis(), name, strlen(name), 1);
RETURN_ZVAL(res, 1, 0);
}
@@ -85,10 +85,10 @@ static void curlfile_set_property(char *name, INTERNAL_FUNCTION_PARAMETERS)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
- zend_update_property_string(curl_CURLFile_class, getThis(), name, strlen(name), arg TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, getThis(), name, strlen(name), arg);
}
/* {{{ proto string CURLFile::getFilename()
@@ -135,8 +135,8 @@ ZEND_METHOD(CURLFile, setPostFilename)
Unserialization handler */
ZEND_METHOD(CURLFile, __wakeup)
{
- zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "" TSRMLS_CC);
- zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0 TSRMLS_CC);
+ zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "");
+ zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0);
}
/* }}} */
@@ -162,14 +162,14 @@ static const zend_function_entry curlfile_funcs[] = {
PHP_FE_END
};
-void curlfile_register_class(TSRMLS_D)
+void curlfile_register_class(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY( ce, "CURLFile", curlfile_funcs );
- curl_CURLFile_class = zend_register_internal_class(&ce TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "mime", sizeof("mime")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(curl_CURLFile_class, "postname", sizeof("postname")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ curl_CURLFile_class = zend_register_internal_class(&ce);
+ zend_declare_property_string(curl_CURLFile_class, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(curl_CURLFile_class, "mime", sizeof("mime")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(curl_CURLFile_class, "postname", sizeof("postname")-1, "", ZEND_ACC_PUBLIC);
}
#endif
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 6bd241ee15..6552a211f0 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -148,8 +148,8 @@ static struct gcry_thread_cbs php_curl_gnutls_tsl = {
#endif
/* }}} */
-static void _php_curl_close_ex(php_curl *ch TSRMLS_DC);
-static void _php_curl_close(zend_resource *rsrc TSRMLS_DC);
+static void _php_curl_close_ex(php_curl *ch);
+static void _php_curl_close(zend_resource *rsrc);
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
@@ -166,12 +166,12 @@ static void _php_curl_close(zend_resource *rsrc TSRMLS_DC);
# define php_curl_ret(__ret) RETVAL_FALSE; return;
#endif
-static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const int len, zend_bool make_copy TSRMLS_DC)
+static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, const int len, zend_bool make_copy)
{
CURLcode error = CURLE_OK;
if (strlen(str) != len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
+ php_error_docref(NULL, E_WARNING, "Curl option contains invalid characters (\\0)");
return FAILURE;
}
@@ -195,7 +195,7 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char *str,
return error == CURLE_OK ? SUCCESS : FAILURE;
}
-static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
+static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */
{
/* Disable file:// if open_basedir are used */
if (PG(open_basedir) && *PG(open_basedir)) {
@@ -205,12 +205,12 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
php_url *uri;
if (!(uri = php_url_parse_ex(url, len))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", url);
+ php_error_docref(NULL, E_WARNING, "Invalid URL '%s'", url);
return FAILURE;
}
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
+ php_error_docref(NULL, E_WARNING, "Protocol 'file' disabled in cURL");
php_url_free(uri);
return FAILURE;
}
@@ -218,11 +218,11 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM
#endif
}
- return php_curl_option_str(ch, CURLOPT_URL, url, len, 0 TSRMLS_CC);
+ return php_curl_option_str(ch, CURLOPT_URL, url, len, 0);
}
/* }}} */
-void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
+void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
{
php_stream *stream;
if (!ch || !ch->handlers) {
@@ -230,10 +230,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
if (!Z_ISUNDEF(ch->handlers->std_err)) {
- stream = zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->std_err, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
}
zval_ptr_dtor(&ch->handlers->std_err);
ZVAL_UNDEF(&ch->handlers->std_err);
@@ -242,10 +242,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->read && !Z_ISUNDEF(ch->handlers->read->stream)) {
- stream = zend_fetch_resource(&ch->handlers->read->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->read->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->read->stream);
ZVAL_UNDEF(&ch->handlers->read->stream);
@@ -256,10 +256,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->write_header && !Z_ISUNDEF(ch->handlers->write_header->stream)) {
- stream = zend_fetch_resource(&ch->handlers->write_header->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->write_header->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write_header->stream);
ZVAL_UNDEF(&ch->handlers->write_header->stream);
@@ -270,10 +270,10 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ *
}
}
if (ch->handlers->write && !Z_ISUNDEF(ch->handlers->write->stream)) {
- stream = zend_fetch_resource(&ch->handlers->write->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->write->stream, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write->stream);
ZVAL_UNDEF(&ch->handlers->write->stream);
@@ -1243,7 +1243,7 @@ PHP_MINIT_FUNCTION(curl)
return FAILURE;
}
- curlfile_register_class(TSRMLS_C);
+ curlfile_register_class();
return SUCCESS;
}
@@ -1329,10 +1329,10 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
@@ -1383,10 +1383,10 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -1443,10 +1443,10 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -1505,10 +1505,10 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
fci.symbol_table = NULL;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */
length = CURL_READFUNC_ABORT;
#endif
@@ -1573,10 +1573,10 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
fci.no_separation = 0;
ch->in_callback = 1;
- error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
+ error = zend_call_function(&fci, &t->fci_cache);
ch->in_callback = 0;
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
@@ -1635,17 +1635,17 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
ZVAL_STRING(&argv[1], prompt);
ZVAL_LONG(&argv[2], buflen);
- error = call_user_function(EG(function_table), NULL, func, &retval, 2, argv TSRMLS_CC);
+ error = call_user_function(EG(function_table), NULL, func, &retval, 2, argv);
if (error == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION");
+ php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_PASSWDFUNCTION");
} else if (Z_TYPE(retval) == IS_STRING) {
if (Z_STRLEN(retval) > buflen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Returned password is too long for libcurl to handle");
+ php_error_docref(NULL, E_WARNING, "Returned password is too long for libcurl to handle");
} else {
memcpy(buf, Z_STRVAL(retval), Z_STRLEN(retval) + 1);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "User handler '%s' did not return a string", Z_STRVAL_P(func));
+ php_error_docref(NULL, E_WARNING, "User handler '%s' did not return a string", Z_STRVAL_P(func));
}
zval_ptr_dtor(&argv[0]);
@@ -1689,7 +1689,7 @@ PHP_FUNCTION(curl_version)
curl_version_info_data *d;
zend_long uversion = CURLVERSION_NOW;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &uversion) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &uversion) == FAILURE) {
return;
}
@@ -1788,7 +1788,7 @@ static void split_certinfo(char *string, zval *hash)
/* {{{ create_certinfo
*/
-static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC)
+static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
{
int i;
@@ -1819,7 +1819,7 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC)
add_assoc_string(&certhash, s, &slist->data[len+1]);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not extract hash key from certificate info");
+ php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info");
}
}
add_next_index_zval(listcode, &certhash);
@@ -1871,13 +1871,13 @@ PHP_FUNCTION(curl_init)
char *url = NULL;
size_t url_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &url, &url_len) == FAILURE) {
return;
}
cp = curl_easy_init();
if (!cp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not initialize a new cURL handle");
+ php_error_docref(NULL, E_WARNING, "Could not initialize a new cURL handle");
RETURN_FALSE;
}
@@ -1893,8 +1893,8 @@ PHP_FUNCTION(curl_init)
_php_curl_set_default_options(ch);
if (url) {
- if (php_curl_option_url(ch, url, url_len TSRMLS_CC) == FAILURE) {
- _php_curl_close_ex(ch TSRMLS_CC);
+ if (php_curl_option_url(ch, url, url_len) == FAILURE) {
+ _php_curl_close_ex(ch);
RETURN_FALSE;
}
}
@@ -1912,7 +1912,7 @@ PHP_FUNCTION(curl_copy_handle)
zval *zid;
php_curl *ch, *dupch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -1920,7 +1920,7 @@ PHP_FUNCTION(curl_copy_handle)
cp = curl_easy_duphandle(ch->cp);
if (!cp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot duplicate cURL handle");
+ php_error_docref(NULL, E_WARNING, "Cannot duplicate cURL handle");
RETURN_FALSE;
}
@@ -2003,7 +2003,7 @@ PHP_FUNCTION(curl_copy_handle)
}
/* }}} */
-static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_DC) /* {{{ */
+static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ */
{
CURLcode error = CURLE_OK;
@@ -2013,9 +2013,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
convert_to_long(zvalue);
if (Z_LVAL_P(zvalue) == 1) {
#if LIBCURL_VERSION_NUM <= 0x071c00 /* 7.28.0 */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead");
+ php_error_docref(NULL, E_NOTICE, "CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead");
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead");
+ php_error_docref(NULL, E_NOTICE, "CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead");
error = curl_easy_setopt(ch->cp, option, 2);
break;
#endif
@@ -2169,7 +2169,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#if LIBCURL_VERSION_NUM >= 0x71304
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
(PG(open_basedir) && *PG(open_basedir)) && (Z_LVAL_P(zvalue) & CURLPROTO_FILE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
+ php_error_docref(NULL, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
return 1;
}
#endif
@@ -2239,7 +2239,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#endif
{
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
/* Curl nullable string options */
@@ -2262,7 +2262,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
error = curl_easy_setopt(ch->cp, option, NULL);
} else {
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
break;
}
@@ -2270,12 +2270,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
/* Curl private option */
case CURLOPT_PRIVATE:
convert_to_string_ex(zvalue);
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 1 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 1);
/* Curl url option */
case CURLOPT_URL:
convert_to_string_ex(zvalue);
- return php_curl_option_url(ch, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue) TSRMLS_CC);
+ return php_curl_option_url(ch, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue));
/* Curl file handle options */
case CURLOPT_FILE:
@@ -2287,7 +2287,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
php_stream *what = NULL;
if (Z_TYPE_P(zvalue) != IS_NULL) {
- what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
+ what = zend_fetch_resource(zvalue, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
if (!what) {
return FAILURE;
}
@@ -2317,7 +2317,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
ch->handlers->write->method = PHP_CURL_FILE;
ZVAL_COPY(&ch->handlers->write->stream, zvalue);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
break;
@@ -2335,7 +2335,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
ch->handlers->write_header->method = PHP_CURL_FILE;
ZVAL_COPY(&ch->handlers->write_header->stream, zvalue);;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
break;
@@ -2364,7 +2364,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
zval_ptr_dtor(&ch->handlers->std_err);
ZVAL_COPY(&ch->handlers->std_err, zvalue);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
+ php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
return FAILURE;
}
/* break omitted intentionally */
@@ -2426,7 +2426,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
break;
#endif
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the %s argument", name);
+ php_error_docref(NULL, E_WARNING, "You must pass either an object or an array with the %s argument", name);
return FAILURE;
}
@@ -2436,7 +2436,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
slist = curl_slist_append(slist, Z_STRVAL_P(current));
if (!slist) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
+ php_error_docref(NULL, E_WARNING, "Could not build curl_slist");
return 1;
}
} ZEND_HASH_FOREACH_END();
@@ -2457,7 +2457,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
#if LIBCURL_VERSION_NUM < 0x071304
if (PG(open_basedir) && *PG(open_basedir)) {
if (Z_LVAL_P(zvalue) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
+ php_error_docref(NULL, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
return FAILURE;
}
}
@@ -2485,7 +2485,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
postfields = HASH_OF(zvalue);
if (!postfields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
+ php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
return FAILURE;
}
@@ -2499,26 +2499,26 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
}
if (Z_TYPE_P(current) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(current), curl_CURLFile_class TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(current), curl_CURLFile_class)) {
/* new-style file upload */
zval *prop;
char *type = NULL, *filename = NULL;
- prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0);
if (Z_TYPE_P(prop) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename for key %s", string_key->val);
+ php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", string_key->val);
} else {
postval = Z_STRVAL_P(prop);
- if (php_check_open_basedir(postval TSRMLS_CC)) {
+ if (php_check_open_basedir(postval)) {
return 1;
}
- prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
type = Z_STRVAL_P(prop);
}
- prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0 TSRMLS_CC);
+ prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0);
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
filename = Z_STRVAL_P(prop);
}
@@ -2547,7 +2547,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
char *name, *type, *filename;
++postval;
- php_error_docref("curl.curlfile" TSRMLS_CC, E_DEPRECATED,
+ php_error_docref("curl.curlfile", E_DEPRECATED,
"The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead");
name = estrndup(postval, Z_STRLEN_P(current));
@@ -2560,7 +2560,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
*filename = '\0';
}
/* open_basedir check */
- if (php_check_open_basedir(name TSRMLS_CC)) {
+ if (php_check_open_basedir(name)) {
efree(name);
return FAILURE;
}
@@ -2701,11 +2701,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
{
convert_to_string_ex(zvalue);
- if (Z_STRLEN_P(zvalue) && php_check_open_basedir(Z_STRVAL_P(zvalue) TSRMLS_CC)) {
+ if (Z_STRLEN_P(zvalue) && php_check_open_basedir(Z_STRVAL_P(zvalue))) {
return FAILURE;
}
- return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0 TSRMLS_CC);
+ return php_curl_option_str(ch, option, Z_STRVAL_P(zvalue), Z_STRLEN_P(zvalue), 0);
}
case CURLINFO_HEADER_OUT:
@@ -2764,18 +2764,18 @@ PHP_FUNCTION(curl_setopt)
zend_long options;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zid, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zid, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (options <= 0 && options != CURLOPT_SAFE_UPLOAD) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl configuration option");
RETURN_FALSE;
}
- if (_php_curl_setopt(ch, options, zvalue TSRMLS_CC) == SUCCESS) {
+ if (_php_curl_setopt(ch, options, zvalue) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2792,7 +2792,7 @@ PHP_FUNCTION(curl_setopt_array)
zend_ulong option;
zend_string *string_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &zid, &arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "za", &zid, &arr) == FAILURE) {
return;
}
@@ -2800,11 +2800,11 @@ PHP_FUNCTION(curl_setopt_array)
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(arr), option, string_key, entry) {
if (string_key) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Array keys must be CURLOPT constants or equivalent integer values");
RETURN_FALSE;
}
- if (_php_curl_setopt(ch, (zend_long) option, entry TSRMLS_CC) == FAILURE) {
+ if (_php_curl_setopt(ch, (zend_long) option, entry) == FAILURE) {
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
@@ -2836,13 +2836,13 @@ PHP_FUNCTION(curl_exec)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
- _php_curl_verify_handlers(ch, 1 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 1);
_php_curl_cleanup_handle(ch);
@@ -2856,7 +2856,7 @@ PHP_FUNCTION(curl_exec)
if (!Z_ISUNDEF(ch->handlers->std_err)) {
php_stream *stream;
- stream = zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
+ stream = zend_fetch_resource(&ch->handlers->std_err, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream) {
php_stream_flush(stream);
}
@@ -2891,7 +2891,7 @@ PHP_FUNCTION(curl_getinfo)
php_curl *ch;
zend_long option = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zid, &option) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zid, &option) == FAILURE) {
return;
}
@@ -2987,7 +2987,7 @@ PHP_FUNCTION(curl_getinfo)
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) {
array_init(&listcode);
- create_certinfo(ci, &listcode TSRMLS_CC);
+ create_certinfo(ci, &listcode);
CAAZ("certinfo", &listcode);
}
#endif
@@ -3020,7 +3020,7 @@ PHP_FUNCTION(curl_getinfo)
array_init(return_value);
if (curl_easy_getinfo(ch->cp, CURLINFO_CERTINFO, &ci) == CURLE_OK) {
- create_certinfo(ci, return_value TSRMLS_CC);
+ create_certinfo(ci, return_value);
} else {
RETURN_FALSE;
}
@@ -3096,7 +3096,7 @@ PHP_FUNCTION(curl_error)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -3114,7 +3114,7 @@ PHP_FUNCTION(curl_errno)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
@@ -3131,14 +3131,14 @@ PHP_FUNCTION(curl_close)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (ch->in_callback) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close cURL handle from a callback");
+ php_error_docref(NULL, E_WARNING, "Attempt to close cURL handle from a callback");
return;
}
@@ -3150,13 +3150,13 @@ PHP_FUNCTION(curl_close)
/* {{{ _php_curl_close()
List destructor for curl handles */
-static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
+static void _php_curl_close_ex(php_curl *ch)
{
#if PHP_CURL_DEBUG
fprintf(stderr, "DTOR CALLED, ch = %x\n", ch);
#endif
- _php_curl_verify_handlers(ch, 0 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 0);
/*
* Libcurl is doing connection caching. When easy handle is cleaned up,
@@ -3222,10 +3222,10 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
/* {{{ _php_curl_close()
List destructor for curl handles */
-static void _php_curl_close(zend_resource *rsrc TSRMLS_DC)
+static void _php_curl_close(zend_resource *rsrc)
{
php_curl *ch = (php_curl *) rsrc->ptr;
- _php_curl_close_ex(ch TSRMLS_CC);
+ _php_curl_close_ex(ch);
}
/* }}} */
@@ -3237,7 +3237,7 @@ PHP_FUNCTION(curl_strerror)
zend_long code;
const char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -3307,14 +3307,14 @@ PHP_FUNCTION(curl_reset)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (ch->in_callback) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to reset cURL handle from a callback");
+ php_error_docref(NULL, E_WARNING, "Attempt to reset cURL handle from a callback");
return;
}
@@ -3335,7 +3335,7 @@ PHP_FUNCTION(curl_escape)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zid, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) {
return;
}
@@ -3359,7 +3359,7 @@ PHP_FUNCTION(curl_unescape)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zid, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) {
return;
}
@@ -3384,7 +3384,7 @@ PHP_FUNCTION(curl_pause)
zval *zid;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zid, &bitmask) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zid, &bitmask) == FAILURE) {
return;
}
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index d9ace4119c..60f3e72ec5 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -78,7 +78,7 @@ PHP_FUNCTION(curl_multi_add_handle)
php_curl *ch;
zval tmp_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &z_mh, &z_ch) == FAILURE) {
return;
}
@@ -100,13 +100,12 @@ void _php_curl_multi_cleanup_list(void *data) /* {{{ */
{
zval *z_ch = (zval *)data;
php_curl *ch;
- TSRMLS_FETCH();
if (!z_ch) {
return;
}
- ch = zend_fetch_resource(z_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
+ ch = zend_fetch_resource(z_ch, -1, le_curl_name, NULL, 1, le_curl);
if (!ch) {
return;
}
@@ -133,7 +132,7 @@ PHP_FUNCTION(curl_multi_remove_handle)
php_curlm *mh;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &z_mh, &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &z_mh, &z_ch) == FAILURE) {
return;
}
@@ -169,7 +168,7 @@ PHP_FUNCTION(curl_multi_select)
double timeout = 1.0;
struct timeval to;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|d", &z_mh, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|d", &z_mh, &timeout) == FAILURE) {
return;
}
@@ -199,7 +198,7 @@ PHP_FUNCTION(curl_multi_exec)
int still_running;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/", &z_mh, &z_still_running) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/", &z_mh, &z_still_running) == FAILURE) {
return;
}
@@ -214,7 +213,7 @@ PHP_FUNCTION(curl_multi_exec)
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
ZEND_FETCH_RESOURCE(ch, php_curl *, pz_ch, -1, le_curl_name, le_curl);
- _php_curl_verify_handlers(ch, 1 TSRMLS_CC);
+ _php_curl_verify_handlers(ch, 1);
}
}
@@ -234,7 +233,7 @@ PHP_FUNCTION(curl_multi_getcontent)
zval *z_ch;
php_curl *ch;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ch) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ch) == FAILURE) {
return;
}
@@ -262,7 +261,7 @@ PHP_FUNCTION(curl_multi_info_read)
int queued_msgs;
zval *zmsgs_in_queue = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/", &z_mh, &zmsgs_in_queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z/", &z_mh, &zmsgs_in_queue) == FAILURE) {
return;
}
@@ -322,7 +321,7 @@ PHP_FUNCTION(curl_multi_close)
zval *z_mh;
php_curlm *mh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_mh) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_mh) == FAILURE) {
return;
}
@@ -332,7 +331,7 @@ PHP_FUNCTION(curl_multi_close)
}
/* }}} */
-void _php_curl_multi_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void _php_curl_multi_close(zend_resource *rsrc) /* {{{ */
{
php_curlm *mh = (php_curlm *)rsrc->ptr;
if (mh) {
@@ -343,8 +342,8 @@ void _php_curl_multi_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
- ch = (php_curl *) zend_fetch_resource(pz_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
- _php_curl_verify_handlers(ch, 0 TSRMLS_CC);
+ ch = (php_curl *) zend_fetch_resource(pz_ch, -1, le_curl_name, NULL, 1, le_curl);
+ _php_curl_verify_handlers(ch, 0);
}
curl_multi_cleanup(mh->multi);
@@ -363,7 +362,7 @@ PHP_FUNCTION(curl_multi_strerror)
zend_long code;
const char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -378,7 +377,7 @@ PHP_FUNCTION(curl_multi_strerror)
#endif
#if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */
-static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value TSRMLS_DC) /* {{{ */
+static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value) /* {{{ */
{
CURLMcode error = CURLM_OK;
@@ -394,7 +393,7 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl multi configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl multi configuration option");
error = CURLM_UNKNOWN_OPTION;
break;
}
@@ -415,13 +414,13 @@ PHP_FUNCTION(curl_multi_setopt)
zend_long options;
php_curlm *mh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_mh, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &z_mh, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mh, php_curlm *, z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle);
- if (!_php_curl_multi_setopt(mh, options, zvalue, return_value TSRMLS_CC)) {
+ if (!_php_curl_multi_setopt(mh, options, zvalue, return_value)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index ad44ae7b96..2b6ce548d0 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -114,8 +114,8 @@ PHP_FUNCTION(curl_pause);
PHP_FUNCTION(curl_file_create);
-void _php_curl_multi_close(zend_resource * TSRMLS_DC);
-void _php_curl_share_close(zend_resource * TSRMLS_DC);
+void _php_curl_multi_close(zend_resource *);
+void _php_curl_share_close(zend_resource *);
typedef struct {
zval func_name;
@@ -197,9 +197,9 @@ typedef struct {
void _php_curl_cleanup_handle(php_curl *);
void _php_curl_multi_cleanup_list(void *data);
-void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
+void _php_curl_verify_handlers(php_curl *ch, int reporterror);
-void curlfile_register_class(TSRMLS_D);
+void curlfile_register_class(void);
PHP_CURL_API extern zend_class_entry *curl_CURLFile_class;
#else
diff --git a/ext/curl/share.c b/ext/curl/share.c
index 94694e0b2e..1e51009050 100644
--- a/ext/curl/share.c
+++ b/ext/curl/share.c
@@ -57,7 +57,7 @@ PHP_FUNCTION(curl_share_close)
zval *z_sh;
php_curlsh *sh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_sh) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_sh) == FAILURE) {
return;
}
@@ -66,7 +66,7 @@ PHP_FUNCTION(curl_share_close)
}
/* }}} */
-static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue, zval *return_value TSRMLS_DC) /* {{{ */
+static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue, zval *return_value) /* {{{ */
{
CURLSHcode error = CURLSHE_OK;
@@ -78,7 +78,7 @@ static int _php_curl_share_setopt(php_curlsh *sh, zend_long option, zval *zvalue
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl share configuration option");
+ php_error_docref(NULL, E_WARNING, "Invalid curl share configuration option");
error = CURLSHE_BAD_OPTION;
break;
}
@@ -99,13 +99,13 @@ PHP_FUNCTION(curl_share_setopt)
zend_long options;
php_curlsh *sh;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zid, &options, &zvalue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zid, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(sh, php_curlsh *, zid, -1, le_curl_share_handle_name, le_curl_share_handle);
- if (!_php_curl_share_setopt(sh, options, zvalue, return_value TSRMLS_CC)) {
+ if (!_php_curl_share_setopt(sh, options, zvalue, return_value)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -113,7 +113,7 @@ PHP_FUNCTION(curl_share_setopt)
}
/* }}} */
-void _php_curl_share_close(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void _php_curl_share_close(zend_resource *rsrc) /* {{{ */
{
php_curlsh *sh = (php_curlsh *)rsrc->ptr;
if (sh) {
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 8f2e8c8fc5..f995f0e8df 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -539,8 +539,8 @@ const zend_function_entry date_funcs_period[] = {
PHP_FE_END
};
-static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
-static void date_register_classes(TSRMLS_D);
+static char* guess_timezone(const timelib_tzdb *tzdb);
+static void date_register_classes(void);
/* }}} */
ZEND_DECLARE_MODULE_GLOBALS(date)
@@ -608,7 +608,7 @@ static zend_object_handlers date_object_handlers_period;
return; \
} \
} else { \
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "O", &object, date_ce_date) == FAILURE) { \
RETURN_FALSE; \
} \
} \
@@ -616,39 +616,39 @@ static zend_object_handlers date_object_handlers_period;
#define DATE_CHECK_INITIALIZED(member, class_name) \
if (!(member)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
+ php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
RETURN_FALSE; \
}
-static void date_object_free_storage_date(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_interval(zend_object *object TSRMLS_DC);
-static void date_object_free_storage_period(zend_object *object TSRMLS_DC);
-
-static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC);
-static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC);
-
-static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC);
-static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC);
-
-static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC);
-static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC);
-static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
-static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC);
-static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC);
-
-zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
-void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
-static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC);
-static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC);
+static void date_object_free_storage_date(zend_object *object);
+static void date_object_free_storage_timezone(zend_object *object);
+static void date_object_free_storage_interval(zend_object *object);
+static void date_object_free_storage_period(zend_object *object);
+
+static zend_object *date_object_new_date(zend_class_entry *class_type);
+static zend_object *date_object_new_timezone(zend_class_entry *class_type);
+static zend_object *date_object_new_interval(zend_class_entry *class_type);
+static zend_object *date_object_new_period(zend_class_entry *class_type);
+
+static zend_object *date_object_clone_date(zval *this_ptr);
+static zend_object *date_object_clone_timezone(zval *this_ptr);
+static zend_object *date_object_clone_interval(zval *this_ptr);
+static zend_object *date_object_clone_period(zval *this_ptr);
+
+static int date_object_compare_date(zval *d1, zval *d2);
+static HashTable *date_object_get_gc(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties(zval *object);
+static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties_interval(zval *object);
+static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n);
+static HashTable *date_object_get_properties_period(zval *object);
+static HashTable *date_object_get_properties_timezone(zval *object);
+static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n);
+
+zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
+void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
+static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
+static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
/* {{{ Module struct */
zend_module_entry date_module_entry = {
@@ -832,7 +832,7 @@ PHP_RSHUTDOWN_FUNCTION(date)
PHP_MINIT_FUNCTION(date)
{
REGISTER_INI_ENTRIES();
- date_register_classes(TSRMLS_C);
+ date_register_classes();
/*
* RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt
* A Date construct is an element whose content MUST conform to the
@@ -896,7 +896,7 @@ PHP_MINFO_FUNCTION(date)
php_info_print_table_row(2, "date/time support", "enabled");
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
- php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb TSRMLS_CC));
+ php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
@@ -904,7 +904,7 @@ PHP_MINFO_FUNCTION(date)
/* }}} */
/* {{{ Timezone Cache functions */
-static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb TSRMLS_DC)
+static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb)
{
timelib_tzinfo *tzi;
@@ -926,8 +926,7 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_
timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib_tzdb *tzdb)
{
- TSRMLS_FETCH();
- return php_date_parse_tzfile(formal_tzname, tzdb TSRMLS_CC);
+ return php_date_parse_tzfile(formal_tzname, tzdb);
}
/* }}} */
@@ -935,14 +934,14 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
- if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage) == FAILURE) {
return FAILURE;
}
DATEG(timezone_valid) = 0;
if (stage == PHP_INI_STAGE_RUNTIME) {
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG);
+ php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG);
} else {
DATEG(timezone_valid) = 1;
}
@@ -953,7 +952,7 @@ static PHP_INI_MH(OnUpdate_date_timezone)
/* }}} */
/* {{{ Helper functions */
-static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
+static char* guess_timezone(const timelib_tzdb *tzdb)
{
/* Checking configure timezone */
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
@@ -974,7 +973,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
+ php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
return "UTC";
}
@@ -982,19 +981,19 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
return DATEG(default_timezone);
}
/* Fallback to UTC */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
+ php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
return "UTC";
}
-PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D)
+PHPAPI timelib_tzinfo *get_timezone_info(void)
{
char *tz;
timelib_tzinfo *tzi;
- tz = guess_timezone(DATE_TIMEZONEDB TSRMLS_CC);
- tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC);
+ tz = guess_timezone(DATE_TIMEZONEDB);
+ tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB);
if (! tzi) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!");
+ php_error_docref(NULL, E_ERROR, "Timezone database is corrupt - this should *never* happen!");
}
return tzi;
}
@@ -1058,7 +1057,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
/* }}} */
/* {{{ date_format - (gm)date helper */
-static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime TSRMLS_DC)
+static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime)
{
smart_str string = {0};
int i, length = 0;
@@ -1222,18 +1221,18 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
size_t format_len;
zend_long ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 1) {
ts = time(NULL);
}
- RETURN_STR(php_format_date(format, format_len, ts, localtime TSRMLS_CC));
+ RETURN_STR(php_format_date(format, format_len, ts, localtime));
}
/* }}} */
-PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime) /* {{{ */
{
timelib_time *t;
timelib_tzinfo *tzi;
@@ -1242,7 +1241,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
t = timelib_time_ctor();
if (localtime) {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, ts);
@@ -1251,7 +1250,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
timelib_unixtime2gmt(t, ts);
}
- string = date_format(format, format_len, t, localtime TSRMLS_CC);
+ string = date_format(format, format_len, t, localtime);
timelib_time_dtor(t);
return string;
@@ -1260,7 +1259,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts,
/* {{{ php_idate
*/
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
+PHPAPI int php_idate(char format, time_t ts, int localtime)
{
timelib_time *t;
timelib_tzinfo *tzi;
@@ -1271,7 +1270,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC)
t = timelib_time_ctor();
if (!localtime) {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, ts);
@@ -1379,12 +1378,12 @@ PHP_FUNCTION(idate)
zend_long ts = 0;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) {
RETURN_FALSE;
}
if (format_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "idate format is one char");
+ php_error_docref(NULL, E_WARNING, "idate format is one char");
RETURN_FALSE;
}
@@ -1392,9 +1391,9 @@ PHP_FUNCTION(idate)
ts = time(NULL);
}
- ret = php_idate(format[0], ts, 0 TSRMLS_CC);
+ ret = php_idate(format[0], ts, 0);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token.");
+ php_error_docref(NULL, E_WARNING, "Unrecognized date format token.");
RETURN_FALSE;
}
RETURN_LONG(ret);
@@ -1451,9 +1450,9 @@ PHP_FUNCTION(strtotime)
timelib_time *t, *now;
timelib_tzinfo *tzi;
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", &times, &time_len, &preset_ts) != FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sl", &times, &time_len, &preset_ts) != FAILURE) {
/* We have an initial timestamp */
now = timelib_time_ctor();
@@ -1466,7 +1465,7 @@ PHP_FUNCTION(strtotime)
timelib_unixtime2local(now, t->sse);
timelib_time_dtor(t);
efree(initial_ts);
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &times, &time_len, &preset_ts) != FAILURE) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &times, &time_len, &preset_ts) != FAILURE) {
/* We have no initial timestamp */
now = timelib_time_ctor();
now->tz_info = tzi;
@@ -1508,7 +1507,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
zend_long ts, adjust_seconds = 0;
int error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) {
RETURN_FALSE;
}
/* Initialize structure with current time */
@@ -1516,7 +1515,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
if (gmt) {
timelib_unixtime2gmt(now, (timelib_sll) time(NULL));
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
now->tz_info = tzi;
now->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(now, (timelib_sll) time(NULL));
@@ -1549,7 +1548,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
now->h = hou;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead");
+ php_error_docref(NULL, E_STRICT, "You should be using the time() function instead");
}
/* Update the timestamp */
if (gmt) {
@@ -1559,7 +1558,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
}
/* Support for the deprecated is_dst parameter */
if (dst != -1) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The is_dst parameter is deprecated");
+ php_error_docref(NULL, E_DEPRECATED, "The is_dst parameter is deprecated");
if (gmt) {
/* GMT never uses DST */
if (dst == 1) {
@@ -1613,7 +1612,7 @@ PHP_FUNCTION(checkdate)
{
zend_long m, d, y;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &m, &d, &y) == FAILURE) {
RETURN_FALSE;
}
@@ -1641,7 +1640,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
timestamp = (zend_long) time(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &timestamp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &timestamp) == FAILURE) {
RETURN_FALSE;
}
@@ -1654,7 +1653,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
tzi = NULL;
timelib_unixtime2gmt(ts, (timelib_sll) timestamp);
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(ts, (timelib_sll) timestamp);
@@ -1754,11 +1753,11 @@ PHP_FUNCTION(localtime)
timelib_tzinfo *tzi;
timelib_time *ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", &timestamp, &associative) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lb", &timestamp, &associative) == FAILURE) {
RETURN_FALSE;
}
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts = timelib_time_ctor();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
@@ -1800,11 +1799,11 @@ PHP_FUNCTION(getdate)
timelib_tzinfo *tzi;
timelib_time *ts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &timestamp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &timestamp) == FAILURE) {
RETURN_FALSE;
}
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
ts = timelib_time_ctor();
ts->tz_info = tzi;
ts->zone_type = TIMELIB_ZONETYPE_ID;
@@ -1855,7 +1854,7 @@ typedef struct {
} date_period_it;
/* {{{ date_period_it_invalidate_current */
-static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_invalidate_current(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
@@ -1867,18 +1866,18 @@ static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_
/* }}} */
/* {{{ date_period_it_dtor */
-static void date_period_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_dtor(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.data);
}
/* }}} */
/* {{{ date_period_it_has_more */
-static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC)
+static int date_period_it_has_more(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data);
@@ -1902,7 +1901,7 @@ static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ date_period_it_current_data */
-static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *date_period_it_current_data(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data);
@@ -1910,7 +1909,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
php_date_obj *newdateobj;
/* Create new object */
- php_date_instantiate(object->start_ce, &iterator->current TSRMLS_CC);
+ php_date_instantiate(object->start_ce, &iterator->current);
newdateobj = Z_PHPDATE_P(&iterator->current);
newdateobj->time = timelib_time_ctor();
*newdateobj->time = *it_time;
@@ -1926,7 +1925,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ date_period_it_current_key */
-static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void date_period_it_current_key(zend_object_iterator *iter, zval *key)
{
date_period_it *iterator = (date_period_it *)iter;
ZVAL_LONG(key, iterator->current_index);
@@ -1934,17 +1933,17 @@ static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSR
/* }}} */
/* {{{ date_period_it_move_forward */
-static void date_period_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_move_forward(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
iterator->current_index++;
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
}
/* }}} */
/* {{{ date_period_it_rewind */
-static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void date_period_it_rewind(zend_object_iterator *iter)
{
date_period_it *iterator = (date_period_it *)iter;
@@ -1953,7 +1952,7 @@ static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC)
timelib_time_dtor(iterator->object->current);
}
iterator->object->current = timelib_time_clone(iterator->object->start);
- date_period_it_invalidate_current(iter TSRMLS_CC);
+ date_period_it_invalidate_current(iter);
}
/* }}} */
@@ -1968,7 +1967,7 @@ zend_object_iterator_funcs date_period_it_funcs = {
date_period_it_invalidate_current
};
-zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
date_period_it *iterator = emalloc(sizeof(date_period_it));
@@ -1976,7 +1975,7 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &date_period_it_funcs;
@@ -1986,11 +1985,11 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
return (zend_object_iterator*)iterator;
} /* }}} */
-static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor TSRMLS_DC) /* {{{ */
+static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor) /* {{{ */
{
if (implementor->type == ZEND_USER_CLASS &&
- !instanceof_function(implementor, date_ce_date TSRMLS_CC) &&
- !instanceof_function(implementor, date_ce_immutable TSRMLS_CC)
+ !instanceof_function(implementor, date_ce_date) &&
+ !instanceof_function(implementor, date_ce_immutable)
) {
zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes");
}
@@ -1998,17 +1997,17 @@ static int implement_date_interface_handler(zend_class_entry *interface, zend_cl
return SUCCESS;
} /* }}} */
-static void date_register_classes(TSRMLS_D) /* {{{ */
+static void date_register_classes(void) /* {{{ */
{
zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface);
- date_ce_interface = zend_register_internal_interface(&ce_interface TSRMLS_CC);
+ date_ce_interface = zend_register_internal_interface(&ce_interface);
date_ce_interface->interface_gets_implemented = implement_date_interface_handler;
INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date);
ce_date.create_object = date_object_new_date;
- date_ce_date = zend_register_internal_class_ex(&ce_date, NULL TSRMLS_CC);
+ date_ce_date = zend_register_internal_class_ex(&ce_date, NULL);
memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_date.offset = XtOffsetOf(php_date_obj, std);
date_object_handlers_date.free_obj = date_object_free_storage_date;
@@ -2016,10 +2015,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_date.compare_objects = date_object_compare_date;
date_object_handlers_date.get_properties = date_object_get_properties;
date_object_handlers_date.get_gc = date_object_get_gc;
- zend_class_implements(date_ce_date TSRMLS_CC, 1, date_ce_interface);
+ zend_class_implements(date_ce_date, 1, date_ce_interface);
#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1);
REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE);
@@ -2035,16 +2034,16 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_immutable, "DateTimeImmutable", date_funcs_immutable);
ce_immutable.create_object = date_object_new_date;
- date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL TSRMLS_CC);
+ date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL);
memcpy(&date_object_handlers_immutable, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_immutable.clone_obj = date_object_clone_date;
date_object_handlers_immutable.compare_objects = date_object_compare_date;
date_object_handlers_immutable.get_properties = date_object_get_properties;
- zend_class_implements(date_ce_immutable TSRMLS_CC, 1, date_ce_interface);
+ zend_class_implements(date_ce_immutable, 1, date_ce_interface);
INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", date_funcs_timezone);
ce_timezone.create_object = date_object_new_timezone;
- date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL TSRMLS_CC);
+ date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL);
memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_timezone.offset = XtOffsetOf(php_timezone_obj, std);
date_object_handlers_timezone.free_obj = date_object_free_storage_timezone;
@@ -2053,7 +2052,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_timezone.get_gc = date_object_get_gc_timezone;
#define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value TSRMLS_CC);
+ zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value);
REGISTER_TIMEZONE_CLASS_CONST_STRING("AFRICA", PHP_DATE_TIMEZONE_GROUP_AFRICA);
REGISTER_TIMEZONE_CLASS_CONST_STRING("AMERICA", PHP_DATE_TIMEZONE_GROUP_AMERICA);
@@ -2072,7 +2071,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_interval, "DateInterval", date_funcs_interval);
ce_interval.create_object = date_object_new_interval;
- date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL TSRMLS_CC);
+ date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL);
memcpy(&date_object_handlers_interval, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_interval.offset = XtOffsetOf(php_interval_obj, std);
date_object_handlers_interval.free_obj = date_object_free_storage_interval;
@@ -2085,10 +2084,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
ce_period.create_object = date_object_new_period;
- date_ce_period = zend_register_internal_class_ex(&ce_period, NULL TSRMLS_CC);
+ date_ce_period = zend_register_internal_class_ex(&ce_period, NULL);
date_ce_period->get_iterator = date_object_period_get_iterator;
date_ce_period->iterator_funcs.funcs = &date_period_it_funcs;
- zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(date_ce_period, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_period.offset = XtOffsetOf(php_period_obj, std);
date_object_handlers_period.free_obj = date_object_free_storage_period;
@@ -2100,18 +2099,18 @@ static void date_register_classes(TSRMLS_D) /* {{{ */
date_object_handlers_period.write_property = date_period_write_property;
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
+ zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value);
REGISTER_PERIOD_CLASS_CONST_STRING("EXCLUDE_START_DATE", PHP_DATE_PERIOD_EXCLUDE_START_DATE);
} /* }}} */
-static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_date_obj *intern;
intern = ecalloc(1, sizeof(php_date_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2120,17 +2119,17 @@ static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type,
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_date(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_date_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_date_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_date(zval *this_ptr) /* {{{ */
{
php_date_obj *old_obj = Z_PHPDATE_P(this_ptr);
- php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
if (!old_obj->time) {
return &new_obj->std;
}
@@ -2148,18 +2147,18 @@ static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */
return &new_obj->std;
} /* }}} */
-static void date_clone_immutable(zval *object, zval *new_object TSRMLS_DC) /* {{{ */
+static void date_clone_immutable(zval *object, zval *new_object) /* {{{ */
{
- ZVAL_OBJ(new_object, date_object_clone_date(object TSRMLS_CC));
+ ZVAL_OBJ(new_object, date_object_clone_date(object));
} /* }}} */
-static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */
+static int date_object_compare_date(zval *d1, zval *d2) /* {{{ */
{
php_date_obj *o1 = Z_PHPDATE_P(d1);
php_date_obj *o2 = Z_PHPDATE_P(d2);
if (!o1->time || !o2->time) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object");
+ php_error_docref(NULL, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object");
return 1;
}
if (!o1->time->sse_uptodate) {
@@ -2172,21 +2171,21 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */
return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1);
} /* }}} */
-static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2195,14 +2194,14 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
dateobj = Z_PHPDATE_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!dateobj->time || GC_G(gc_active)) {
return props;
}
/* first we add the date and time in ISO format */
- ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1 TSRMLS_CC));
+ ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1));
zend_hash_str_update(props, "date", sizeof("date")-1, &zv);
/* then we add the timezone name (or similar) */
@@ -2236,13 +2235,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
return props;
} /* }}} */
-static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_timezone_obj *intern;
intern = ecalloc(1, sizeof(php_timezone_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2251,17 +2250,17 @@ static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_t
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_timezone(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_timezone_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_timezone_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_timezone(zval *this_ptr) /* {{{ */
{
php_timezone_obj *old_obj = Z_PHPTIMEZONE_P(this_ptr);
- php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
if (!old_obj->initialized) {
return &new_obj->std;
}
@@ -2285,7 +2284,7 @@ static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{
return &new_obj->std;
} /* }}} */
-static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2294,7 +2293,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /*
tzobj = Z_PHPTIMEZONE_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!tzobj->initialized) {
return props;
@@ -2327,13 +2326,13 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /*
return props;
} /* }}} */
-static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_interval_obj *intern;
intern = ecalloc(1, sizeof(php_interval_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2342,31 +2341,31 @@ static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_t
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_interval(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_interval_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_interval_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_interval(zval *this_ptr) /* {{{ */
{
php_interval_obj *old_obj = Z_PHPINTERVAL_P(this_ptr);
- php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
/** FIX ME ADD CLONE STUFF **/
return &new_obj->std;
} /* }}} */
-static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_interval(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -2374,7 +2373,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /*
intervalobj = Z_PHPINTERVAL_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!intervalobj->initialized) {
return props;
@@ -2408,13 +2407,13 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /*
return props;
} /* }}} */
-static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */
+static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props) /* {{{ */
{
php_period_obj *intern;
intern = ecalloc(1, sizeof(php_period_obj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (init_props) {
object_properties_init(&intern->std, class_type);
}
@@ -2424,23 +2423,23 @@ static inline zend_object *date_object_new_period_ex(zend_class_entry *class_typ
return &intern->std;
} /* }}} */
-static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *date_object_new_period(zend_class_entry *class_type) /* {{{ */
{
- return date_object_new_period_ex(class_type, 1 TSRMLS_CC);
+ return date_object_new_period_ex(class_type, 1);
} /* }}} */
-static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC) /* {{{ */
+static zend_object *date_object_clone_period(zval *this_ptr) /* {{{ */
{
php_period_obj *old_obj = Z_PHPPERIOD_P(this_ptr);
- php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0 TSRMLS_CC));
+ php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0));
- zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->std, &old_obj->std);
/** FIX ME ADD CLONE STUFF **/
return &new_obj->std;
} /* }}} */
-static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_date(zend_object *object) /* {{{ */
{
php_date_obj *intern = php_date_obj_from_obj(object);
@@ -2448,28 +2447,28 @@ static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{
timelib_time_dtor(intern->time);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_timezone(zend_object *object) /* {{{ */
{
php_timezone_obj *intern = php_timezone_obj_from_obj(object);
if (intern->type == TIMELIB_ZONETYPE_ABBR) {
free(intern->tzi.z.abbr);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_interval(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_interval(zend_object *object) /* {{{ */
{
php_interval_obj *intern = php_interval_obj_from_obj(object);
timelib_rel_time_dtor(intern->diff);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
-static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{{ */
+static void date_object_free_storage_period(zend_object *object) /* {{{ */
{
php_period_obj *intern = php_period_obj_from_obj(object);
@@ -2486,11 +2485,11 @@ static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{
}
timelib_rel_time_dtor(intern->interval);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
} /* }}} */
/* Advanced Interface */
-PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* {{{ */
+PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object) /* {{{ */
{
object_init_ex(object, pce);
return object;
@@ -2498,7 +2497,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
/* Helper function used to store the latest found warnings and errors while
* parsing, from either strtotime or parse_from_format. */
-static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_DC) /* {{{ */
+static void update_errors_warnings(timelib_error_container *last_errors) /* {{{ */
{
if (DATEG(last_errors)) {
timelib_error_container_dtor(DATEG(last_errors));
@@ -2507,7 +2506,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
DATEG(last_errors) = last_errors;
} /* }}} */
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC) /* {{{ */
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor) /* {{{ */
{
timelib_time *now;
timelib_tzinfo *tzi = NULL;
@@ -2526,12 +2525,12 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
}
/* update last errors and warnings */
- update_errors_warnings(err TSRMLS_CC);
+ update_errors_warnings(err);
if (ctor && err && err->error_count) {
/* spit out the first library error message, at least */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
+ php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str,
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
}
if (err && err->error_count) {
@@ -2561,7 +2560,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
} else if (dateobj->time->tz_info) {
tzi = dateobj->time->tz_info;
} else {
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
}
now = timelib_time_ctor();
@@ -2602,12 +2601,12 @@ PHP_FUNCTION(date_create)
size_t time_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_date, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2625,12 +2624,12 @@ PHP_FUNCTION(date_create_immutable)
size_t time_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_immutable, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2648,12 +2647,12 @@ PHP_FUNCTION(date_create_from_format)
size_t time_str_len = 0, format_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_date, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2671,12 +2670,12 @@ PHP_FUNCTION(date_create_immutable_from_format)
size_t time_str_len = 0, format_str_len = 0;
zval datetime_object;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC);
- if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) {
+ php_date_instantiate(date_ce_immutable, &datetime_object);
+ if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) {
zval_dtor(&datetime_object);
RETURN_FALSE;
}
@@ -2694,13 +2693,13 @@ PHP_METHOD(DateTime, __construct)
size_t time_str_len = 0;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
- if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
+ if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1)) {
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -2714,11 +2713,11 @@ PHP_METHOD(DateTimeImmutable, __construct)
size_t time_str_len = 0;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
- php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
+ php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -2731,11 +2730,11 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
php_date_obj *new_obj = NULL;
php_date_obj *old_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O!", &datetime_object, date_ce_date) == FAILURE) {
return;
}
- php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_immutable, return_value);
old_obj = Z_PHPDATE_P(datetime_object);
new_obj = Z_PHPDATE_P(return_value);
@@ -2750,7 +2749,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
}
/* }}} */
-static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
+static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht)
{
zval *z_date;
zval *z_timezone;
@@ -2775,7 +2774,7 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
char *tmp = emalloc(Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2);
int ret;
snprintf(tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2, "%s %s", Z_STRVAL_P(z_date), Z_STRVAL_P(z_timezone));
- ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
+ ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0);
efree(tmp);
return 1 == ret;
}
@@ -2784,18 +2783,18 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
int ret;
convert_to_string(z_timezone);
- tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
+ tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB);
if (tzi == NULL) {
return 0;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj TSRMLS_CC));
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj));
tzobj->type = TIMELIB_ZONETYPE_ID;
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
- ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0 TSRMLS_CC);
+ ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0);
zval_ptr_dtor(&tmp_obj);
return 1 == ret;
}
@@ -2814,15 +2813,15 @@ PHP_METHOD(DateTime, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_date, return_value);
dateobj = Z_PHPDATE_P(return_value);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
@@ -2836,15 +2835,15 @@ PHP_METHOD(DateTimeImmutable, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_immutable, return_value);
dateobj = Z_PHPDATE_P(return_value);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object");
}
}
@@ -2862,7 +2861,7 @@ PHP_METHOD(DateTime, __wakeup)
myht = Z_OBJPROP_P(object);
- if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) {
+ if (!php_date_initialize_from_hash(&dateobj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
@@ -2987,7 +2986,7 @@ PHP_FUNCTION(date_parse)
struct timelib_error_container *error;
timelib_time *parsed_time;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &date, &date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &date, &date_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3006,7 +3005,7 @@ PHP_FUNCTION(date_parse_from_format)
struct timelib_error_container *error;
timelib_time *parsed_time;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &format, &format_len, &date, &date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &format, &format_len, &date, &date_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3025,16 +3024,16 @@ PHP_FUNCTION(date_format)
char *format;
size_t format_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
- RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime TSRMLS_CC));
+ RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime));
}
/* }}} */
-static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */
+static int php_date_modify(zval *object, char *modify, size_t modify_len) /* {{{ */
{
php_date_obj *dateobj;
timelib_time *tmp_time;
@@ -3043,17 +3042,17 @@ static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_
dateobj = Z_PHPDATE_P(object);
if (!(dateobj->time)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The DateTime object has not been correctly initialized by its constructor");
+ php_error_docref(NULL, E_WARNING, "The DateTime object has not been correctly initialized by its constructor");
return 0;
}
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
/* update last errors and warnings */
- update_errors_warnings(err TSRMLS_CC);
+ update_errors_warnings(err);
if (err && err->error_count) {
/* spit out the first library error message, at least */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify,
+ php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify,
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
timelib_time_dtor(tmp_time);
return 0;
@@ -3105,11 +3104,11 @@ PHP_FUNCTION(date_modify)
char *modify;
size_t modify_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_date_modify(object, modify, modify_len TSRMLS_CC)) {
+ if (php_date_modify(object, modify, modify_len)) {
RETURN_ZVAL(object, 1, 0);
}
@@ -3125,12 +3124,12 @@ PHP_METHOD(DateTimeImmutable, modify)
char *modify;
size_t modify_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- if (php_date_modify(&new_object, modify, modify_len TSRMLS_CC)) {
+ date_clone_immutable(object, &new_object);
+ if (php_date_modify(&new_object, modify, modify_len)) {
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3138,7 +3137,7 @@ PHP_METHOD(DateTimeImmutable, modify)
}
/* }}} */
-static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_add(zval *object, zval *interval, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_interval_obj *intobj;
@@ -3161,11 +3160,11 @@ PHP_FUNCTION(date_add)
{
zval *object, *interval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- php_date_add(object, interval, return_value TSRMLS_CC);
+ php_date_add(object, interval, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3177,18 +3176,18 @@ PHP_METHOD(DateTimeImmutable, add)
{
zval *object, *interval, new_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_add(&new_object, interval, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_add(&new_object, interval, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_sub(zval *object, zval *interval, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_interval_obj *intobj;
@@ -3200,7 +3199,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
if (intobj->diff->have_special_relative) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only non-special relative time specifications are supported for subtraction");
+ php_error_docref(NULL, E_WARNING, "Only non-special relative time specifications are supported for subtraction");
return;
}
@@ -3216,11 +3215,11 @@ PHP_FUNCTION(date_sub)
{
zval *object, *interval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- php_date_sub(object, interval, return_value TSRMLS_CC);
+ php_date_sub(object, interval, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3232,12 +3231,12 @@ PHP_METHOD(DateTimeImmutable, sub)
{
zval *object, *interval, new_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_sub(&new_object, interval, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_sub(&new_object, interval, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3272,13 +3271,13 @@ PHP_FUNCTION(date_timezone_get)
php_date_obj *dateobj;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
if (dateobj->time->is_localtime/* && dateobj->time->tz_info*/) {
- php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
set_timezone_from_timelib_time(tzobj, dateobj->time);
} else {
@@ -3287,7 +3286,7 @@ PHP_FUNCTION(date_timezone_get)
}
/* }}} */
-static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
php_timezone_obj *tzobj;
@@ -3318,11 +3317,11 @@ PHP_FUNCTION(date_timezone_set)
zval *object;
zval *timezone_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- php_date_timezone_set(object, timezone_object, return_value TSRMLS_CC);
+ php_date_timezone_set(object, timezone_object, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3335,12 +3334,12 @@ PHP_METHOD(DateTimeImmutable, setTimezone)
zval *object, new_object;
zval *timezone_object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_timezone_set(&new_object, timezone_object, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_timezone_set(&new_object, timezone_object, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3355,7 +3354,7 @@ PHP_FUNCTION(date_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3381,7 +3380,7 @@ PHP_FUNCTION(date_offset_get)
}
/* }}} */
-static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3401,11 +3400,11 @@ PHP_FUNCTION(date_time_set)
zval *object;
zend_long h, i, s = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) {
RETURN_FALSE;
}
- php_date_time_set(object, h, i, s, return_value TSRMLS_CC);
+ php_date_time_set(object, h, i, s, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3418,18 +3417,18 @@ PHP_METHOD(DateTimeImmutable, setTime)
zval *object, new_object;
zend_long h, i, s = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_time_set(&new_object, h, i, s, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_time_set(&new_object, h, i, s, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3449,11 +3448,11 @@ PHP_FUNCTION(date_date_set)
zval *object;
zend_long y, m, d;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) {
RETURN_FALSE;
}
- php_date_date_set(object, y, m, d, return_value TSRMLS_CC);
+ php_date_date_set(object, y, m, d, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3466,18 +3465,18 @@ PHP_METHOD(DateTimeImmutable, setDate)
zval *object, new_object;
zend_long y, m, d;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_date_set(&new_object, y, m, d, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_date_set(&new_object, y, m, d, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3501,11 +3500,11 @@ PHP_FUNCTION(date_isodate_set)
zval *object;
zend_long y, w, d = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) {
RETURN_FALSE;
}
- php_date_isodate_set(object, y, w, d, return_value TSRMLS_CC);
+ php_date_isodate_set(object, y, w, d, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3518,18 +3517,18 @@ PHP_METHOD(DateTimeImmutable, setISODate)
zval *object, new_object;
zend_long y, w, d = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_isodate_set(&new_object, y, w, d, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_isodate_set(&new_object, y, w, d, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
/* }}} */
-static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value TSRMLS_DC) /* {{{ */
+static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value) /* {{{ */
{
php_date_obj *dateobj;
@@ -3547,11 +3546,11 @@ PHP_FUNCTION(date_timestamp_set)
zval *object;
zend_long timestamp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_date, &timestamp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_date, &timestamp) == FAILURE) {
RETURN_FALSE;
}
- php_date_timestamp_set(object, timestamp, return_value TSRMLS_CC);
+ php_date_timestamp_set(object, timestamp, return_value);
RETURN_ZVAL(object, 1, 0);
}
@@ -3564,12 +3563,12 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
zval *object, new_object;
zend_long timestamp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_immutable, &timestamp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_immutable, &timestamp) == FAILURE) {
RETURN_FALSE;
}
- date_clone_immutable(object, &new_object TSRMLS_CC);
- php_date_timestamp_set(&new_object, timestamp, return_value TSRMLS_CC);
+ date_clone_immutable(object, &new_object);
+ php_date_timestamp_set(&new_object, timestamp, return_value);
RETURN_ZVAL(&new_object, 0, 1);
}
@@ -3585,7 +3584,7 @@ PHP_FUNCTION(date_timestamp_get)
zend_long timestamp;
int error;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3611,7 +3610,7 @@ PHP_FUNCTION(date_diff)
php_interval_obj *interval;
zend_long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = Z_PHPDATE_P(object1);
@@ -3621,7 +3620,7 @@ PHP_FUNCTION(date_diff)
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
interval = Z_PHPINTERVAL_P(return_value);
interval->diff = timelib_diff(dateobj1->time, dateobj2->time);
if (absolute) {
@@ -3631,7 +3630,7 @@ PHP_FUNCTION(date_diff)
}
/* }}} */
-static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRMLS_DC) /* {{{ */
+static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz) /* {{{ */
{
timelib_time *dummy_t = ecalloc(1, sizeof(timelib_time));
int dst, not_found;
@@ -3639,7 +3638,7 @@ static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRML
dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, &not_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
if (not_found) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
efree(dummy_t);
return FAILURE;
} else {
@@ -3659,11 +3658,11 @@ PHP_FUNCTION(timezone_open)
size_t tz_len;
php_timezone_obj *tzobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len) == FAILURE) {
RETURN_FALSE;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC));
- if (SUCCESS != timezone_initialize(tzobj, tz TSRMLS_CC)) {
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value));
+ if (SUCCESS != timezone_initialize(tzobj, tz)) {
RETURN_FALSE;
}
}
@@ -3679,18 +3678,18 @@ PHP_METHOD(DateTimeZone, __construct)
php_timezone_obj *tzobj;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len)) {
tzobj = Z_PHPTIMEZONE_P(getThis());
- if (FAILURE == timezone_initialize(tzobj, tz TSRMLS_CC)) {
+ if (FAILURE == timezone_initialize(tzobj, tz)) {
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
-static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht) /* {{{ */
{
zval *z_timezone;
zval *z_timezone_type;
@@ -3698,7 +3697,7 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
if ((z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1)) != NULL) {
if ((z_timezone = zend_hash_str_find(myht, "timezone", sizeof("timezone")-1)) != NULL) {
convert_to_long(z_timezone_type);
- if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone) TSRMLS_CC)) {
+ if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone))) {
return SUCCESS;
}
}
@@ -3714,15 +3713,15 @@ PHP_METHOD(DateTimeZone, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_timezone, return_value);
tzobj = Z_PHPTIMEZONE_P(return_value);
- php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
+ php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht);
}
/* }}} */
@@ -3738,7 +3737,7 @@ PHP_METHOD(DateTimeZone, __wakeup)
myht = Z_OBJPROP_P(object);
- php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
+ php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht);
}
/* }}} */
@@ -3750,7 +3749,7 @@ PHP_FUNCTION(timezone_name_get)
zval *object;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3790,7 +3789,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
zend_long gmtoffset = -1;
zend_long isdst = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) {
RETURN_FALSE;
}
tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst);
@@ -3813,7 +3812,7 @@ PHP_FUNCTION(timezone_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3847,7 +3846,7 @@ PHP_FUNCTION(timezone_transitions_get)
unsigned int i, begin = 0, found;
zend_long timestamp_begin = ZEND_LONG_MIN, timestamp_end = ZEND_LONG_MAX;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ll", &object, date_ce_timezone, &timestamp_begin, &timestamp_end) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ll", &object, date_ce_timezone, &timestamp_begin, &timestamp_end) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3859,7 +3858,7 @@ PHP_FUNCTION(timezone_transitions_get)
#define add_nominal() \
array_init(&element); \
add_assoc_long(&element, "ts", timestamp_begin); \
- add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC)); \
+ add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0)); \
add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \
add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \
add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx]); \
@@ -3868,7 +3867,7 @@ PHP_FUNCTION(timezone_transitions_get)
#define add(i,ts) \
array_init(&element); \
add_assoc_long(&element, "ts", ts); \
- add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC)); \
+ add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0)); \
add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \
add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \
add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx]); \
@@ -3925,7 +3924,7 @@ PHP_FUNCTION(timezone_location_get)
zval *object;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
@@ -3942,7 +3941,7 @@ PHP_FUNCTION(timezone_location_get)
}
/* }}} */
-static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
+static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
@@ -3953,7 +3952,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
if (errors->error_count > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format);
retval = FAILURE;
} else {
if(p) {
@@ -3966,7 +3965,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
*rt = timelib_diff(b, e);
retval = SUCCESS;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse interval (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Failed to parse interval (%s)", format);
retval = FAILURE;
}
}
@@ -3976,7 +3975,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma
} /* }}} */
/* {{{ date_interval_read_property */
-zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
php_interval_obj *obj;
zval *retval;
@@ -3994,7 +3993,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
obj = Z_PHPINTERVAL_P(object);
if (!obj->initialized) {
- retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv);
if (member == &tmp_member) {
zval_dtor(member);
}
@@ -4016,7 +4015,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
GET_VALUE_FROM_STRUCT(invert, "invert");
GET_VALUE_FROM_STRUCT(days, "days");
/* didn't find any */
- retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv);
if (member == &tmp_member) {
zval_dtor(member);
@@ -4042,7 +4041,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c
/* }}} */
/* {{{ date_interval_write_property */
-void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
php_interval_obj *obj;
zval tmp_member;
@@ -4058,7 +4057,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
obj = Z_PHPINTERVAL_P(object);
if (!obj->initialized) {
- (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC);
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
if (member == &tmp_member) {
zval_dtor(member);
}
@@ -4080,7 +4079,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
SET_VALUE_FROM_STRUCT(s, "s");
SET_VALUE_FROM_STRUCT(invert, "invert");
/* didn't find any */
- (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC);
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
} while(0);
if (member == &tmp_member) {
@@ -4101,9 +4100,9 @@ PHP_METHOD(DateInterval, __construct)
timelib_rel_time *reltime;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &interval_string, &interval_string_length) == SUCCESS) {
- if (date_interval_initialize(&reltime, interval_string, interval_string_length TSRMLS_CC) == SUCCESS) {
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &interval_string, &interval_string_length) == SUCCESS) {
+ if (date_interval_initialize(&reltime, interval_string, interval_string_length) == SUCCESS) {
diobj = Z_PHPINTERVAL_P(getThis());
diobj->diff = reltime;
diobj->initialized = 1;
@@ -4111,12 +4110,12 @@ PHP_METHOD(DateInterval, __construct)
ZEND_CTOR_MAKE_NULL();
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
-static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht) /* {{{ */
{
(*intobj)->diff = timelib_rel_time_ctor();
@@ -4170,15 +4169,15 @@ PHP_METHOD(DateInterval, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
intobj = Z_PHPINTERVAL_P(return_value);
- php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
+ php_date_interval_initialize_from_hash(&return_value, &intobj, myht);
}
/* }}} */
@@ -4194,7 +4193,7 @@ PHP_METHOD(DateInterval, __wakeup)
myht = Z_OBJPROP_P(object);
- php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
+ php_date_interval_initialize_from_hash(&return_value, &intobj, myht);
}
/* }}} */
@@ -4209,11 +4208,11 @@ PHP_FUNCTION(date_interval_create_from_date_string)
timelib_error_container *err = NULL;
php_interval_obj *diobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &time_str, &time_str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &time_str, &time_str_len) == FAILURE) {
RETURN_FALSE;
}
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
diobj = Z_PHPINTERVAL_P(return_value);
@@ -4225,7 +4224,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
/* }}} */
/* {{{ date_interval_format - */
-static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC)
+static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t)
{
smart_str string = {0};
int i, length, have_format_spec = 0;
@@ -4296,17 +4295,17 @@ PHP_FUNCTION(date_interval_format)
char *format;
size_t format_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) {
RETURN_FALSE;
}
diobj = Z_PHPINTERVAL_P(object);
DATE_CHECK_INITIALIZED(diobj->initialized, DateInterval);
- RETURN_STR(date_interval_format(format, format_len, diobj->diff TSRMLS_CC));
+ RETURN_STR(date_interval_format(format, format_len, diobj->diff));
}
/* }}} */
-static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
+static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
@@ -4317,7 +4316,7 @@ static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_
timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors);
if (errors->error_count > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format);
+ php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format);
retval = FAILURE;
} else {
*st = b;
@@ -4345,12 +4344,12 @@ PHP_METHOD(DatePeriod, __construct)
timelib_time *clone;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|l", &isostr, &isostr_len, &options) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
+ zend_restore_error_handling(&error_handling);
return;
}
}
@@ -4360,15 +4359,15 @@ PHP_METHOD(DatePeriod, __construct)
dpobj->current = NULL;
if (isostr) {
- date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len TSRMLS_CC);
+ date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len);
if (dpobj->start == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr);
}
if (dpobj->interval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr);
}
if (dpobj->end == NULL && recurrences == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr);
+ php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr);
}
if (dpobj->start) {
@@ -4414,7 +4413,7 @@ PHP_METHOD(DatePeriod, __construct)
dpobj->initialized = 1;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -4432,7 +4431,7 @@ PHP_METHOD(DatePeriod, getStartDate)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
+ php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->start;
@@ -4459,7 +4458,7 @@ PHP_METHOD(DatePeriod, getEndDate)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
+ php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end;
@@ -4486,7 +4485,7 @@ PHP_METHOD(DatePeriod, getDateInterval)
dpobj = Z_PHPPERIOD_P(getThis());
- php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
+ php_date_instantiate(date_ce_interval, return_value);
diobj = Z_PHPINTERVAL_P(return_value);
diobj->diff = timelib_rel_time_clone(dpobj->interval);
diobj->initialized = 1;
@@ -4521,13 +4520,13 @@ PHP_FUNCTION(timezone_identifiers_list)
char *option = NULL;
size_t option_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &what, &option, &option_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls", &what, &option, &option_len) == FAILURE) {
RETURN_FALSE;
}
/* Extra validation */
if (what == PHP_DATE_TIMEZONE_PER_COUNTRY && option_len != 2) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected");
+ php_error_docref(NULL, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected");
RETURN_FALSE;
}
@@ -4603,11 +4602,11 @@ PHP_FUNCTION(date_default_timezone_set)
char *zone;
size_t zone_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &zone, &zone_len) == FAILURE) {
RETURN_FALSE;
}
if (!timelib_timezone_id_is_valid(zone, DATE_TIMEZONEDB)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone ID '%s' is invalid", zone);
+ php_error_docref(NULL, E_NOTICE, "Timezone ID '%s' is invalid", zone);
RETURN_FALSE;
}
if (DATEG(timezone)) {
@@ -4625,7 +4624,7 @@ PHP_FUNCTION(date_default_timezone_get)
{
timelib_tzinfo *default_tz;
- default_tz = get_timezone_info(TSRMLS_C);
+ default_tz = get_timezone_info();
RETVAL_STRING(default_tz->name);
}
/* }}} */
@@ -4644,7 +4643,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
timelib_tzinfo *tzi;
zend_string *retstr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
RETURN_FALSE;
}
@@ -4665,7 +4664,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
case 6:
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid format");
+ php_error_docref(NULL, E_WARNING, "invalid format");
RETURN_FALSE;
break;
}
@@ -4673,14 +4672,14 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
retformat != SUNFUNCS_RET_STRING &&
retformat != SUNFUNCS_RET_DOUBLE)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE");
+ php_error_docref(NULL, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE");
RETURN_FALSE;
}
altitude = 90 - zenith;
/* Initialize time struct */
t = timelib_time_ctor();
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
@@ -4746,12 +4745,12 @@ PHP_FUNCTION(date_sun_info)
int dummy;
double ddummy;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time, &latitude, &longitude) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ldd", &time, &latitude, &longitude) == FAILURE) {
RETURN_FALSE;
}
/* Initialize time struct */
t = timelib_time_ctor();
- tzi = get_timezone_info(TSRMLS_C);
+ tzi = get_timezone_info();
t->tz_info = tzi;
t->zone_type = TIMELIB_ZONETYPE_ID;
timelib_unixtime2local(t, time);
@@ -4838,14 +4837,14 @@ PHP_FUNCTION(date_sun_info)
}
/* }}} */
-static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n) /* {{{ */
{
*table = NULL;
*n = 0;
- return zend_std_get_properties(object TSRMLS_CC);
+ return zend_std_get_properties(object);
} /* }}} */
-static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
{
HashTable *props;
zval zv;
@@ -4853,7 +4852,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {
period_obj = Z_PHPPERIOD_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (!period_obj->start || GC_G(gc_active)) {
return props;
@@ -4910,7 +4909,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {
return props;
} /* }}} */
-static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC) /* {{{ */
+static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht) /* {{{ */
{
zval *ht_entry;
@@ -4998,7 +4997,7 @@ PHP_METHOD(DatePeriod, __set_state)
zval *array;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
RETURN_FALSE;
}
@@ -5006,7 +5005,7 @@ PHP_METHOD(DatePeriod, __set_state)
object_init_ex(return_value, date_ce_period);
period_obj = Z_PHPPERIOD_P(return_value);
- if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ if (!php_date_period_initialize_from_hash(period_obj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
@@ -5024,26 +5023,26 @@ PHP_METHOD(DatePeriod, __wakeup)
myht = Z_OBJPROP_P(object);
- if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ if (!php_date_period_initialize_from_hash(period_obj, myht)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ date_period_read_property */
-static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
+ php_error_docref(NULL, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
}
Z_OBJPROP_P(object); /* build properties hash table */
- zv = std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ zv = std_object_handlers.read_property(object, member, type, cache_slot, rv);
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
/* defensive copy */
- ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC));
+ ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv));
}
return zv;
@@ -5051,9 +5050,9 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
/* }}} */
/* {{{ date_period_write_property */
-static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
+ php_error_docref(NULL, E_ERROR, "Writing to DatePeriod properties is unsupported");
}
/* }}} */
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 667a552218..9c3b0c9322 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -208,24 +208,24 @@ ZEND_END_MODULE_GLOBALS(date)
/* Backwards compatibility wrapper */
PHPAPI zend_long php_parse_date(char *string, zend_long *now);
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt);
-PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
+PHPAPI int php_idate(char format, time_t ts, int localtime);
#if HAVE_STRFTIME
#define _php_strftime php_strftime
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#endif
-PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC);
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime);
/* Mechanism to set new TZ database */
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
-PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
+PHPAPI timelib_tzinfo *get_timezone_info(void);
/* Grabbing CE's so that other exts can use the date objects too */
PHPAPI zend_class_entry *php_date_get_date_ce(void);
PHPAPI zend_class_entry *php_date_get_timezone_ce(void);
/* Functions for creating DateTime objects, and initializing them from a string */
-PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
-PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC);
+PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object);
+PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor);
#endif /* PHP_DATE_H */
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index de4ea4c464..2ca9092e65 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -200,7 +200,7 @@ ZEND_GET_MODULE(dba)
/* these are used to get the standard arguments */
/* {{{ php_dba_myke_key */
-static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS_DC)
+static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
{
if (Z_TYPE_P(key) == IS_ARRAY) {
zval *group, *name;
@@ -208,7 +208,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
size_t len;
if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
return -1;
}
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos);
@@ -245,10 +245,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
zval *key; \
char *key_str, *key_free; \
size_t key_len; \
- if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \
return; \
} \
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\
RETURN_FALSE; \
}
@@ -259,19 +259,19 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
zend_long skip = 0; \
switch(ac) { \
case 2: \
- if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \
return; \
} \
break; \
case 3: \
- if (zend_parse_parameters(ac TSRMLS_CC, "zlr", &key, &skip, &id) == FAILURE) { \
+ if (zend_parse_parameters(ac, "zlr", &key, &skip, &id) == FAILURE) { \
return; \
} \
break; \
default: \
WRONG_PARAM_COUNT; \
} \
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\
RETURN_FALSE; \
}
@@ -298,14 +298,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
/* check whether the user has write access */
#define DBA_WRITE_CHECK \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
+ php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \
RETURN_FALSE; \
}
/* the same check, but with a call to DBA_ID_DONE before returning */
#define DBA_WRITE_CHECK_WITH_ID \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
+ php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \
DBA_ID_DONE; \
RETURN_FALSE; \
}
@@ -387,7 +387,7 @@ static int le_pdb;
/* }}} */
/* {{{ dba_fetch_resource
-PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id TSRMLS_DC)
+PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id)
{
dba_info *info;
DBA_ID_FETCH
@@ -408,10 +408,10 @@ PHPAPI dba_handler *dba_get_handler(const char* handler_name)
/* {{{ dba_close
*/
-static void dba_close(dba_info *info TSRMLS_DC)
+static void dba_close(dba_info *info)
{
if (info->hnd) {
- info->hnd->close(info TSRMLS_CC);
+ info->hnd->close(info);
}
if (info->path) {
pefree(info->path, info->flags&DBA_PERSISTENT);
@@ -439,28 +439,28 @@ static void dba_close(dba_info *info TSRMLS_DC)
/* {{{ dba_close_rsrc
*/
-static void dba_close_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void dba_close_rsrc(zend_resource *rsrc)
{
dba_info *info = (dba_info *)rsrc->ptr;
- dba_close(info TSRMLS_CC);
+ dba_close(info);
}
/* }}} */
/* {{{ dba_close_pe_rsrc_deleter */
-int dba_close_pe_rsrc_deleter(zval *el, void *pDba TSRMLS_DC)
+int dba_close_pe_rsrc_deleter(zval *el, void *pDba)
{
return ((zend_resource *)Z_PTR_P(el))->ptr == pDba ? ZEND_HASH_APPLY_REMOVE: ZEND_HASH_APPLY_KEEP;
}
/* }}} */
/* {{{ dba_close_pe_rsrc */
-static void dba_close_pe_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void dba_close_pe_rsrc(zend_resource *rsrc)
{
dba_info *info = (dba_info *)rsrc->ptr;
/* closes the resource by calling dba_close_rsrc() */
- zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info);
}
/* }}} */
@@ -472,17 +472,17 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
if (!new_value->len) {
DBA_G(default_hptr) = NULL;
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++);
if (!hptr->name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value->val);
+ php_error_docref(NULL, E_WARNING, "No such handler: %s", new_value->val);
return FAILURE;
}
DBA_G(default_hptr) = hptr;
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
PHP_INI_BEGIN()
@@ -560,11 +560,11 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
char *key_str, *key_free;
size_t key_len;
- if (zend_parse_parameters(ac TSRMLS_CC, "zsr", &key, &val, &val_len, &id) == FAILURE) {
+ if (zend_parse_parameters(ac, "zsr", &key, &val, &val_len, &id) == FAILURE) {
return;
}
- if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {
+ if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {
RETURN_FALSE;
}
@@ -572,7 +572,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
DBA_WRITE_CHECK_WITH_ID;
- if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->update(info, key_str, key_len, val, val_len, mode) == SUCCESS) {
DBA_ID_DONE;
RETURN_TRUE;
}
@@ -586,7 +586,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
/* {{{ php_find_dbm
*/
-dba_info *php_dba_find(const char* path TSRMLS_DC)
+dba_info *php_dba_find(const char* path)
{
zend_resource *le;
dba_info *info;
@@ -681,7 +681,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ac==2) {
hptr = DBA_G(default_hptr);
if (!hptr) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected");
FREENOW;
RETURN_FALSE;
}
@@ -690,7 +690,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (!hptr->name) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2]));
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2]));
FREENOW;
RETURN_FALSE;
}
@@ -721,13 +721,13 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
case 'l':
lock_flag = DBA_LOCK_ALL;
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name);
}
break;
default:
case '-':
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name);
FREENOW;
RETURN_FALSE;
}
@@ -776,7 +776,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
file_mode = "w+b";
break;
default:
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
FREENOW;
RETURN_FALSE;
}
@@ -789,17 +789,17 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (*pmode=='t') {
pmode++;
if (!lock_flag) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)");
FREENOW;
RETURN_FALSE;
}
if (!lock_mode) {
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name);
FREENOW;
RETURN_FALSE;
} else {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name);
FREENOW;
RETURN_FALSE;
}
@@ -808,7 +808,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (*pmode) {
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode");
FREENOW;
RETURN_FALSE;
}
@@ -827,7 +827,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* the problem is some systems would allow read during write
*/
if (hptr->flags & DBA_LOCK_ALL) {
- if ((other = php_dba_find(info->path TSRMLS_CC)) != NULL) {
+ if ((other = php_dba_find(info->path)) != NULL) {
if ( ( (lock_mode&LOCK_EX) && (other->lock.mode&(LOCK_EX|LOCK_SH)) )
|| ( (other->lock.mode&LOCK_EX) && (lock_mode&(LOCK_EX|LOCK_SH)) )
) {
@@ -882,7 +882,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(lock_name);
}
if (!info->lock.fp) {
- dba_close(info TSRMLS_CC);
+ dba_close(info);
/* stream operation already wrote an error message */
FREENOW;
RETURN_FALSE;
@@ -903,7 +903,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|persistent_flag, NULL);
}
if (!info->fp) {
- dba_close(info TSRMLS_CC);
+ dba_close(info);
/* stream operation already wrote an error message */
FREENOW;
RETURN_FALSE;
@@ -913,8 +913,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* file contents with O_APPEND being set.
*/
if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream");
- dba_close(info TSRMLS_CC);
+ php_error_docref(NULL, E_WARNING, "Could not cast stream");
+ dba_close(info);
FREENOW;
RETURN_FALSE;
#ifdef F_SETFL
@@ -927,9 +927,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
- if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {
- dba_close(info TSRMLS_CC);
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
+ if (error || hptr->open(info, &error) != SUCCESS) {
+ dba_close(info);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
FREENOW;
RETURN_FALSE;
}
@@ -944,8 +944,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
new_le.type = le_pdb;
new_le.ptr = info;
if (zend_hash_str_update_mem(&EG(persistent_list), key, keylen, &new_le, sizeof(zend_resource)) == NULL) {
- dba_close(info TSRMLS_CC);
- php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource");
+ dba_close(info);
+ php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource");
FREENOW;
RETURN_FALSE;
}
@@ -980,7 +980,7 @@ PHP_FUNCTION(dba_close)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
@@ -996,7 +996,7 @@ PHP_FUNCTION(dba_exists)
{
DBA_ID_GET2;
- if(info->hnd->exists(info, key_str, key_len TSRMLS_CC) == SUCCESS) {
+ if(info->hnd->exists(info, key_str, key_len) == SUCCESS) {
DBA_ID_DONE;
RETURN_TRUE;
}
@@ -1016,7 +1016,7 @@ PHP_FUNCTION(dba_fetch)
if (ac==3) {
if (!strcmp(info->hnd->name, "cdb")) {
if (skip < 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name);
skip = 0;
}
} else if (!strcmp(info->hnd->name, "inifile")) {
@@ -1027,17 +1027,17 @@ PHP_FUNCTION(dba_fetch)
* value to 0 ensures the first value.
*/
if (skip < -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name);
skip = 0;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name);
+ php_error_docref(NULL, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name);
skip = 0;
}
} else {
skip = 0;
}
- if((val = info->hnd->fetch(info, key_str, key_len, skip, &len TSRMLS_CC)) != NULL) {
+ if((val = info->hnd->fetch(info, key_str, key_len, skip, &len)) != NULL) {
DBA_ID_DONE;
RETVAL_STRINGL(val, len);
efree(val);
@@ -1059,12 +1059,12 @@ PHP_FUNCTION(dba_key_split)
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &zkey) == SUCCESS) {
if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_FALSE)) {
RETURN_BOOL(0);
}
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &key, &key_len) == FAILURE) {
RETURN_BOOL(0);
}
array_init(return_value);
@@ -1087,13 +1087,13 @@ PHP_FUNCTION(dba_firstkey)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- fkey = info->hnd->firstkey(info, &len TSRMLS_CC);
+ fkey = info->hnd->firstkey(info, &len);
if (fkey) {
RETVAL_STRINGL(fkey, len);
@@ -1114,13 +1114,13 @@ PHP_FUNCTION(dba_nextkey)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- nkey = info->hnd->nextkey(info, &len TSRMLS_CC);
+ nkey = info->hnd->nextkey(info, &len);
if (nkey) {
RETVAL_STRINGL(nkey, len);
@@ -1141,7 +1141,7 @@ PHP_FUNCTION(dba_delete)
DBA_WRITE_CHECK_WITH_ID;
- if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS)
+ if(info->hnd->delete(info, key_str, key_len) == SUCCESS)
{
DBA_ID_DONE;
RETURN_TRUE;
@@ -1176,7 +1176,7 @@ PHP_FUNCTION(dba_optimize)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
@@ -1184,7 +1184,7 @@ PHP_FUNCTION(dba_optimize)
DBA_WRITE_CHECK;
- if (info->hnd->optimize(info TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->optimize(info) == SUCCESS) {
RETURN_TRUE;
}
@@ -1199,13 +1199,13 @@ PHP_FUNCTION(dba_sync)
zval *id;
dba_info *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) {
return;
}
DBA_FETCH_RESOURCE(info, id);
- if (info->hnd->sync(info TSRMLS_CC) == SUCCESS) {
+ if (info->hnd->sync(info) == SUCCESS) {
RETURN_TRUE;
}
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(dba_handlers)
dba_handler *hptr;
zend_bool full_info = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) {
RETURN_FALSE;
}
@@ -1229,7 +1229,7 @@ PHP_FUNCTION(dba_handlers)
for(hptr = handler; hptr->name; hptr++) {
if (full_info) {
// TODO: avoid reallocation ???
- char *str = hptr->info(hptr, NULL TSRMLS_CC);
+ char *str = hptr->info(hptr, NULL);
add_assoc_string(return_value, hptr->name, str);
efree(str);
} else {
diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c
index 17419dcf2e..deab119861 100644
--- a/ext/dba/dba_cdb.c
+++ b/ext/dba/dba_cdb.c
@@ -104,9 +104,9 @@ DBA_OPEN_FUNC(cdb)
#if DBA_CDB_BUILTIN
if (make) {
- cdb_make_start(&cdb->m, file TSRMLS_CC);
+ cdb_make_start(&cdb->m, file);
} else {
- cdb_init(&cdb->c, file TSRMLS_CC);
+ cdb_init(&cdb->c, file);
}
cdb->make = make;
#else
@@ -125,9 +125,9 @@ DBA_CLOSE_FUNC(cdb)
/* cdb_free does not close associated file */
#if DBA_CDB_BUILTIN
if (cdb->make) {
- cdb_make_finish(&cdb->m TSRMLS_CC);
+ cdb_make_finish(&cdb->m);
} else {
- cdb_free(&cdb->c TSRMLS_CC);
+ cdb_free(&cdb->c);
}
#else
cdb_free(&cdb->c);
@@ -137,9 +137,9 @@ DBA_CLOSE_FUNC(cdb)
}
#if DBA_CDB_BUILTIN
-# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos TSRMLS_CC)
-# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len TSRMLS_CC)
-# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len TSRMLS_CC)
+# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
+# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
+# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len)
#else
# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos)
# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len)
@@ -186,7 +186,7 @@ DBA_UPDATE_FUNC(cdb)
return FAILURE; /* database was opened readonly */
if (!mode)
return FAILURE; /* cdb_make dosn't know replace */
- if (cdb_make_add(&cdb->m, key, keylen, val, vallen TSRMLS_CC) != -1)
+ if (cdb_make_add(&cdb->m, key, keylen, val, vallen) != -1)
return SUCCESS;
#endif
return FAILURE;
@@ -225,12 +225,12 @@ DBA_DELETE_FUNC(cdb)
/* {{{ cdb_file_lseek
php_stream_seek does not return actual position */
#if DBA_CDB_BUILTIN
-int cdb_file_lseek(php_stream *fp, off_t offset, int whence TSRMLS_DC) {
+int cdb_file_lseek(php_stream *fp, off_t offset, int whence) {
php_stream_seek(fp, offset, whence);
return php_stream_tell(fp);
}
#else
-int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) {
+int cdb_file_lseek(int fd, off_t offset, int whence) {
return lseek(fd, offset, whence);
}
#endif
@@ -238,7 +238,7 @@ int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) {
#define CSEEK(n) do { \
if (n >= cdb->eod) return NULL; \
- if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET TSRMLS_CC) != (off_t) n) return NULL; \
+ if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET) != (off_t) n) return NULL; \
} while (0)
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index 6643eebcde..bde08427ee 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -164,7 +164,7 @@ DBA_FIRSTKEY_FUNC(db2)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db2(info, newlen TSRMLS_CC);
+ return dba_nextkey_db2(info, newlen);
}
DBA_NEXTKEY_FUNC(db2)
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 3f31222d9e..5e8f1da4ad 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -37,9 +37,8 @@
static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg)
{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
+ php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
}
#define DB3_DATA dba_db3_data *dba = info->dbf
@@ -187,7 +186,7 @@ DBA_FIRSTKEY_FUNC(db3)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db3(info, newlen TSRMLS_CC);
+ return dba_nextkey_db3(info, newlen);
}
DBA_NEXTKEY_FUNC(db3)
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c
index a9752a7bf6..393c565b2a 100644
--- a/ext/dba/dba_db4.c
+++ b/ext/dba/dba_db4.c
@@ -42,13 +42,12 @@ static void php_dba_db4_errcall_fcn(
#endif
const char *errpfx, const char *msg)
{
- TSRMLS_FETCH();
#if (DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8))
/* Bug 51086, Berkeley DB 4.8.26 */
/* This code suppresses a BDB 4.8+ error message, thus keeping PHP test compatibility */
{
- const char *function = get_active_function_name(TSRMLS_C);
+ const char *function = get_active_function_name();
if (function && (!strcmp(function,"dba_popen") || !strcmp(function,"dba_open"))
&& (!strncmp(msg, "fop_read_meta", sizeof("fop_read_meta")-1)
|| !strncmp(msg, "BDB0004 fop_read_meta", sizeof("BDB0004 fop_read_meta")-1))) {
@@ -57,7 +56,7 @@ static void php_dba_db4_errcall_fcn(
}
#endif
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
+ php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
}
#define DB4_DATA dba_db4_data *dba = info->dbf
@@ -239,7 +238,7 @@ DBA_FIRSTKEY_FUNC(db4)
}
/* we should introduce something like PARAM_PASSTHRU... */
- return dba_nextkey_db4(info, newlen TSRMLS_CC);
+ return dba_nextkey_db4(info, newlen);
}
DBA_NEXTKEY_FUNC(db4)
diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c
index b369f11c70..47a2e5a2af 100644
--- a/ext/dba/dba_dbm.c
+++ b/ext/dba/dba_dbm.c
@@ -195,7 +195,7 @@ DBA_INFO_FUNC(dbm)
#if DBA_GDBM
if (!strcmp(DBM_VERSION, "GDBM"))
{
- return dba_info_gdbm(hnd, info TSRMLS_CC);
+ return dba_info_gdbm(hnd, info);
}
#endif
return estrdup(DBM_VERSION);
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index 9be6e9be18..49f39cf2a8 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -67,7 +67,7 @@ DBA_FETCH_FUNC(flatfile)
FLATFILE_DATA;
FLATFILE_GKEY;
- gval = flatfile_fetch(dba, gkey TSRMLS_CC);
+ gval = flatfile_fetch(dba, gkey);
if (gval.dptr) {
if (newlen) {
*newlen = gval.dsize;
@@ -87,16 +87,16 @@ DBA_UPDATE_FUNC(flatfile)
gval.dptr = (char *) val;
gval.dsize = vallen;
- switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) {
+ switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE)) {
case 0:
return SUCCESS;
case 1:
return FAILURE;
case -1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
+ php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
return FAILURE;
default:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
+ php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value");
return FAILURE;
}
}
@@ -107,7 +107,7 @@ DBA_EXISTS_FUNC(flatfile)
FLATFILE_DATA;
FLATFILE_GKEY;
- gval = flatfile_fetch(dba, gkey TSRMLS_CC);
+ gval = flatfile_fetch(dba, gkey);
if (gval.dptr) {
efree(gval.dptr);
return SUCCESS;
@@ -119,7 +119,7 @@ DBA_DELETE_FUNC(flatfile)
{
FLATFILE_DATA;
FLATFILE_GKEY;
- return(flatfile_delete(dba, gkey TSRMLS_CC) == -1 ? FAILURE : SUCCESS);
+ return(flatfile_delete(dba, gkey) == -1 ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(flatfile)
@@ -129,7 +129,7 @@ DBA_FIRSTKEY_FUNC(flatfile)
if (dba->nextkey.dptr) {
efree(dba->nextkey.dptr);
}
- dba->nextkey = flatfile_firstkey(dba TSRMLS_CC);
+ dba->nextkey = flatfile_firstkey(dba);
if (dba->nextkey.dptr) {
if (newlen) {
*newlen = dba->nextkey.dsize;
@@ -150,7 +150,7 @@ DBA_NEXTKEY_FUNC(flatfile)
if (dba->nextkey.dptr) {
efree(dba->nextkey.dptr);
}
- dba->nextkey = flatfile_nextkey(dba TSRMLS_CC);
+ dba->nextkey = flatfile_nextkey(dba);
if (dba->nextkey.dptr) {
if (newlen) {
*newlen = dba->nextkey.dsize;
diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c
index bea2f4cf58..5f2fd1076d 100644
--- a/ext/dba/dba_gdbm.c
+++ b/ext/dba/dba_gdbm.c
@@ -110,10 +110,10 @@ DBA_UPDATE_FUNC(gdbm)
case 1:
return FAILURE;
case -1:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno));
+ php_error_docref2(NULL, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno));
return FAILURE;
default:
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
+ php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value");
return FAILURE;
}
}
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index aaae690344..333438163c 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -42,7 +42,7 @@
#define INIFILE_GKEY \
key_type ini_key; \
if (!key) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \
+ php_error_docref(NULL, E_WARNING, "No key specified"); \
return 0; \
} \
ini_key = inifile_key_split((char*)key) /* keylen not needed here */
@@ -52,7 +52,7 @@
DBA_OPEN_FUNC(inifile)
{
- info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT TSRMLS_CC);
+ info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT);
return info->dbf ? SUCCESS : FAILURE;
}
@@ -71,7 +71,7 @@ DBA_FETCH_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- ini_val = inifile_fetch(dba, &ini_key, skip TSRMLS_CC);
+ ini_val = inifile_fetch(dba, &ini_key, skip);
*newlen = ini_val.value ? strlen(ini_val.value) : 0;
INIFILE_DONE;
return ini_val.value;
@@ -88,14 +88,14 @@ DBA_UPDATE_FUNC(inifile)
ini_val.value = val;
if (mode == 1) {
- res = inifile_append(dba, &ini_key, &ini_val TSRMLS_CC);
+ res = inifile_append(dba, &ini_key, &ini_val);
} else {
- res = inifile_replace(dba, &ini_key, &ini_val TSRMLS_CC);
+ res = inifile_replace(dba, &ini_key, &ini_val);
}
INIFILE_DONE;
switch(res) {
case -1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
+ php_error_docref1(NULL, key, E_WARNING, "Operation not possible");
return FAILURE;
default:
case 0:
@@ -112,7 +112,7 @@ DBA_EXISTS_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- ini_val = inifile_fetch(dba, &ini_key, 0 TSRMLS_CC);
+ ini_val = inifile_fetch(dba, &ini_key, 0);
INIFILE_DONE;
if (ini_val.value) {
inifile_val_free(&ini_val);
@@ -129,7 +129,7 @@ DBA_DELETE_FUNC(inifile)
INIFILE_DATA;
INIFILE_GKEY;
- res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC);
+ res = inifile_delete_ex(dba, &ini_key, &found);
INIFILE_DONE;
return (res == -1 || !found ? FAILURE : SUCCESS);
@@ -139,7 +139,7 @@ DBA_FIRSTKEY_FUNC(inifile)
{
INIFILE_DATA;
- if (inifile_firstkey(dba TSRMLS_CC)) {
+ if (inifile_firstkey(dba)) {
char *result = inifile_key_string(&dba->curr.key);
*newlen = strlen(result);
return result;
@@ -156,7 +156,7 @@ DBA_NEXTKEY_FUNC(inifile)
return NULL;
}
- if (inifile_nextkey(dba TSRMLS_CC)) {
+ if (inifile_nextkey(dba)) {
char *result = inifile_key_string(&dba->curr.key);
*newlen = strlen(result);
return result;
diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c
index 023e5e9b27..c755cb98eb 100644
--- a/ext/dba/dba_qdbm.c
+++ b/ext/dba/dba_qdbm.c
@@ -102,7 +102,7 @@ DBA_UPDATE_FUNC(qdbm)
}
if (dpecode != DP_EKEEP) {
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode));
+ php_error_docref2(NULL, key, val, E_WARNING, "%s", dperrmsg(dpecode));
}
return FAILURE;
diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c
index 99c10c2f07..e4771eb641 100644
--- a/ext/dba/dba_tcadb.c
+++ b/ext/dba/dba_tcadb.c
@@ -122,7 +122,7 @@ DBA_UPDATE_FUNC(tcadb)
return SUCCESS;
}
- php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Error updating data");
+ php_error_docref2(NULL, key, val, E_WARNING, "Error updating data");
return FAILURE;
}
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index c8caf8b8f2..d6578d017d 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -43,7 +43,7 @@
#endif
/* {{{ cdb_match */
-static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRMLS_DC)
+static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos)
{
char buf[32];
unsigned int n;
@@ -52,7 +52,7 @@ static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRM
n = sizeof(buf);
if (n > len)
n = len;
- if (cdb_read(c, buf, n, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, n, pos) == -1)
return -1;
if (memcmp(buf, key, n))
return 0;
@@ -79,29 +79,29 @@ uint32 cdb_hash(char *buf, unsigned int len)
/* }}} */
/* {{{ cdb_free */
-void cdb_free(struct cdb *c TSRMLS_DC)
+void cdb_free(struct cdb *c)
{
}
/* }}} */
/* {{{ cdb_findstart */
-void cdb_findstart(struct cdb *c TSRMLS_DC)
+void cdb_findstart(struct cdb *c)
{
c->loop = 0;
}
/* }}} */
/* {{{ cdb_init */
-void cdb_init(struct cdb *c, php_stream *fp TSRMLS_DC)
+void cdb_init(struct cdb *c, php_stream *fp)
{
- cdb_free(c TSRMLS_CC);
- cdb_findstart(c TSRMLS_CC);
+ cdb_free(c);
+ cdb_findstart(c);
c->fp = fp;
}
/* }}} */
/* {{{ cdb_read */
-int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
+int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos)
{
if (php_stream_seek(c->fp, pos, SEEK_SET) == -1) {
errno = EPROTO;
@@ -126,7 +126,7 @@ int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
/* }}} */
/* {{{ cdb_findnext */
-int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_findnext(struct cdb *c, char *key, unsigned int len)
{
char buf[8];
uint32 pos;
@@ -134,7 +134,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
if (!c->loop) {
u = cdb_hash(key, len);
- if (cdb_read(c, buf, 8, (u << 3) & 2047 TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, (u << 3) & 2047) == -1)
return -1;
uint32_unpack(buf + 4,&c->hslots);
if (!c->hslots)
@@ -148,7 +148,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
}
while (c->loop < c->hslots) {
- if (cdb_read(c, buf, 8, c->kpos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, c->kpos) == -1)
return -1;
uint32_unpack(buf + 4, &pos);
if (!pos)
@@ -159,11 +159,11 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
c->kpos = c->hpos;
uint32_unpack(buf, &u);
if (u == c->khash) {
- if (cdb_read(c, buf, 8, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, pos) == -1)
return -1;
uint32_unpack(buf, &u);
if (u == len)
- switch(cdb_match(c, key, len, pos + 8 TSRMLS_CC)) {
+ switch(cdb_match(c, key, len, pos + 8)) {
case -1:
return -1;
case 1:
@@ -179,10 +179,10 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
/* }}} */
/* {{{ cdb_find */
-int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_find(struct cdb *c, char *key, unsigned int len)
{
- cdb_findstart(c TSRMLS_CC);
- return cdb_findnext(c, key, len TSRMLS_CC);
+ cdb_findstart(c);
+ return cdb_findnext(c, key, len);
}
/* }}} */
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 4b4a7ff2ff..8c281fe5fe 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -40,14 +40,14 @@ struct cdb {
uint32 cdb_hash(char *, unsigned int);
-void cdb_free(struct cdb * TSRMLS_DC);
-void cdb_init(struct cdb *, php_stream *fp TSRMLS_DC);
+void cdb_free(struct cdb *);
+void cdb_init(struct cdb *, php_stream *fp);
-int cdb_read(struct cdb *, char *, unsigned int, uint32 TSRMLS_DC);
+int cdb_read(struct cdb *, char *, unsigned int, uint32);
-void cdb_findstart(struct cdb * TSRMLS_DC);
-int cdb_findnext(struct cdb *, char *, unsigned int TSRMLS_DC);
-int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC);
+void cdb_findstart(struct cdb *);
+int cdb_findnext(struct cdb *, char *, unsigned int);
+int cdb_find(struct cdb *, char *, unsigned int);
#define cdb_datapos(c) ((c)->dpos)
#define cdb_datalen(c) ((c)->dlen)
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index b6236f085e..3be1157769 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -38,7 +38,7 @@
#include "uint32.h"
/* {{{ cdb_make_write */
-static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz TSRMLS_DC) {
+static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz) {
return php_stream_write(c->fp, buf, sz) == sz ? 0 : -1;
}
@@ -56,7 +56,7 @@ static int cdb_posplus(struct cdb_make *c, uint32 len)
/* }}} */
/* {{{ cdb_make_start */
-int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
+int cdb_make_start(struct cdb_make *c, php_stream * f)
{
c->head = 0;
c->split = 0;
@@ -65,7 +65,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
c->fp = f;
c->pos = sizeof(c->final);
if (php_stream_seek(f, c->pos, SEEK_SET) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Fseek failed");
+ php_error_docref(NULL, E_NOTICE, "Fseek failed");
return -1;
}
return php_stream_tell(c->fp);
@@ -73,7 +73,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
/* }}} */
/* {{{ cdb_make_addend */
-int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h TSRMLS_DC)
+int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h)
{
struct cdb_hplist *head;
@@ -101,7 +101,7 @@ int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datale
/* }}} */
/* {{{ cdb_make_addbegin */
-int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen TSRMLS_DC)
+int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen)
{
char buf[8];
@@ -116,26 +116,26 @@ int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int data
uint32_pack(buf, keylen);
uint32_pack(buf + 4, datalen);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
return 0;
}
/* {{{ cdb_make_add */
-int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen TSRMLS_DC)
+int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen)
{
- if (cdb_make_addbegin(c, keylen, datalen TSRMLS_CC) == -1)
+ if (cdb_make_addbegin(c, keylen, datalen) == -1)
return -1;
- if (cdb_make_write(c, key, keylen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, key, keylen) != 0)
return -1;
- if (cdb_make_write(c, data, datalen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, data, datalen) != 0)
return -1;
- return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen) TSRMLS_CC);
+ return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen));
}
/* }}} */
/* {{{ cdb_make_finish */
-int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
+int cdb_make_finish(struct cdb_make *c)
{
char buf[8];
int i;
@@ -211,7 +211,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
for (u = 0;u < len;++u) {
uint32_pack(buf, c->hash[u].h);
uint32_pack(buf + 4, c->hash[u].p);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
if (cdb_posplus(c, 8) == -1)
return -1;
@@ -231,7 +231,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
php_stream_rewind(c->fp);
if (php_stream_tell(c->fp) != 0)
return -1;
- if (cdb_make_write(c, c->final, sizeof(c->final) TSRMLS_CC) != 0)
+ if (cdb_make_write(c, c->final, sizeof(c->final)) != 0)
return -1;
return php_stream_flush(c->fp);
}
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index d33fcb15da..a9a0e85143 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -54,11 +54,11 @@ struct cdb_make {
php_stream * fp;
};
-int cdb_make_start(struct cdb_make *, php_stream * TSRMLS_DC);
-int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC);
-int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC);
-int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC);
-int cdb_make_finish(struct cdb_make * TSRMLS_DC);
+int cdb_make_start(struct cdb_make *, php_stream *);
+int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int);
+int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32);
+int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int);
+int cdb_make_finish(struct cdb_make *);
char *cdb_make_version();
#endif
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index 8eae2d2508..361cc42519 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -47,30 +47,30 @@
/* {{{ flatfile_store
*/
-int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) {
+int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode) {
if (mode == FLATFILE_INSERT) {
- if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
+ if (flatfile_findkey(dba, key_datum)) {
return 1;
}
php_stream_seek(dba->fp, 0L, SEEK_END);
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", key_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
return -1;
}
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", value_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
return -1;
}
} else { /* FLATFILE_REPLACE */
- flatfile_delete(dba, key_datum TSRMLS_CC);
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize);
+ flatfile_delete(dba, key_datum);
+ php_stream_printf(dba->fp, "%zu\n", key_datum.dsize);
php_stream_flush(dba->fp);
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
return -1;
}
- php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize);
+ php_stream_printf(dba->fp, "%zu\n", value_datum.dsize);
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
return -1;
}
@@ -83,11 +83,11 @@ int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode T
/* {{{ flatfile_fetch
*/
-datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
+datum flatfile_fetch(flatfile *dba, datum key_datum) {
datum value_datum = {NULL, 0};
char buf[16];
- if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
+ if (flatfile_findkey(dba, key_datum)) {
if (php_stream_gets(dba->fp, buf, sizeof(buf))) {
value_datum.dsize = atoi(buf);
value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1);
@@ -103,7 +103,7 @@ datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_delete
*/
-int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
+int flatfile_delete(flatfile *dba, datum key_datum) {
char *key = key_datum.dptr;
size_t size = key_datum.dsize;
size_t buf_size = FLATFILE_BLOCK_SIZE;
@@ -161,7 +161,7 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_findkey
*/
-int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
+int flatfile_findkey(flatfile *dba, datum key_datum) {
size_t buf_size = FLATFILE_BLOCK_SIZE;
char *buf = emalloc(buf_size);
size_t num;
@@ -209,7 +209,7 @@ int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
/* {{{ flatfile_firstkey
*/
-datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
+datum flatfile_firstkey(flatfile *dba) {
datum res;
size_t num;
size_t buf_size = FLATFILE_BLOCK_SIZE;
@@ -257,7 +257,7 @@ datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
/* {{{ flatfile_nextkey
*/
-datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
+datum flatfile_nextkey(flatfile *dba) {
datum res;
size_t num;
size_t buf_size = FLATFILE_BLOCK_SIZE;
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index 2cd8db3521..9325d80be7 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -37,12 +37,12 @@ typedef struct {
#define FLATFILE_INSERT 1
#define FLATFILE_REPLACE 0
-int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC);
-datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC);
-int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC);
-int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC);
-datum flatfile_firstkey(flatfile *dba TSRMLS_DC);
-datum flatfile_nextkey(flatfile *dba TSRMLS_DC);
+int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode);
+datum flatfile_fetch(flatfile *dba, datum key_datum);
+int flatfile_delete(flatfile *dba, datum key_datum);
+int flatfile_findkey(flatfile *dba, datum key_datum);
+datum flatfile_firstkey(flatfile *dba);
+datum flatfile_nextkey(flatfile *dba);
char *flatfile_version();
#endif
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 6b64872649..52c5d730bc 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -79,13 +79,13 @@ void inifile_line_free(line_type *ln)
/* }}} */
/* {{{ inifile_alloc */
-inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC)
+inifile * inifile_alloc(php_stream *fp, int readonly, int persistent)
{
inifile *dba;
if (!readonly) {
if (!php_stream_truncate_supported(fp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream");
+ php_error_docref(NULL, E_WARNING, "Can't truncate this stream");
return NULL;
}
}
@@ -164,7 +164,7 @@ static char *etrim(const char *str)
/* {{{ inifile_findkey
*/
-static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) {
+static int inifile_read(inifile *dba, line_type *ln) {
char *fline;
char *pos;
@@ -224,7 +224,7 @@ static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) {
* 1 = GROUP-EQUAL,NAME-DIFFERENT
* 2 = DIFFERENT
*/
-static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC)
+static int inifile_key_cmp(const key_type *k1, const key_type *k2)
{
assert(k1->group && k1->name && k2->group && k2->name);
@@ -242,12 +242,12 @@ static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC)
/* {{{ inifile_fetch
*/
-val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
+val_type inifile_fetch(inifile *dba, const key_type *key, int skip) {
line_type ln = {{NULL,NULL},{NULL}};
val_type val;
int res, grp_eq = 0;
- if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) {
+ if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key)) {
/* we got position already from last fetch */
php_stream_seek(dba->fp, dba->next.pos, SEEK_SET);
} else {
@@ -259,8 +259,8 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
if (skip == -1) {
skip = 0;
}
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if (!(res=inifile_key_cmp(&ln.key, key TSRMLS_CC))) {
+ while(inifile_read(dba, &ln)) {
+ if (!(res=inifile_key_cmp(&ln.key, key))) {
if (!skip) {
val.value = estrdup(ln.val.value ? ln.val.value : "");
/* allow faster access by updating key read into next */
@@ -285,22 +285,22 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) {
/* {{{ inifile_firstkey
*/
-int inifile_firstkey(inifile *dba TSRMLS_DC) {
+int inifile_firstkey(inifile *dba) {
inifile_line_free(&dba->curr);
dba->curr.pos = 0;
- return inifile_nextkey(dba TSRMLS_CC);
+ return inifile_nextkey(dba);
}
/* }}} */
/* {{{ inifile_nextkey
*/
-int inifile_nextkey(inifile *dba TSRMLS_DC) {
+int inifile_nextkey(inifile *dba) {
line_type ln = {{NULL,NULL},{NULL}};
/*inifile_line_free(&dba->next); ??? */
php_stream_seek(dba->fp, dba->curr.pos, SEEK_SET);
ln.key.group = estrdup(dba->curr.key.group ? dba->curr.key.group : "");
- inifile_read(dba, &ln TSRMLS_CC);
+ inifile_read(dba, &ln);
inifile_line_free(&dba->curr);
dba->curr = ln;
return ln.key.group || ln.key.name;
@@ -309,12 +309,12 @@ int inifile_nextkey(inifile *dba TSRMLS_DC) {
/* {{{ inifile_truncate
*/
-static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC)
+static int inifile_truncate(inifile *dba, size_t size)
{
int res;
if ((res=php_stream_truncate_set_size(dba->fp, size)) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in ftruncate: %d", res);
+ php_error_docref(NULL, E_WARNING, "Error in ftruncate: %d", res);
return FAILURE;
}
php_stream_seek(dba->fp, size, SEEK_SET);
@@ -325,7 +325,7 @@ static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC)
/* {{{ inifile_find_group
* if found pos_grp_start points to "[group_name]"
*/
-static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC)
+static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start)
{
int ret = FAILURE;
@@ -339,8 +339,8 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp
line_type ln = {{NULL,NULL},{NULL}};
res = 1;
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if ((res=inifile_key_cmp(&ln.key, key TSRMLS_CC)) < 2) {
+ while(inifile_read(dba, &ln)) {
+ if ((res=inifile_key_cmp(&ln.key, key)) < 2) {
ret = SUCCESS;
break;
}
@@ -362,15 +362,15 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp
* only valid after a call to inifile_find_group
* if any next group is found pos_grp_start points to "[group_name]" or whitespace before that
*/
-static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC)
+static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start)
{
int ret = FAILURE;
line_type ln = {{NULL,NULL},{NULL}};
*pos_grp_start = php_stream_tell(dba->fp);
ln.key.group = estrdup(key->group);
- while(inifile_read(dba, &ln TSRMLS_CC)) {
- if (inifile_key_cmp(&ln.key, key TSRMLS_CC) == 2) {
+ while(inifile_read(dba, &ln)) {
+ if (inifile_key_cmp(&ln.key, key) == 2) {
ret = SUCCESS;
break;
}
@@ -383,7 +383,7 @@ static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp
/* {{{ inifile_copy_to
*/
-static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy TSRMLS_DC)
+static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy)
{
php_stream *fp;
@@ -392,18 +392,18 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
return SUCCESS;
}
if ((fp = php_stream_temp_create(0, 64 * 1024)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not create temporary stream");
*ini_copy = NULL;
return FAILURE;
}
- if ((*ini_copy = inifile_alloc(fp, 1, 0 TSRMLS_CC)) == NULL) {
+ if ((*ini_copy = inifile_alloc(fp, 1, 0)) == NULL) {
/* writes error */
return FAILURE;
}
php_stream_seek(dba->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
+ php_error_docref(NULL, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
return FAILURE;
}
return SUCCESS;
@@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
/* {{{ inifile_filter
* copy from to dba while ignoring key name (group must equal)
*/
-static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC)
+static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found)
{
size_t pos_start = 0, pos_next = 0, pos_curr;
int ret = SUCCESS;
@@ -421,8 +421,8 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
php_stream_seek(from->fp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
- while(inifile_read(from, &ln TSRMLS_CC)) {
- switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) {
+ while(inifile_read(from, &ln)) {
+ switch(inifile_key_cmp(&ln.key, key)) {
case 0:
if (found) {
*found = (zend_bool) 1;
@@ -431,7 +431,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
+ php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
php_stream_seek(from->fp, pos_curr, SEEK_SET);
@@ -450,7 +450,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
+ php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
}
@@ -461,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend
/* {{{ inifile_delete_replace_append
*/
-static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC)
+static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found)
{
size_t pos_grp_start=0, pos_grp_next;
inifile *ini_tmp = NULL;
@@ -482,26 +482,26 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
assert(!append || (key->name && value)); /* missuse */
/* 1 - 3 */
- inifile_find_group(dba, key, &pos_grp_start TSRMLS_CC);
- inifile_next_group(dba, key, &pos_grp_next TSRMLS_CC);
+ inifile_find_group(dba, key, &pos_grp_start);
+ inifile_next_group(dba, key, &pos_grp_next);
if (append) {
ret = SUCCESS;
} else {
- ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp TSRMLS_CC);
+ ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp);
}
/* 4 */
if (ret == SUCCESS) {
fp_tmp = php_stream_temp_create(0, 64 * 1024);
if (!fp_tmp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not create temporary stream");
ret = FAILURE;
} else {
php_stream_seek(dba->fp, 0, SEEK_END);
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
+ php_error_docref(NULL, E_WARNING, "Could not copy remainder to temporary stream");
ret = FAILURE;
}
}
@@ -511,7 +511,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
/* 5 */
if (ret == SUCCESS) {
if (!value || (key->name && strlen(key->name))) {
- ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */
+ ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start); /* writes error on fail */
}
}
@@ -519,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (key->name && strlen(key->name)) {
/* 6 */
if (!append && ini_tmp) {
- ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC);
+ ret = inifile_filter(dba, ini_tmp, key, found);
}
/* 7 */
@@ -528,9 +528,9 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
*/
if (value) {
if (pos_grp_start == pos_grp_next && key->group && strlen(key->group)) {
- php_stream_printf(dba->fp TSRMLS_CC, "[%s]\n", key->group);
+ php_stream_printf(dba->fp, "[%s]\n", key->group);
}
- php_stream_printf(dba->fp TSRMLS_CC, "%s=%s\n", key->name, value->value ? value->value : "");
+ php_stream_printf(dba->fp, "%s=%s\n", key->name, value->value ? value->value : "");
}
}
@@ -542,7 +542,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
php_stream_seek(fp_tmp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
ret = FAILURE;
}
}
@@ -564,41 +564,41 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
/* {{{ inifile_delete
*/
-int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
+int inifile_delete(inifile *dba, const key_type *key)
{
- return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, NULL);
}
/* }}} */
/* {{{ inifile_delete_ex
*/
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC)
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found)
{
- return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, found);
}
/* }}} */
/* {{{ inifile_relace
*/
-int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
+int inifile_replace(inifile *dba, const key_type *key, const val_type *value)
{
- return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, NULL);
}
/* }}} */
/* {{{ inifile_replace_ex
*/
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC)
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found)
{
- return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, found);
}
/* }}} */
/* {{{ inifile_append
*/
-int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
+int inifile_append(inifile *dba, const key_type *key, const val_type *value)
{
- return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 1, NULL);
}
/* }}} */
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index 9de43b62f5..24bc2dfec9 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -45,14 +45,14 @@ typedef struct {
line_type next;
} inifile;
-val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC);
-int inifile_firstkey(inifile *dba TSRMLS_DC);
-int inifile_nextkey(inifile *dba TSRMLS_DC);
-int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC);
-int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC);
-int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
-int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC);
-int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
+val_type inifile_fetch(inifile *dba, const key_type *key, int skip);
+int inifile_firstkey(inifile *dba);
+int inifile_nextkey(inifile *dba);
+int inifile_delete(inifile *dba, const key_type *key);
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found);
+int inifile_replace(inifile *dba, const key_type *key, const val_type *val);
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found);
+int inifile_append(inifile *dba, const key_type *key, const val_type *val);
char *inifile_version();
key_type inifile_key_split(const char *group_name);
@@ -62,7 +62,7 @@ void inifile_key_free(key_type *key);
void inifile_val_free(val_type *val);
void inifile_line_free(line_type *ln);
-inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC);
+inifile * inifile_alloc(php_stream *fp, int readonly, int persistent);
void inifile_free(inifile *dba, int persistent);
#endif
diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h
index d19000cf0f..3421b5de93 100644
--- a/ext/dba/php_dba.h
+++ b/ext/dba/php_dba.h
@@ -74,44 +74,44 @@ extern zend_module_entry dba_module_entry;
typedef struct dba_handler {
char *name; /* handler name */
int flags; /* whether and how dba does locking and other flags*/
- int (*open)(dba_info *, char **error TSRMLS_DC);
- void (*close)(dba_info * TSRMLS_DC);
- char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC);
- int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC);
- int (*exists)(dba_info *, char *, int TSRMLS_DC);
- int (*delete)(dba_info *, char *, int TSRMLS_DC);
- char* (*firstkey)(dba_info *, int * TSRMLS_DC);
- char* (*nextkey)(dba_info *, int * TSRMLS_DC);
- int (*optimize)(dba_info * TSRMLS_DC);
- int (*sync)(dba_info * TSRMLS_DC);
- char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC);
+ int (*open)(dba_info *, char **error);
+ void (*close)(dba_info *);
+ char* (*fetch)(dba_info *, char *, int, int, int *);
+ int (*update)(dba_info *, char *, int, char *, int, int);
+ int (*exists)(dba_info *, char *, int);
+ int (*delete)(dba_info *, char *, int);
+ char* (*firstkey)(dba_info *, int *);
+ char* (*nextkey)(dba_info *, int *);
+ int (*optimize)(dba_info *);
+ int (*sync)(dba_info *);
+ char* (*info)(struct dba_handler *hnd, dba_info *);
/* dba_info==NULL: Handler info, dba_info!=NULL: Database info */
} dba_handler;
/* common prototypes which must be supplied by modules */
#define DBA_OPEN_FUNC(x) \
- int dba_open_##x(dba_info *info, char **error TSRMLS_DC)
+ int dba_open_##x(dba_info *info, char **error)
#define DBA_CLOSE_FUNC(x) \
- void dba_close_##x(dba_info *info TSRMLS_DC)
+ void dba_close_##x(dba_info *info)
#define DBA_FETCH_FUNC(x) \
- char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen TSRMLS_DC)
+ char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen)
#define DBA_UPDATE_FUNC(x) \
- int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode TSRMLS_DC)
+ int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode)
#define DBA_EXISTS_FUNC(x) \
- int dba_exists_##x(dba_info *info, char *key, int keylen TSRMLS_DC)
+ int dba_exists_##x(dba_info *info, char *key, int keylen)
#define DBA_DELETE_FUNC(x) \
- int dba_delete_##x(dba_info *info, char *key, int keylen TSRMLS_DC)
+ int dba_delete_##x(dba_info *info, char *key, int keylen)
#define DBA_FIRSTKEY_FUNC(x) \
- char *dba_firstkey_##x(dba_info *info, int *newlen TSRMLS_DC)
+ char *dba_firstkey_##x(dba_info *info, int *newlen)
#define DBA_NEXTKEY_FUNC(x) \
- char *dba_nextkey_##x(dba_info *info, int *newlen TSRMLS_DC)
+ char *dba_nextkey_##x(dba_info *info, int *newlen)
#define DBA_OPTIMIZE_FUNC(x) \
- int dba_optimize_##x(dba_info *info TSRMLS_DC)
+ int dba_optimize_##x(dba_info *info)
#define DBA_SYNC_FUNC(x) \
- int dba_sync_##x(dba_info *info TSRMLS_DC)
+ int dba_sync_##x(dba_info *info)
#define DBA_INFO_FUNC(x) \
- char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC)
+ char *dba_info_##x(dba_handler *hnd, dba_info *info)
#define DBA_FUNCS(x) \
DBA_OPEN_FUNC(x); \
diff --git a/ext/dom/attr.c b/ext/dom/attr.c
index 7cef0230a4..34a6749f66 100644
--- a/ext/dom/attr.c
+++ b/ext/dom/attr.c
@@ -63,33 +63,33 @@ PHP_METHOD(domattr, __construct)
size_t name_len, value_len, name_valid;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
intern = Z_DOMOBJ_P(id);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern);
}
/* }}} end DOMAttr::__construct */
@@ -99,14 +99,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1112119403
Since:
*/
-int dom_attr_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_name_read(dom_object *obj, zval *retval)
{
xmlAttrPtr attrp;
attrp = (xmlAttrPtr) dom_object_get_node(obj);
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -122,7 +122,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-862529273
Since:
*/
-int dom_attr_specified_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_specified_read(dom_object *obj, zval *retval)
{
/* TODO */
ZVAL_TRUE(retval);
@@ -136,13 +136,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-221662474
Since:
*/
-int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_value_read(dom_object *obj, zval *retval)
{
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
xmlChar *content;
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -157,18 +157,18 @@ int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_attr_value_write(dom_object *obj, zval *newval)
{
zend_string *str;
xmlAttrPtr attrp = (xmlAttrPtr) dom_object_get_node(obj);
if (attrp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (attrp->children) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
}
str = zval_get_string(newval);
@@ -186,14 +186,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement
Since: DOM Level 2
*/
-int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_owner_element_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep, nodeparent;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -203,7 +203,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(nodeparent, retval, obj TSRMLS_CC);
+ php_dom_create_object(nodeparent, retval, obj);
return SUCCESS;
}
@@ -215,9 +215,9 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo
Since: DOM Level 3
*/
-int dom_attr_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_attr_schema_type_info_read(dom_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented");
+ php_error_docref(NULL, E_WARNING, "Not yet implemented");
ZVAL_NULL(retval);
return SUCCESS;
}
@@ -234,7 +234,7 @@ PHP_FUNCTION(dom_attr_is_id)
dom_object *intern;
xmlAttrPtr attrp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_attr_class_entry) == FAILURE) {
return;
}
diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c
index 82af257c0a..83551766b5 100644
--- a/ext/dom/cdatasection.c
+++ b/ext/dom/cdatasection.c
@@ -57,26 +57,26 @@ PHP_METHOD(domcdatasection, __construct)
size_t value_len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMCdataSection::__construct */
diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c
index aee54bb3d2..5946915025 100644
--- a/ext/dom/characterdata.c
+++ b/ext/dom/characterdata.c
@@ -76,13 +76,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-72AB8359
Since:
*/
-int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_characterdata_data_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
xmlChar *content;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -96,13 +96,13 @@ int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_characterdata_data_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -121,14 +121,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C
Since:
*/
-int dom_characterdata_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_characterdata_length_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
xmlChar *content;
long length = 0;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -160,7 +160,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
return;
}
@@ -175,7 +175,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -207,7 +207,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
char *arg;
size_t arg_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_characterdata_class_entry, &arg, &arg_len) == FAILURE) {
return;
}
@@ -244,7 +244,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
size_t arg_len;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &id, dom_characterdata_class_entry, &offset, &arg, &arg_len) == FAILURE) {
return;
}
@@ -259,7 +259,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
if (offset < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -291,7 +291,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &id, dom_characterdata_class_entry, &offset, &count) == FAILURE) {
return;
}
@@ -306,7 +306,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -348,7 +348,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
size_t arg_len;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olls", &id, dom_characterdata_class_entry, &offset, &count, &arg, &arg_len) == FAILURE) {
return;
}
@@ -363,7 +363,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
if (offset < 0 || count < 0 || offset > length) {
xmlFree(cur);
- php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INDEX_SIZE_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
diff --git a/ext/dom/comment.c b/ext/dom/comment.c
index 9015586fd9..0477328966 100644
--- a/ext/dom/comment.c
+++ b/ext/dom/comment.c
@@ -57,17 +57,17 @@ PHP_METHOD(domcomment, __construct)
size_t value_len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewComment((xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -75,9 +75,9 @@ PHP_METHOD(domcomment, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern);
}
}
/* }}} end DOMComment::__construct */
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 133572af3f..9f6c093f76 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -240,13 +240,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
Since:
*/
-int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_doctype_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
xmlDtdPtr dtdptr;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -256,7 +256,7 @@ int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object((xmlNodePtr) dtdptr, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) dtdptr, retval, obj);
return SUCCESS;
}
@@ -267,9 +267,9 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
Since:
*/
-int dom_document_implementation_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_implementation_read(dom_object *obj, zval *retval)
{
- php_dom_create_implementation(retval TSRMLS_CC);
+ php_dom_create_implementation(retval);
return SUCCESS;
}
@@ -280,13 +280,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
Since:
*/
-int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_document_element_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
xmlNode *root;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -296,7 +296,7 @@ int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(root, retval, obj TSRMLS_CC);
+ php_dom_create_object(root, retval, obj);
return SUCCESS;
}
@@ -306,13 +306,13 @@ int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC)
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-encoding
Since: DOM Level 3
*/
-int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_encoding_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *encoding;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -327,14 +327,14 @@ int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_encoding_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
xmlCharEncodingHandlerPtr handler;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -349,7 +349,7 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
}
docp->encoding = xmlStrdup((const xmlChar *) str->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document Encoding");
+ php_error_docref(NULL, E_WARNING, "Invalid Document Encoding");
}
zend_string_release(str);
@@ -363,14 +363,14 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
Since: DOM Level 3
*/
-int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_standalone_read(dom_object *obj, zval *retval)
{
xmlDoc *docp;
docp = (xmlDocPtr) dom_object_get_node(obj);
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -378,13 +378,13 @@ int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_standalone_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
int standalone;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -401,13 +401,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
Since: DOM Level 3
*/
-int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_version_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *version;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -422,13 +422,13 @@ int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_version_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -451,7 +451,7 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
Since: DOM Level 3
*/
-int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_strict_error_checking_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -462,12 +462,12 @@ int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS
return SUCCESS;
}
-int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_strict_error_checking_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->stricterror = zend_is_true(newval TSRMLS_CC);
+ doc_prop->stricterror = zend_is_true(newval);
}
return SUCCESS;
@@ -478,7 +478,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
/* {{{ formatOutput boolean
readonly=no
*/
-int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_format_output_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -489,11 +489,11 @@ int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_format_output_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->formatoutput = zend_is_true(newval TSRMLS_CC);
+ doc_prop->formatoutput = zend_is_true(newval);
}
return SUCCESS;
@@ -503,7 +503,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ validateOnParse boolean
readonly=no
*/
-int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_validate_on_parse_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -514,11 +514,11 @@ int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_validate_on_parse_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->validateonparse = zend_is_true(newval TSRMLS_CC);
+ doc_prop->validateonparse = zend_is_true(newval);
}
return SUCCESS;
@@ -528,7 +528,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
/* {{{ resolveExternals boolean
readonly=no
*/
-int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_resolve_externals_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -539,11 +539,11 @@ int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_resolve_externals_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->resolveexternals = zend_is_true(newval TSRMLS_CC);
+ doc_prop->resolveexternals = zend_is_true(newval);
}
return SUCCESS;
@@ -553,7 +553,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
/* {{{ preserveWhiteSpace boolean
readonly=no
*/
-int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -564,11 +564,11 @@ int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_D
return SUCCESS;
}
-int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->preservewhitespace = zend_is_true(newval TSRMLS_CC);
+ doc_prop->preservewhitespace = zend_is_true(newval);
}
return SUCCESS;
@@ -578,7 +578,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
/* {{{ recover boolean
readonly=no
*/
-int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_recover_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -589,11 +589,11 @@ int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_recover_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->recover = zend_is_true(newval TSRMLS_CC);
+ doc_prop->recover = zend_is_true(newval);
}
return SUCCESS;
@@ -603,7 +603,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ substituteEntities boolean
readonly=no
*/
-int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_substitue_entities_read(dom_object *obj, zval *retval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
@@ -614,11 +614,11 @@ int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC
return SUCCESS;
}
-int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_substitue_entities_write(dom_object *obj, zval *newval)
{
if (obj->document) {
dom_doc_propsptr doc_prop = dom_get_doc_props(obj->document);
- doc_prop->substituteentities = zend_is_true(newval TSRMLS_CC);
+ doc_prop->substituteentities = zend_is_true(newval);
}
return SUCCESS;
@@ -630,13 +630,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
Since: DOM Level 3
*/
-int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_document_uri_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
char *url;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -650,13 +650,13 @@ int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_document_document_uri_write(dom_object *obj, zval *newval)
{
xmlDoc *docp = (xmlDocPtr) dom_object_get_node(obj);
zend_string *str;
if (docp == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -679,7 +679,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
Since: DOM Level 3
*/
-int dom_document_config_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_document_config_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -701,14 +701,14 @@ PHP_FUNCTION(dom_document_create_element)
size_t name_len, value_len;
char *name, *value = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -733,7 +733,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
dom_object *intern;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(dom_document_create_text_node)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -791,7 +791,7 @@ PHP_FUNCTION(dom_document_create_comment)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -820,7 +820,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
dom_object *intern;
char *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &value, &value_len) == FAILURE) {
return;
}
@@ -849,14 +849,14 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
dom_object *intern;
char *name, *value = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_document_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -885,14 +885,14 @@ PHP_FUNCTION(dom_document_create_attribute)
dom_object *intern;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -920,14 +920,14 @@ PHP_FUNCTION(dom_document_create_entity_reference)
size_t name_len;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -953,16 +953,16 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
char *name;
xmlChar *local;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
}
/* }}} end dom_document_get_elements_by_tag_name */
@@ -979,7 +979,7 @@ PHP_FUNCTION(dom_document_import_node)
int ret;
zend_long recursive = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
@@ -989,7 +989,7 @@ PHP_FUNCTION(dom_document_import_node)
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
+ php_error_docref(NULL, E_WARNING, "Cannot import: Node Type Not Supported");
RETURN_FALSE;
}
@@ -1038,7 +1038,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
int errorcode;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@@ -1070,7 +1070,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
if (nodep != NULL) {
xmlFreeNode(nodep);
}
- php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(errorcode, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1102,7 +1102,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
dom_object *intern;
int errorcode;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -1126,7 +1126,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Missing Root Element");
+ php_error_docref(NULL, E_WARNING, "Document Missing Root Element");
RETURN_FALSE;
}
@@ -1139,7 +1139,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
if (nodep != NULL) {
xmlFreeProp((xmlAttrPtr) nodep);
}
- php_dom_throw_error(errorcode, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(errorcode, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1164,17 +1164,17 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
}
/* }}} end dom_document_get_elements_by_tag_name_ns */
@@ -1192,7 +1192,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
dom_object *intern;
char *idname;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &idname, &idname_len) == FAILURE) {
return;
}
@@ -1229,13 +1229,13 @@ PHP_FUNCTION(dom_document_normalize_document)
xmlDocPtr docp;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- dom_normalize((xmlNodePtr) docp TSRMLS_CC);
+ dom_normalize((xmlNodePtr) docp);
}
/* }}} end dom_document_normalize_document */
@@ -1261,17 +1261,17 @@ PHP_METHOD(domdocument, __construct)
int refcount;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
docp = xmlNewDoc((xmlChar *) version);
if (!docp) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -1283,22 +1283,22 @@ PHP_METHOD(domdocument, __construct)
if (intern != NULL) {
olddoc = (xmlDocPtr) dom_object_get_node(intern);
if (olddoc != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
olddoc->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp) == -1) {
RETURN_FALSE;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern);
}
}
/* }}} end DOMDocument::__construct */
-char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) /* {{{ */
+char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) /* {{{ */
{
xmlURI *uri;
xmlChar *escsource;
@@ -1339,7 +1339,7 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
if ((uri->scheme == NULL || isFileUri)) {
/* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -1352,7 +1352,7 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
}
/* }}} */
-static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options TSRMLS_DC) /* {{{ */
+static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options) /* {{{ */
{
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
@@ -1383,7 +1383,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
xmlInitParser();
if (mode == DOM_LOAD_FILE) {
- char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (file_dest) {
ctxt = xmlCreateFileParserCtxt(file_dest);
}
@@ -1480,20 +1480,20 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
zend_long options = 0;
id = getThis();
- if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
+ if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) {
id = NULL;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) {
return;
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
- newdoc = dom_document_parser(id, mode, source, source_len, options TSRMLS_CC);
+ newdoc = dom_document_parser(id, mode, source, source_len, options);
if (!newdoc)
RETURN_FALSE;
@@ -1504,22 +1504,22 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) {
RETURN_FALSE;
}
intern->document->doc_props = doc_prop;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern);
RETURN_TRUE;
} else {
@@ -1562,12 +1562,12 @@ PHP_FUNCTION(dom_document_save)
char *file;
zend_long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) {
return;
}
if (file_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
+ php_error_docref(NULL, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
@@ -1608,7 +1608,7 @@ PHP_FUNCTION(dom_document_savexml)
int size, format, saveempty = 0;
zend_long options = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
return;
}
@@ -1621,12 +1621,12 @@ PHP_FUNCTION(dom_document_savexml)
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
+ php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (options & LIBXML_SAVE_NOEMPTYTAG) {
@@ -1663,40 +1663,40 @@ PHP_FUNCTION(dom_document_savexml)
}
/* }}} end dom_document_savexml */
-static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_dom_free_xinclude_node(xmlNodePtr cur) /* {{{ */
{
xmlNodePtr xincnode;
xincnode = cur;
cur = cur->next;
xmlUnlinkNode(xincnode);
- php_libxml_node_free_resource(xincnode TSRMLS_CC);
+ php_libxml_node_free_resource(xincnode);
return cur;
}
/* }}} */
-static void php_dom_remove_xinclude_nodes(xmlNodePtr cur TSRMLS_DC) /* {{{ */
+static void php_dom_remove_xinclude_nodes(xmlNodePtr cur) /* {{{ */
{
while(cur) {
if (cur->type == XML_XINCLUDE_START) {
- cur = php_dom_free_xinclude_node(cur TSRMLS_CC);
+ cur = php_dom_free_xinclude_node(cur);
/* XML_XINCLUDE_END node will be a sibling of XML_XINCLUDE_START */
while(cur && cur->type != XML_XINCLUDE_END) {
/* remove xinclude processing nodes from recursive xincludes */
if (cur->type == XML_ELEMENT_NODE) {
- php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(cur->children);
}
cur = cur->next;
}
if (cur && cur->type == XML_XINCLUDE_END) {
- cur = php_dom_free_xinclude_node(cur TSRMLS_CC);
+ cur = php_dom_free_xinclude_node(cur);
}
} else {
if (cur->type == XML_ELEMENT_NODE) {
- php_dom_remove_xinclude_nodes(cur->children TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(cur->children);
}
cur = cur->next;
}
@@ -1715,7 +1715,7 @@ PHP_FUNCTION(dom_document_xinclude)
int err;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_document_class_entry, &flags) == FAILURE) {
return;
}
@@ -1732,7 +1732,7 @@ PHP_FUNCTION(dom_document_xinclude)
root = root->next;
}
if (root) {
- php_dom_remove_xinclude_nodes(root TSRMLS_CC);
+ php_dom_remove_xinclude_nodes(root);
}
if (err) {
@@ -1754,7 +1754,7 @@ PHP_FUNCTION(dom_document_validate)
dom_object *intern;
xmlValidCtxt *cvp;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_document_class_entry) == FAILURE) {
return;
}
@@ -1793,12 +1793,12 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
int is_valid;
char resolved_path[MAXPATHLEN + 1];
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op|l", &id, dom_document_class_entry, &source, &source_len, &flags) == FAILURE) {
return;
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1806,9 +1806,9 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
switch (type) {
case DOM_LOAD_FILE:
- valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema file source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema file source");
RETURN_FALSE;
}
parser = xmlSchemaNewParserCtxt(valid_file);
@@ -1829,7 +1829,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
sptr = xmlSchemaParse(parser);
xmlSchemaFreeParserCtxt(parser);
if (!sptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema");
RETURN_FALSE;
}
@@ -1889,12 +1889,12 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
int is_valid;
char resolved_path[MAXPATHLEN + 1];
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op", &id, dom_document_class_entry, &source, &source_len) == FAILURE) {
return;
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Schema source");
+ php_error_docref(NULL, E_WARNING, "Invalid Schema source");
RETURN_FALSE;
}
@@ -1902,9 +1902,9 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
switch (type) {
case DOM_LOAD_FILE:
- valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG file source");
+ php_error_docref(NULL, E_WARNING, "Invalid RelaxNG file source");
RETURN_FALSE;
}
parser = xmlRelaxNGNewParserCtxt(valid_file);
@@ -1925,7 +1925,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
sptr = xmlRelaxNGParse(parser);
xmlRelaxNGFreeParserCtxt(parser);
if (!sptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid RelaxNG");
+ php_error_docref(NULL, E_WARNING, "Invalid RelaxNG");
RETURN_FALSE;
}
@@ -1983,12 +1983,12 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
id = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) {
return;
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
@@ -2020,28 +2020,28 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
if (!newdoc)
RETURN_FALSE;
- if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry TSRMLS_CC)) {
+ if (id != NULL && instanceof_function(Z_OBJCE_P(id), dom_document_class_entry)) {
intern = Z_DOMOBJ_P(id);
if (intern != NULL) {
docp = (xmlDocPtr) dom_object_get_node(intern);
doc_prop = NULL;
if (docp != NULL) {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
doc_prop = intern->document->doc_props;
intern->document->doc_props = NULL;
- refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ refcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
if (refcount != 0) {
docp->_private = NULL;
}
}
intern->document = NULL;
- if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
+ if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc) == -1) {
RETURN_FALSE;
}
intern->document->doc_props = doc_prop;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)newdoc, (void *)intern);
RETURN_TRUE;
} else {
@@ -2082,12 +2082,12 @@ PHP_FUNCTION(dom_document_save_html_file)
char *file;
const char *encoding;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_document_class_entry, &file, &file_len) == FAILURE) {
return;
}
if (file_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename");
+ php_error_docref(NULL, E_WARNING, "Invalid Filename");
RETURN_FALSE;
}
@@ -2121,7 +2121,7 @@ PHP_FUNCTION(dom_document_save_html)
int size = 0, format;
dom_doc_propsptr doc_props;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|O!", &id, dom_document_class_entry, &nodep, dom_node_class_entry)
== FAILURE) {
return;
@@ -2136,13 +2136,13 @@ PHP_FUNCTION(dom_document_save_html)
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
+ php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
@@ -2170,7 +2170,7 @@ PHP_FUNCTION(dom_document_save_html)
RETVAL_STRINGL((const char*) mem, size);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error dumping HTML node");
+ php_error_docref(NULL, E_WARNING, "Error dumping HTML node");
RETVAL_FALSE;
}
xmlBufferFree(buf);
@@ -2203,19 +2203,19 @@ PHP_METHOD(domdocument, registerNodeClass)
zend_class_entry *basece = dom_node_class_entry, *ce = NULL;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OCC!", &id, dom_document_class_entry, &basece, &ce) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OCC!", &id, dom_document_class_entry, &basece, &ce) == FAILURE) {
return;
}
- if (ce == NULL || instanceof_function(ce, basece TSRMLS_CC)) {
+ if (ce == NULL || instanceof_function(ce, basece)) {
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
- if (dom_set_doc_classmap(intern->document, basece, ce TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be registered.", ce->name->val);
+ if (dom_set_doc_classmap(intern->document, basece, ce) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Class %s could not be registered.", ce->name->val);
}
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s is not derived from %s.", ce->name->val, basece->name->val);
+ php_error_docref(NULL, E_ERROR, "Class %s is not derived from %s.", ce->name->val, basece->name->val);
}
RETURN_FALSE;
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index d3055214f6..a7264ec96f 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -58,27 +58,27 @@ PHP_METHOD(domdocumentfragment, __construct)
dom_object *intern;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewDocFragment(NULL);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- /* php_dom_set_object(intern, nodep TSRMLS_CC); */
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ /* php_dom_set_object(intern, nodep); */
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMDocumentFragment::__construct */
@@ -126,14 +126,14 @@ PHP_METHOD(domdocumentfragment, appendXML) {
int err;
xmlNodePtr lst;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_documentfragment_class_entry, &data, &data_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c
index 08b33242b1..7a1a1ddb59 100644
--- a/ext/dom/documenttype.c
+++ b/ext/dom/documenttype.c
@@ -43,12 +43,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134
Since:
*/
-int dom_documenttype_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_name_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -64,23 +64,23 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630
Since:
*/
-int dom_documenttype_entities_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_entities_read(dom_object *obj, zval *retval)
{
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
xmlHashTable *entityht;
dom_object *intern;
if (doctypep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
entityht = (xmlHashTable *) doctypep->entities;
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL);
return SUCCESS;
}
@@ -92,23 +92,23 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF
Since:
*/
-int dom_documenttype_notations_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_notations_read(dom_object *obj, zval *retval)
{
xmlDtdPtr doctypep = (xmlDtdPtr) dom_object_get_node(obj);
xmlHashTable *notationht;
dom_object *intern;
if (doctypep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
notationht = (xmlHashTable *) doctypep->notations;
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL);
return SUCCESS;
}
@@ -120,12 +120,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId
Since: DOM Level 2
*/
-int dom_documenttype_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_public_id_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -145,12 +145,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId
Since: DOM Level 2
*/
-int dom_documenttype_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_system_id_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -169,13 +169,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset
Since: DOM Level 2
*/
-int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval)
{
xmlDtdPtr dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
xmlDtdPtr intsubset;
if (dtdptr == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index ee892f3703..8a64aeba25 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -122,7 +122,7 @@ xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index) /* {{{ */
}
/* }}} */
-static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_dtor(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -131,7 +131,7 @@ static void php_dom_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int php_dom_iterator_valid(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -144,7 +144,7 @@ static int php_dom_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-zval *php_dom_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+zval *php_dom_iterator_current_data(zend_object_iterator *iter) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
@@ -152,12 +152,12 @@ zval *php_dom_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{
}
/* }}} */
-static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
php_dom_iterator *iterator = (php_dom_iterator *)iter;
zval *object = &iterator->intern.data;
- if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(object), dom_nodelist_class_entry)) {
ZVAL_LONG(key, iter->index);
} else {
dom_object *intern = Z_DOMOBJ_P(&iterator->curobj);
@@ -172,7 +172,7 @@ static void php_dom_iterator_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_dom_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
{
zval *object;
xmlNodePtr curnode = NULL, basenode;
@@ -232,7 +232,7 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
}
err:
if (curnode) {
- php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj TSRMLS_CC);
+ php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj);
}
}
/* }}} */
@@ -246,7 +246,7 @@ zend_object_iterator_funcs php_dom_iterator_funcs = {
NULL
};
-zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
@@ -260,7 +260,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = emalloc(sizeof(php_dom_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_dom_iterator_funcs;
@@ -309,7 +309,7 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
}
err:
if (curnode) {
- php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj TSRMLS_CC);
+ php_dom_create_object(curnode, &iterator->curobj, objmap->baseobj);
}
return &iterator->intern;
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index b5c81d271b..79223fa4d4 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -22,143 +22,143 @@
#define DOM_PROPERTIES_H
/* attr properties */
-int dom_attr_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_specified_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_attr_owner_element_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_attr_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_attr_name_read(dom_object *obj, zval *retval);
+int dom_attr_specified_read(dom_object *obj, zval *retval);
+int dom_attr_value_read(dom_object *obj, zval *retval);
+int dom_attr_value_write(dom_object *obj, zval *newval);
+int dom_attr_owner_element_read(dom_object *obj, zval *retval);
+int dom_attr_schema_type_info_read(dom_object *obj, zval *retval);
/* characterdata properties */
-int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_characterdata_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_characterdata_data_read(dom_object *obj, zval *retval);
+int dom_characterdata_data_write(dom_object *obj, zval *newval);
+int dom_characterdata_length_read(dom_object *obj, zval *retval);
/* document properties */
-int dom_document_doctype_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_implementation_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_document_element_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_standalone_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_version_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_strict_error_checking_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_document_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_config_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_format_output_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_validate_on_parse_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_resolve_externals_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_recover_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_document_substitue_entities_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_document_doctype_read(dom_object *obj, zval *retval);
+int dom_document_implementation_read(dom_object *obj, zval *retval);
+int dom_document_document_element_read(dom_object *obj, zval *retval);
+int dom_document_actual_encoding_read(dom_object *obj, zval *retval);
+int dom_document_actual_encoding_write(dom_object *obj, zval *newval);
+int dom_document_encoding_read(dom_object *obj, zval *retval);
+int dom_document_encoding_write(dom_object *obj, zval *newval);
+int dom_document_standalone_read(dom_object *obj, zval *retval);
+int dom_document_standalone_write(dom_object *obj, zval *newval);
+int dom_document_version_read(dom_object *obj, zval *retval);
+int dom_document_version_write(dom_object *obj, zval *newval);
+int dom_document_strict_error_checking_read(dom_object *obj, zval *retval);
+int dom_document_strict_error_checking_write(dom_object *obj, zval *newval);
+int dom_document_document_uri_read(dom_object *obj, zval *retval);
+int dom_document_document_uri_write(dom_object *obj, zval *newval);
+int dom_document_config_read(dom_object *obj, zval *retval);
+int dom_document_format_output_read(dom_object *obj, zval *retval);
+int dom_document_format_output_write(dom_object *obj, zval *newval);
+int dom_document_validate_on_parse_read(dom_object *obj, zval *retval);
+int dom_document_validate_on_parse_write(dom_object *obj, zval *newval);
+int dom_document_resolve_externals_read(dom_object *obj, zval *retval);
+int dom_document_resolve_externals_write(dom_object *obj, zval *newval);
+int dom_document_preserve_whitespace_read(dom_object *obj, zval *retval);
+int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval);
+int dom_document_recover_read(dom_object *obj, zval *retval);
+int dom_document_recover_write(dom_object *obj, zval *newval);
+int dom_document_substitue_entities_read(dom_object *obj, zval *retval);
+int dom_document_substitue_entities_write(dom_object *obj, zval *newval);
/* documenttype properties */
-int dom_documenttype_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_entities_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_notations_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_documenttype_name_read(dom_object *obj, zval *retval);
+int dom_documenttype_entities_read(dom_object *obj, zval *retval);
+int dom_documenttype_notations_read(dom_object *obj, zval *retval);
+int dom_documenttype_public_id_read(dom_object *obj, zval *retval);
+int dom_documenttype_system_id_read(dom_object *obj, zval *retval);
+int dom_documenttype_internal_subset_read(dom_object *obj, zval *retval);
/* domerror properties */
-int dom_domerror_severity_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_message_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_type_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_related_exception_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_related_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domerror_location_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domerror_severity_read(dom_object *obj, zval *retval);
+int dom_domerror_message_read(dom_object *obj, zval *retval);
+int dom_domerror_type_read(dom_object *obj, zval *retval);
+int dom_domerror_related_exception_read(dom_object *obj, zval *retval);
+int dom_domerror_related_data_read(dom_object *obj, zval *retval);
+int dom_domerror_location_read(dom_object *obj, zval *retval);
/* domimplementationlist properties */
-int dom_domimplementationlist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domimplementationlist_length_read(dom_object *obj, zval *retval);
/* domlocator properties */
-int dom_domlocator_line_number_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_column_number_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_offset_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_related_node_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_domlocator_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domlocator_line_number_read(dom_object *obj, zval *retval);
+int dom_domlocator_column_number_read(dom_object *obj, zval *retval);
+int dom_domlocator_offset_read(dom_object *obj, zval *retval);
+int dom_domlocator_related_node_read(dom_object *obj, zval *retval);
+int dom_domlocator_uri_read(dom_object *obj, zval *retval);
/* domstringlist properties */
-int dom_domstringlist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_domstringlist_length_read(dom_object *obj, zval *retval);
/* element properties */
-int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_element_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_element_tag_name_read(dom_object *obj, zval *retval);
+int dom_element_schema_type_info_read(dom_object *obj, zval *retval);
/* entity properties */
-int dom_entity_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_entity_encoding_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_entity_version_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_entity_public_id_read(dom_object *obj, zval *retval);
+int dom_entity_system_id_read(dom_object *obj, zval *retval);
+int dom_entity_notation_name_read(dom_object *obj, zval *retval);
+int dom_entity_actual_encoding_read(dom_object *obj, zval *retval);
+int dom_entity_actual_encoding_write(dom_object *obj, zval *newval);
+int dom_entity_encoding_read(dom_object *obj, zval *retval);
+int dom_entity_encoding_write(dom_object *obj, zval *newval);
+int dom_entity_version_read(dom_object *obj, zval *retval);
+int dom_entity_version_write(dom_object *obj, zval *newval);
/* namednodemap properties */
-int dom_namednodemap_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_namednodemap_length_read(dom_object *obj, zval *retval);
/* namelist properties */
-int dom_namelist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_namelist_length_read(dom_object *obj, zval *retval);
/* node properties */
-int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_node_node_type_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_child_nodes_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_attributes_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_namespace_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC);
-int dom_node_local_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_base_uri_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_node_node_name_read(dom_object *obj, zval *retval);
+int dom_node_node_value_read(dom_object *obj, zval *retval);
+int dom_node_node_value_write(dom_object *obj, zval *newval);
+int dom_node_node_type_read(dom_object *obj, zval *retval);
+int dom_node_parent_node_read(dom_object *obj, zval *retval);
+int dom_node_child_nodes_read(dom_object *obj, zval *retval);
+int dom_node_first_child_read(dom_object *obj, zval *retval);
+int dom_node_last_child_read(dom_object *obj, zval *retval);
+int dom_node_previous_sibling_read(dom_object *obj, zval *retval);
+int dom_node_next_sibling_read(dom_object *obj, zval *retval);
+int dom_node_attributes_read(dom_object *obj, zval *retval);
+int dom_node_owner_document_read(dom_object *obj, zval *retval);
+int dom_node_namespace_uri_read(dom_object *obj, zval *retval);
+int dom_node_prefix_read(dom_object *obj, zval *retval);
+int dom_node_prefix_write(dom_object *obj, zval *newval);
+int dom_node_local_name_read(dom_object *obj, zval *retval);
+int dom_node_base_uri_read(dom_object *obj, zval *retval);
+int dom_node_text_content_read(dom_object *obj, zval *retval);
+int dom_node_text_content_write(dom_object *obj, zval *newval);
/* nodelist properties */
-int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_nodelist_length_read(dom_object *obj, zval *retval);
xmlNodePtr dom_nodelist_xml_item(dom_nnodemap_object *objmap, long index);
xmlNodePtr dom_nodelist_baseobj_item(dom_nnodemap_object *objmap, long index);
/* notation properties */
-int dom_notation_public_id_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_notation_system_id_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_notation_public_id_read(dom_object *obj, zval *retval);
+int dom_notation_system_id_read(dom_object *obj, zval *retval);
/* processinginstruction properties */
-int dom_processinginstruction_target_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC);
+int dom_processinginstruction_target_read(dom_object *obj, zval *retval);
+int dom_processinginstruction_data_read(dom_object *obj, zval *retval);
+int dom_processinginstruction_data_write(dom_object *obj, zval *newval);
/* text properties */
-int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_text_whole_text_read(dom_object *obj, zval *retval);
/* typeinfo properties */
-int dom_typeinfo_type_name_read(dom_object *obj, zval *retval TSRMLS_DC);
-int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_typeinfo_type_name_read(dom_object *obj, zval *retval);
+int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval);
#if defined(LIBXML_XPATH_ENABLED)
/* xpath properties */
-int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC);
+int dom_xpath_document_read(dom_object *obj, zval *retval);
#endif
#endif /* DOM_PROPERTIERS_H */
diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c
index 2214c3f786..be3355b0ec 100644
--- a/ext/dom/domerror.c
+++ b/ext/dom/domerror.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-severity
Since:
*/
-int dom_domerror_severity_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_severity_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-message
Since:
*/
-int dom_domerror_message_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_message_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -72,7 +72,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-type
Since:
*/
-int dom_domerror_type_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_type_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -85,7 +85,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedException
Since:
*/
-int dom_domerror_related_exception_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_related_exception_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -98,7 +98,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-relatedData
Since:
*/
-int dom_domerror_related_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_related_data_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -111,7 +111,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ERROR-DOMError-location
Since:
*/
-int dom_domerror_location_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domerror_location_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c
index 4696e87f21..d7de3c4720 100644
--- a/ext/dom/domexception.c
+++ b/ext/dom/domexception.c
@@ -40,18 +40,18 @@ const zend_function_entry php_dom_domexception_class_functions[] = {
PHP_FE_END
};
-void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) /* {{{ */
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error) /* {{{ */
{
if (strict_error == 1) {
- zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC);
+ zend_throw_exception(dom_domexception_class_entry, error_message, error_code);
} else {
- php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC);
+ php_libxml_issue_error(E_WARNING, error_message);
}
}
/* }}} */
/* {{{ php_dom_throw_error */
-void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
+void php_dom_throw_error(int error_code, int strict_error)
{
char *error_message;
@@ -109,7 +109,7 @@ void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC)
error_message = "Unhandled Error";
}
- php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC);
+ php_dom_throw_error_with_message(error_code, error_message, strict_error);
}
/* }}} end php_dom_throw_error */
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index ea2b784b3c..49c54b5f86 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -73,7 +73,7 @@ PHP_METHOD(domimplementation, hasFeature)
size_t feature_len, version_len;
char *feature, *version;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &feature, &feature_len, &version, &version_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &feature, &feature_len, &version, &version_len) == FAILURE) {
return;
}
@@ -98,12 +98,12 @@ PHP_METHOD(domimplementation, createDocumentType)
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
xmlURIPtr uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &name, &name_len, &publicid, &publicid_len, &systemid, &systemid_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "qualifiedName is required");
+ php_error_docref(NULL, E_WARNING, "qualifiedName is required");
RETURN_FALSE;
}
@@ -118,7 +118,7 @@ PHP_METHOD(domimplementation, createDocumentType)
if (uri != NULL && uri->opaque != NULL) {
localname = xmlStrdup((xmlChar *) uri->opaque);
if (xmlStrchr(localname, (xmlChar) ':') != NULL) {
- php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, 1);
xmlFreeURI(uri);
xmlFree(localname);
RETURN_FALSE;
@@ -128,7 +128,7 @@ PHP_METHOD(domimplementation, createDocumentType)
}
/* TODO: Test that localname has no invalid chars
- php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR,);
*/
if (uri) {
@@ -139,7 +139,7 @@ PHP_METHOD(domimplementation, createDocumentType)
xmlFree(localname);
if (doctype == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create DocumentType");
+ php_error_docref(NULL, E_WARNING, "Unable to create DocumentType");
RETURN_FALSE;
}
@@ -164,18 +164,18 @@ PHP_METHOD(domimplementation, createDocument)
char *prefix = NULL, *localname = NULL;
dom_object *doctobj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssO", &uri, &uri_len, &name, &name_len, &node, dom_documenttype_class_entry) == FAILURE) {
return;
}
if (node != NULL) {
DOM_GET_OBJ(doctype, node, xmlDtdPtr, doctobj);
if (doctype->type == XML_DOCUMENT_TYPE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid DocumentType object");
+ php_error_docref(NULL, E_WARNING, "Invalid DocumentType object");
RETURN_FALSE;
}
if (doctype->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, 1);
RETURN_FALSE;
}
} else {
@@ -199,7 +199,7 @@ PHP_METHOD(domimplementation, createDocument)
if (localname != NULL) {
xmlFree(localname);
}
- php_dom_throw_error(errorcode, 1 TSRMLS_CC);
+ php_dom_throw_error(errorcode, 1);
RETURN_FALSE;
}
@@ -233,7 +233,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlFreeDoc(docp);
xmlFree(localname);
/* Need some type of error here */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected Error");
+ php_error_docref(NULL, E_WARNING, "Unexpected Error");
RETURN_FALSE;
}
@@ -247,7 +247,7 @@ PHP_METHOD(domimplementation, createDocument)
if (doctobj != NULL) {
doctobj->document = ((dom_object *)((php_libxml_node_ptr *)docp->_private)->_private)->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)doctobj, docp);
}
}
/* }}} end dom_domimplementation_create_document */
diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c
index b4d20172f0..5feedebe27 100644
--- a/ext/dom/domimplementationlist.c
+++ b/ext/dom/domimplementationlist.c
@@ -52,7 +52,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementationList-length
Since:
*/
-int dom_domimplementationlist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domimplementationlist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c
index 8fdd326fcc..e3f3ecf3b0 100644
--- a/ext/dom/domlocator.c
+++ b/ext/dom/domlocator.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-line-number
Since:
*/
-int dom_domlocator_line_number_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_line_number_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-column-number
Since:
*/
-int dom_domlocator_column_number_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_column_number_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -72,7 +72,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-offset
Since:
*/
-int dom_domlocator_offset_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_offset_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -85,7 +85,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-node
Since:
*/
-int dom_domlocator_related_node_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_related_node_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
@@ -98,7 +98,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMLocator-uri
Since:
*/
-int dom_domlocator_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domlocator_uri_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c
index 6e8bc05bac..a13f29c91a 100644
--- a/ext/dom/domstringlist.c
+++ b/ext/dom/domstringlist.c
@@ -52,7 +52,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMStringList-length
Since:
*/
-int dom_domstringlist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_domstringlist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 0aff19561a..d97bfc06b3 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -165,16 +165,16 @@ PHP_METHOD(domelement, __construct)
xmlNsPtr nsptr = NULL;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
@@ -196,7 +196,7 @@ PHP_METHOD(domelement, __construct)
if (nodep != NULL) {
xmlFreeNode(nodep);
}
- php_dom_throw_error(errorcode, 1 TSRMLS_CC);
+ php_dom_throw_error(errorcode, 1);
RETURN_FALSE;
}
} else {
@@ -205,14 +205,14 @@ PHP_METHOD(domelement, __construct)
if (prefix != NULL) {
xmlFree(localname);
xmlFree(prefix);
- php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewNode(NULL, (xmlChar *) name);
}
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -223,9 +223,9 @@ PHP_METHOD(domelement, __construct)
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMElement::__construct */
@@ -234,7 +234,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-104682815
Since:
*/
-int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_element_tag_name_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep;
xmlNsPtr ns;
@@ -243,7 +243,7 @@ int dom_element_tag_name_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -268,7 +268,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Element-schemaTypeInfo
Since: DOM Level 3
*/
-int dom_element_schema_type_info_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_element_schema_type_info_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -333,7 +333,7 @@ PHP_FUNCTION(dom_element_get_attribute)
xmlNodePtr attr;
size_t name_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -376,25 +376,25 @@ PHP_FUNCTION(dom_element_set_attribute)
dom_object *intern;
char *name, *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_element_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -402,7 +402,7 @@ PHP_FUNCTION(dom_element_set_attribute)
if (attr != NULL) {
switch (attr->type) {
case XML_ATTRIBUTE_NODE:
- node_list_unlink(attr->children TSRMLS_CC);
+ node_list_unlink(attr->children);
break;
case XML_NAMESPACE_DECL:
RETURN_FALSE;
@@ -420,7 +420,7 @@ PHP_FUNCTION(dom_element_set_attribute)
attr = (xmlNodePtr)xmlSetProp(nodep, (xmlChar *) name, (xmlChar *)value);
}
if (!attr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", name);
+ php_error_docref(NULL, E_WARNING, "No such attribute '%s'", name);
RETURN_FALSE;
}
@@ -441,14 +441,14 @@ PHP_FUNCTION(dom_element_remove_attribute)
size_t name_len;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -460,7 +460,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
switch (attrp->type) {
case XML_ATTRIBUTE_NODE:
if (php_dom_object_get_data(attrp) == NULL) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
xmlUnlinkNode(attrp);
xmlFreeProp((xmlAttrPtr)attrp);
} else {
@@ -490,7 +490,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
dom_object *intern;
char *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -536,26 +536,26 @@ PHP_FUNCTION(dom_element_set_attribute_node)
dom_object *intern, *attrobj, *oldobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required");
+ php_error_docref(NULL, E_WARNING, "Attribute node is required");
RETURN_FALSE;
}
if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -575,7 +575,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL);
}
xmlAddChild(nodep, (xmlNodePtr) attrp);
@@ -602,21 +602,21 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
dom_object *intern, *attrobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE || attrp->parent != nodep) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -640,16 +640,16 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
char *name;
xmlChar *local;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
}
/* }}} end dom_element_get_elements_by_tag_name */
@@ -667,7 +667,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
char *uri, *name;
xmlChar *strattr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -749,12 +749,12 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
dom_object *intern;
int errorcode = 0, stricterror, is_xmlns = 0, name_valid;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!ss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
@@ -763,7 +763,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
stricterror = dom_get_strict_error(intern->document);
if (dom_node_is_read_only(elemp) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_NULL();
}
@@ -773,7 +773,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
if (uri_len > 0) {
nodep = (xmlNodePtr) xmlHasNsProp(elemp, (xmlChar *) localname, (xmlChar *) uri);
if (nodep != NULL && nodep->type != XML_ATTRIBUTE_DECL) {
- node_list_unlink(nodep->children TSRMLS_CC);
+ node_list_unlink(nodep->children);
}
if ((xmlStrEqual((xmlChar *) prefix, (xmlChar *)"xmlns") ||
@@ -841,7 +841,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
} else {
attr = xmlHasProp(elemp, (xmlChar *)localname);
if (attr != NULL && attr->type != XML_ATTRIBUTE_DECL) {
- node_list_unlink(attr->children TSRMLS_CC);
+ node_list_unlink(attr->children);
}
xmlSetProp(elemp, (xmlChar *)localname, (xmlChar *)value);
}
@@ -854,7 +854,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
}
if (errorcode != 0) {
- php_dom_throw_error(errorcode, stricterror TSRMLS_CC);
+ php_dom_throw_error(errorcode, stricterror);
}
RETURN_NULL();
@@ -875,14 +875,14 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
size_t name_len, uri_len;
char *name, *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
@@ -906,7 +906,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
if (attrp && attrp->type != XML_ATTRIBUTE_DECL) {
if (php_dom_object_get_data((xmlNodePtr) attrp) == NULL) {
- node_list_unlink(attrp->children TSRMLS_CC);
+ node_list_unlink(attrp->children);
xmlUnlinkNode((xmlNodePtr) attrp);
xmlFreeProp(attrp);
} else {
@@ -932,7 +932,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
int ret;
char *uri, *name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -962,26 +962,26 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
dom_object *intern, *attrobj, *oldobj;
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_element_class_entry, &node, dom_attr_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->type != XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute node is required");
+ php_error_docref(NULL, E_WARNING, "Attribute node is required");
RETURN_FALSE;
}
if (!(attrp->doc == NULL || attrp->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
@@ -1007,7 +1007,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
if (attrp->doc == NULL && nodep->doc != NULL) {
attrobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)attrobj, NULL);
}
xmlAddChild(nodep, (xmlNodePtr) attrp);
@@ -1035,17 +1035,17 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
namednode = Z_DOMOBJ_P(return_value);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
- dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
+ dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
}
/* }}} end dom_element_get_elements_by_tag_name_ns */
@@ -1063,7 +1063,7 @@ PHP_FUNCTION(dom_element_has_attribute)
size_t name_len;
xmlNodePtr attr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_element_class_entry, &name, &name_len) == FAILURE) {
return;
}
@@ -1092,7 +1092,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
char *uri, *name;
xmlChar *value;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@@ -1149,20 +1149,20 @@ PHP_FUNCTION(dom_element_set_id_attribute)
size_t name_len;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osb", &id, dom_element_class_entry, &name, &name_len, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
attrp = xmlHasNsProp(nodep, (xmlChar *)name, NULL);
if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
@@ -1185,20 +1185,20 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
char *uri, *name;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ossb", &id, dom_element_class_entry, &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(elemp, id, xmlNodePtr, intern);
if (dom_node_is_read_only(elemp) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
attrp = xmlHasNsProp(elemp, (xmlChar *)name, (xmlChar *)uri);
if (attrp == NULL || attrp->type == XML_ATTRIBUTE_DECL) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
@@ -1219,21 +1219,21 @@ PHP_FUNCTION(dom_element_set_id_attribute_node)
dom_object *intern, *attrobj;
zend_bool is_id;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OOb", &id, dom_element_class_entry, &node, dom_attr_class_entry, &is_id) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
if (dom_node_is_read_only(nodep) == SUCCESS) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, dom_get_strict_error(intern->document));
RETURN_NULL();
}
DOM_GET_OBJ(attrp, node, xmlAttrPtr, attrobj);
if (attrp->parent != nodep) {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
} else {
php_set_attribute_id(attrp, is_id);
}
diff --git a/ext/dom/entity.c b/ext/dom/entity.c
index e0625fdd72..07c2b0cab3 100644
--- a/ext/dom/entity.c
+++ b/ext/dom/entity.c
@@ -44,12 +44,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025
Since:
*/
-int dom_entity_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_public_id_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -69,12 +69,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E
Since:
*/
-int dom_entity_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_system_id_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -94,13 +94,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38
Since:
*/
-int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_notation_name_read(dom_object *obj, zval *retval)
{
xmlEntity *nodep = (xmlEntity *) dom_object_get_node(obj);
char *content;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -122,13 +122,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
Since: DOM Level 3
*/
-int dom_entity_actual_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_actual_encoding_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_actual_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_actual_encoding_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
@@ -140,13 +140,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding
Since: DOM Level 3
*/
-int dom_entity_encoding_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_encoding_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_encoding_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
@@ -158,13 +158,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version
Since: DOM Level 3
*/
-int dom_entity_version_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_entity_version_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
}
-int dom_entity_version_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_entity_version_write(dom_object *obj, zval *newval)
{
return SUCCESS;
}
diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c
index 1c3e60e4f1..9505654f9d 100644
--- a/ext/dom/entityreference.c
+++ b/ext/dom/entityreference.c
@@ -56,24 +56,24 @@ PHP_METHOD(domentityreference, __construct)
size_t name_len, name_valid;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
node = xmlNewReference(NULL, (xmlChar *) name);
if (!node) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -81,9 +81,9 @@ PHP_METHOD(domentityreference, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, node, (void *)intern);
}
}
/* }}} end DOMEntityReference::__construct */
diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c
index ab314851be..fb110345ff 100644
--- a/ext/dom/namednodemap.c
+++ b/ext/dom/namednodemap.c
@@ -83,7 +83,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E
Since:
*/
-int dom_namednodemap_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_namednodemap_length_read(dom_object *obj, zval *retval)
{
dom_nnodemap_object *objmap;
xmlAttrPtr curnode;
@@ -136,7 +136,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_namednodemap_class_entry, &named, &namedlen) == FAILURE) {
return;
}
@@ -210,7 +210,7 @@ PHP_FUNCTION(dom_namednodemap_item)
xmlNodePtr nodep, curnode;
int count;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_namednodemap_class_entry, &index) == FAILURE) {
return;
}
if (index >= 0) {
@@ -269,7 +269,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!s", &id, dom_namednodemap_class_entry, &uri, &urilen, &named, &namedlen) == FAILURE) {
return;
}
diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c
index 3f0b8e1640..9955cb1b6c 100644
--- a/ext/dom/namelist.c
+++ b/ext/dom/namelist.c
@@ -55,7 +55,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length
Since:
*/
-int dom_namelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_namelist_length_read(dom_object *obj, zval *retval)
{
ZVAL_STRING(retval, "TEST");
return SUCCESS;
diff --git a/ext/dom/node.c b/ext/dom/node.c
index b2079ffda2..a51cb52747 100644
--- a/ext/dom/node.c
+++ b/ext/dom/node.c
@@ -196,7 +196,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D095
Since:
*/
-int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_name_read(dom_object *obj, zval *retval)
{
xmlNode *nodep;
xmlNsPtr ns;
@@ -206,7 +206,7 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -259,7 +259,7 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
str = "#text";
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Node Type");
+ php_error_docref(NULL, E_WARNING, "Invalid Node Type");
}
if (str != NULL) {
@@ -283,13 +283,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68D080
Since:
*/
-int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_value_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -322,12 +322,12 @@ int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_node_value_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -336,7 +336,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
if (nodep->children) {
- node_list_unlink(nodep->children TSRMLS_CC);
+ node_list_unlink(nodep->children);
}
case XML_TEXT_NODE:
case XML_COMMENT_NODE:
@@ -362,14 +362,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558
Since:
*/
-int dom_node_node_type_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_node_type_read(dom_object *obj, zval *retval)
{
xmlNode *nodep;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -390,14 +390,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317
Since:
*/
-int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_parent_node_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *nodeparent;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -407,7 +407,7 @@ int dom_node_parent_node_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(nodeparent, retval, obj TSRMLS_CC);
+ php_dom_create_object(nodeparent, retval, obj);
return SUCCESS;
}
@@ -418,22 +418,22 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987
Since:
*/
-int dom_node_child_nodes_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_child_nodes_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
dom_object *intern;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (dom_node_children_valid(nodep) == FAILURE) {
ZVAL_NULL(retval);
} else {
- php_dom_create_interator(retval, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NODELIST);
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL);
}
return SUCCESS;
@@ -446,14 +446,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388
Since:
*/
-int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_first_child_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *first = NULL;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -466,7 +466,7 @@ int dom_node_first_child_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(first, retval, obj TSRMLS_CC);
+ php_dom_create_object(first, retval, obj);
return SUCCESS;
}
@@ -477,14 +477,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB
Since:
*/
-int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_last_child_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *last = NULL;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -497,7 +497,7 @@ int dom_node_last_child_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(last, retval, obj TSRMLS_CC);
+ php_dom_create_object(last, retval, obj);
return SUCCESS;
}
@@ -508,14 +508,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8
Since:
*/
-int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_previous_sibling_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *prevsib;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -525,7 +525,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
- php_dom_create_object(prevsib, retval, obj TSRMLS_CC);
+ php_dom_create_object(prevsib, retval, obj);
return SUCCESS;
}
@@ -536,14 +536,14 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F
Since:
*/
-int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_next_sibling_read(dom_object *obj, zval *retval)
{
xmlNode *nodep, *nextsib;
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -552,7 +552,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval *retval TSRMLS_DC)
return FAILURE;
}
- php_dom_create_object(nextsib, retval, obj TSRMLS_CC);
+ php_dom_create_object(nextsib, retval, obj);
return SUCCESS;
}
@@ -563,20 +563,20 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096
Since:
*/
-int dom_node_attributes_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_attributes_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
dom_object *intern;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
if (nodep->type == XML_ELEMENT_NODE) {
- php_dom_create_interator(retval, DOM_NAMEDNODEMAP TSRMLS_CC);
+ php_dom_create_interator(retval, DOM_NAMEDNODEMAP);
intern = Z_DOMOBJ_P(retval);
- dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
+ dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL);
} else {
ZVAL_NULL(retval);
}
@@ -591,13 +591,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc
Since:
*/
-int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_owner_document_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlDocPtr docp;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -611,7 +611,7 @@ int dom_node_owner_document_read(dom_object *obj, zval *retval TSRMLS_DC)
return FAILURE;
}
- php_dom_create_object((xmlNodePtr) docp, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) docp, retval, obj);
return SUCCESS;
}
@@ -622,13 +622,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSname
Since: DOM Level 2
*/
-int dom_node_namespace_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_namespace_uri_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -661,14 +661,14 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSPrefix
Since: DOM Level 2
*/
-int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_prefix_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlNsPtr ns;
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -695,7 +695,7 @@ int dom_node_prefix_read(dom_object *obj, zval *retval TSRMLS_DC)
}
-int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_prefix_write(dom_object *obj, zval *newval)
{
zend_string *str;
xmlNode *nodep, *nsnode = NULL;
@@ -706,7 +706,7 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -746,7 +746,7 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
if (ns == NULL) {
zend_string_release(str);
- php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document) TSRMLS_CC);
+ php_dom_throw_error(NAMESPACE_ERR, dom_get_strict_error(obj->document));
return FAILURE;
}
@@ -768,12 +768,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-NodeNSLocalN
Since: DOM Level 2
*/
-int dom_node_local_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_local_name_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -793,13 +793,13 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-baseURI
Since: DOM Level 3
*/
-int dom_node_base_uri_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_base_uri_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
xmlChar *baseuri;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -821,13 +821,13 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-textContent
Since: DOM Level 3
*/
-int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_node_text_content_read(dom_object *obj, zval *retval)
{
xmlNode *nodep = dom_object_get_node(obj);
char *str = NULL;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -843,14 +843,14 @@ int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_node_text_content_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
xmlChar *enc_str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -865,7 +865,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
-static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib, xmlNodePtr fragment, dom_object *intern, dom_object *childobj TSRMLS_DC) /* {{{ */
+static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib, xmlNodePtr nextsib, xmlNodePtr fragment, dom_object *intern, dom_object *childobj) /* {{{ */
{
xmlNodePtr newchild, node;
@@ -893,7 +893,7 @@ static xmlNodePtr _php_dom_insert_fragment(xmlNodePtr nodep, xmlNodePtr prevsib,
if (node->_private != NULL) {
childobj = node->_private;
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
}
if (node == fragment->last) {
@@ -921,7 +921,7 @@ PHP_FUNCTION(dom_node_insert_before)
dom_object *intern, *childobj, *refpobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|O!", &id, dom_node_class_entry, &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
return;
}
@@ -939,34 +939,34 @@ PHP_FUNCTION(dom_node_insert_before)
if (dom_node_is_read_only(parentp) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(parentp, child) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
if (child->doc != parentp->doc && child->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
+ php_error_docref(NULL, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && parentp->doc != NULL) {
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
if (ref != NULL) {
DOM_GET_OBJ(refp, ref, xmlNodePtr, refpobj);
if (refp->parent != parentp) {
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE;
}
@@ -1003,14 +1003,14 @@ PHP_FUNCTION(dom_node_insert_before)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
} else {
DOM_RET_OBJ(child, &ret, intern);
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(parentp, refp->prev, refp, child, intern, childobj);
}
if (new_child == NULL) {
@@ -1045,14 +1045,14 @@ PHP_FUNCTION(dom_node_insert_before)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
} else {
DOM_RET_OBJ(child, &ret, intern);
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(parentp, parentp->last, NULL, child, intern, childobj);
}
if (new_child == NULL) {
new_child = xmlAddChild(parentp, child);
@@ -1060,7 +1060,7 @@ PHP_FUNCTION(dom_node_insert_before)
}
if (NULL == new_child) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't add newnode as the previous sibling of refnode");
+ php_error_docref(NULL, E_WARNING, "Couldn't add newnode as the previous sibling of refnode");
RETURN_FALSE;
}
@@ -1084,7 +1084,7 @@ PHP_FUNCTION(dom_node_replace_child)
int ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OOO", &id, dom_node_class_entry, &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1106,17 +1106,17 @@ PHP_FUNCTION(dom_node_replace_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(newchild->parent != NULL && dom_node_is_read_only(newchild->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (newchild->doc != nodep->doc && newchild->doc != NULL) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(nodep, newchild) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
@@ -1137,7 +1137,7 @@ PHP_FUNCTION(dom_node_replace_child)
xmlUnlinkNode(oldchild);
- newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj TSRMLS_CC);
+ newchild = _php_dom_insert_fragment(nodep, prevsib, nextsib, newchild, intern, newchildobj);
if (newchild) {
dom_reconcile_ns(nodep->doc, newchild);
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(dom_node_replace_child)
if (newchild->doc == NULL && nodep->doc != NULL) {
xmlSetTreeDoc(newchild, nodep->doc);
newchildobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)newchildobj, NULL);
}
xmlReplaceNode(oldchild, newchild);
dom_reconcile_ns(nodep->doc, newchild);
@@ -1153,7 +1153,7 @@ PHP_FUNCTION(dom_node_replace_child)
DOM_RET_OBJ(oldchild, &ret, intern);
return;
} else {
- php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
}
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(dom_node_remove_child)
dom_object *intern, *childobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1186,13 +1186,13 @@ PHP_FUNCTION(dom_node_remove_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
children = nodep->children;
if (!children) {
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE;
}
@@ -1205,7 +1205,7 @@ PHP_FUNCTION(dom_node_remove_child)
children = children->next;
}
- php_dom_throw_error(NOT_FOUND_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NOT_FOUND_ERR, stricterror);
RETURN_FALSE
}
/* }}} end dom_node_remove_child */
@@ -1221,7 +1221,7 @@ PHP_FUNCTION(dom_node_append_child)
dom_object *intern, *childobj;
int ret, stricterror;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1237,28 +1237,28 @@ PHP_FUNCTION(dom_node_append_child)
if (dom_node_is_read_only(nodep) == SUCCESS ||
(child->parent != NULL && dom_node_is_read_only(child->parent) == SUCCESS)) {
- php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(NO_MODIFICATION_ALLOWED_ERR, stricterror);
RETURN_FALSE;
}
if (dom_hierarchy(nodep, child) == FAILURE) {
- php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror);
RETURN_FALSE;
}
if (!(child->doc == NULL || child->doc == nodep->doc)) {
- php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror TSRMLS_CC);
+ php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror);
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
+ php_error_docref(NULL, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && nodep->doc != NULL) {
childobj->document = intern->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL);
}
if (child->parent != NULL){
@@ -1290,17 +1290,17 @@ PHP_FUNCTION(dom_node_append_child)
if (lastattr != NULL && lastattr->type != XML_ATTRIBUTE_DECL) {
if (lastattr != (xmlAttrPtr) child) {
xmlUnlinkNode((xmlNodePtr) lastattr);
- php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) lastattr);
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
- new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj TSRMLS_CC);
+ new_child = _php_dom_insert_fragment(nodep, nodep->last, NULL, child, intern, childobj);
}
if (new_child == NULL) {
new_child = xmlAddChild(nodep, child);
if (new_child == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't append node");
+ php_error_docref(NULL, E_WARNING, "Couldn't append node");
RETURN_FALSE;
}
}
@@ -1321,7 +1321,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1351,7 +1351,7 @@ PHP_FUNCTION(dom_node_clone_node)
dom_object *intern;
zend_long recursive = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
@@ -1410,13 +1410,13 @@ PHP_FUNCTION(dom_node_normalize)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
- dom_normalize(nodep TSRMLS_CC);
+ dom_normalize(nodep);
}
/* }}} end dom_node_normalize */
@@ -1431,7 +1431,7 @@ PHP_FUNCTION(dom_node_is_supported)
size_t feature_len, version_len;
char *feature, *version;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_node_class_entry, &feature, &feature_len, &version, &version_len) == FAILURE) {
return;
}
@@ -1453,7 +1453,7 @@ PHP_FUNCTION(dom_node_has_attributes)
xmlNode *nodep;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1490,7 +1490,7 @@ PHP_FUNCTION(dom_node_is_same_node)
xmlNodePtr nodeotherp, nodep;
dom_object *intern, *nodeotherobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_node_class_entry, &node, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1519,7 +1519,7 @@ PHP_FUNCTION(dom_node_lookup_prefix)
size_t uri_len = 0;
char *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1570,7 +1570,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
size_t uri_len = 0;
char *uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &id, dom_node_class_entry, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1603,7 +1603,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
size_t prefix_len;
char *prefix;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
return;
}
@@ -1682,13 +1682,13 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathObjectPtr xpathobjp=NULL;
if (mode == 0) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|bba!a!", &id, dom_node_class_entry, &exclusive, &with_comments,
&xpath_array, &ns_prefixes) == FAILURE) {
return;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Os|bba!a!", &id, dom_node_class_entry, &file, &file_len, &exclusive,
&with_comments, &xpath_array, &ns_prefixes) == FAILURE) {
return;
@@ -1700,7 +1700,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
docp = nodep->doc;
if (! docp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node must be associated with a document");
+ php_error_docref(NULL, E_WARNING, "Node must be associated with a document");
RETURN_FALSE;
}
@@ -1717,7 +1717,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeObject(xpathobjp);
}
xmlXPathFreeContext(ctxp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset.");
RETURN_FALSE;
}
}
@@ -1731,7 +1731,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
if (tmp && Z_TYPE_P(tmp) == IS_STRING) {
xquery = Z_STRVAL_P(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'query' missing from xpath array or is not a string");
+ php_error_docref(NULL, E_WARNING, "'query' missing from xpath array or is not a string");
RETURN_FALSE;
}
@@ -1761,7 +1761,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeObject(xpathobjp);
}
xmlXPathFreeContext(ctxp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "XPath query did not return a nodeset.");
+ php_error_docref(NULL, E_WARNING, "XPath query did not return a nodeset.");
RETURN_FALSE;
}
}
@@ -1780,7 +1780,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
} ZEND_HASH_FOREACH_END();
inclusive_ns_prefixes[nscount] = NULL;
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"Inclusive namespace prefixes only allowed in exclusive mode.");
}
}
diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c
index 15071739d2..fa67cc1041 100644
--- a/ext/dom/nodelist.c
+++ b/ext/dom/nodelist.c
@@ -51,7 +51,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337
Since:
*/
-int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_nodelist_length_read(dom_object *obj, zval *retval)
{
dom_nnodemap_object *objmap;
xmlNodePtr nodep, curnode;
@@ -114,7 +114,7 @@ PHP_FUNCTION(dom_nodelist_item)
xmlNodePtr nodep, curnode;
int count = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_nodelist_class_entry, &index) == FAILURE) {
return;
}
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index b26608adcf..cf4039f3ab 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -45,12 +45,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
Since:
*/
-int dom_notation_public_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_notation_public_id_read(dom_object *obj, zval *retval)
{
xmlEntityPtr nodep = (xmlEntityPtr) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -70,12 +70,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
Since:
*/
-int dom_notation_system_id_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_notation_system_id_read(dom_object *obj, zval *retval)
{
xmlEntityPtr nodep = (xmlEntityPtr) dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index c25cbaba58..6dd0f8e020 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -103,15 +103,15 @@ static HashTable dom_xpath_prop_handlers;
#endif
/* }}} */
-typedef int (*dom_read_t)(dom_object *obj, zval *retval TSRMLS_DC);
-typedef int (*dom_write_t)(dom_object *obj, zval *newval TSRMLS_DC);
+typedef int (*dom_read_t)(dom_object *obj, zval *retval);
+typedef int (*dom_write_t)(dom_object *obj, zval *newval);
typedef struct _dom_prop_handler {
dom_read_t read_func;
dom_write_t write_func;
} dom_prop_handler;
-static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
+static zend_object_handlers* dom_get_obj_handlers(void) {
return &dom_object_handlers;
}
@@ -206,7 +206,7 @@ static void dom_copy_doc_props(php_libxml_ref_obj *source_doc, php_libxml_ref_ob
}
}
-int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC)
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce)
{
dom_doc_propsptr doc_props;
@@ -228,7 +228,7 @@ int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece,
return SUCCESS;
}
-zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece TSRMLS_DC)
+zend_class_entry *dom_get_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece)
{
dom_doc_propsptr doc_props;
@@ -284,23 +284,23 @@ PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj)
/* }}} end php_dom_object_get_data */
/* {{{ dom_read_na */
-static int dom_read_na(dom_object *obj, zval *retval TSRMLS_DC)
+static int dom_read_na(dom_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property");
+ php_error_docref(NULL, E_ERROR, "Cannot read property");
return FAILURE;
}
/* }}} */
/* {{{ dom_write_na */
-static int dom_write_na(dom_object *obj, zval *newval TSRMLS_DC)
+static int dom_write_na(dom_object *obj, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property");
+ php_error_docref(NULL, E_ERROR, "Cannot write property");
return FAILURE;
}
/* }}} */
/* {{{ dom_register_prop_handler */
-static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func TSRMLS_DC)
+static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_read_t read_func, dom_write_t write_func)
{
dom_prop_handler hnd;
@@ -310,7 +310,7 @@ static void dom_register_prop_handler(HashTable *prop_handler, char *name, dom_r
}
/* }}} */
-static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -318,7 +318,7 @@ static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void
if (!obj->prop_handler || !zend_hash_exists(obj->prop_handler, member_str)) {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
zend_string_release(member_str);
@@ -327,7 +327,7 @@ static zval *dom_get_property_ptr_ptr(zval *object, zval *member, int type, void
/* }}} */
/* {{{ dom_read_property */
-zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -336,12 +336,12 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
if (obj->prop_handler != NULL) {
hnd = zend_hash_find_ptr(obj->prop_handler, member_str);
- } else if (instanceof_function(obj->std.ce, dom_node_class_entry TSRMLS_CC)) {
+ } else if (instanceof_function(obj->std.ce, dom_node_class_entry)) {
php_error(E_WARNING, "Couldn't fetch %s. Node no longer exists", obj->std.ce->name->val);
}
if (hnd) {
- int ret = hnd->read_func(obj, rv TSRMLS_CC);
+ int ret = hnd->read_func(obj, rv);
if (ret == SUCCESS) {
retval = rv;
} else {
@@ -349,7 +349,7 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
zend_string_release(member_str);
@@ -358,7 +358,7 @@ zval *dom_read_property(zval *object, zval *member, int type, void **cache_slot,
/* }}} */
/* {{{ dom_write_property */
-void dom_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void dom_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -368,10 +368,10 @@ void dom_write_property(zval *object, zval *member, zval *value, void **cache_sl
hnd = zend_hash_find_ptr(obj->prop_handler, member_str);
}
if (hnd) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
zend_string_release(member_str);
@@ -379,7 +379,7 @@ void dom_write_property(zval *object, zval *member, zval *value, void **cache_sl
/* }}} */
/* {{{ dom_property_exists */
-static int dom_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int dom_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
dom_object *obj = Z_DOMOBJ_P(object);
zend_string *member_str = zval_get_string(member);
@@ -394,9 +394,9 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
if (check_empty == 2) {
retval = 1;
- } else if (hnd->read_func(obj, &tmp TSRMLS_CC) == SUCCESS) {
+ } else if (hnd->read_func(obj, &tmp) == SUCCESS) {
if (check_empty == 1) {
- retval = zend_is_true(&tmp TSRMLS_CC);
+ retval = zend_is_true(&tmp);
} else if (check_empty == 0) {
retval = (Z_TYPE(tmp) != IS_NULL);
}
@@ -404,7 +404,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->has_property(object, member, check_empty, cache_slot TSRMLS_CC);
+ retval = std_hnd->has_property(object, member, check_empty, cache_slot);
}
zend_string_release(member_str);
@@ -412,7 +412,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, void
}
/* }}} */
-static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp) /* {{{ */
{
dom_object *obj = Z_DOMOBJ_P(object);
HashTable *debug_info,
@@ -426,7 +426,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
ALLOC_HASHTABLE(debug_info);
- std_props = zend_std_get_properties(object TSRMLS_CC);
+ std_props = zend_std_get_properties(object);
zend_array_dup(debug_info, std_props);
if (!prop_handlers) {
@@ -442,7 +442,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
zend_string *string_key;
zend_ulong num_key;
- if (entry->read_func(obj, &value TSRMLS_CC) == FAILURE) {
+ if (entry->read_func(obj, &value) == FAILURE) {
continue;
}
@@ -465,13 +465,13 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
}
/* }}} */
-static HashTable* dom_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* dom_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
- return dom_get_debug_info_helper(object, is_temp TSRMLS_CC);
+ return dom_get_debug_info_helper(object, is_temp);
}
/* }}} */
-void *php_dom_export_node(zval *object TSRMLS_DC) /* {{{ */
+void *php_dom_export_node(zval *object) /* {{{ */
{
php_libxml_node_object *intern;
xmlNodePtr nodep = NULL;
@@ -494,33 +494,33 @@ PHP_FUNCTION(dom_import_simplexml)
php_libxml_node_object *nodeobj;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &node) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &node) == FAILURE) {
return;
}
nodeobj = (php_libxml_node_object *) ((char *) Z_OBJ_P(node) - Z_OBJ_HT_P(node)->offset);
- nodep = php_libxml_import_node(node TSRMLS_CC);
+ nodep = php_libxml_import_node(node);
if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) {
DOM_RET_OBJ((xmlNodePtr) nodep, &ret, (dom_object *)nodeobj);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
+ php_error_docref(NULL, E_WARNING, "Invalid Nodetype to import");
RETURN_NULL();
}
}
/* }}} */
-static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC);
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy);
-static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *dom_objects_store_clone_obj(zval *zobject) /* {{{ */
{
dom_object *intern = Z_DOMOBJ_P(zobject);
- dom_object *clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC);
+ dom_object *clone = dom_objects_set_class(intern->std.ce, 0);
- clone->std.handlers = dom_get_obj_handlers(TSRMLS_C);
- zend_objects_clone_members(&clone->std, &intern->std TSRMLS_CC);
+ clone->std.handlers = dom_get_obj_handlers();
+ zend_objects_clone_members(&clone->std, &intern->std);
- if (instanceof_function(intern->std.ce, dom_node_class_entry TSRMLS_CC)) {
+ if (instanceof_function(intern->std.ce, dom_node_class_entry)) {
xmlNodePtr node = (xmlNodePtr)dom_object_get_node(intern);
if (node != NULL) {
xmlNodePtr cloned_node = xmlDocCopyNode(node, node->doc, 1);
@@ -529,8 +529,8 @@ static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC) /* {{{
if (cloned_node->doc == node->doc) {
clone->document = intern->document;
}
- php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)clone, cloned_node->doc);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)clone, cloned_node, (void *)clone);
if (intern->document != clone->document) {
dom_copy_doc_props(intern->document, clone->document);
}
@@ -592,12 +592,12 @@ zend_module_entry dom_module_entry = { /* {{{ */
ZEND_GET_MODULE(dom)
#endif
-void dom_objects_free_storage(zend_object *object TSRMLS_DC);
-void dom_nnodemap_objects_free_storage(zend_object *object TSRMLS_DC);
-static zend_object *dom_objects_store_clone_obj(zval *zobject TSRMLS_DC);
-static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC);
+void dom_objects_free_storage(zend_object *object);
+void dom_nnodemap_objects_free_storage(zend_object *object);
+static zend_object *dom_objects_store_clone_obj(zval *zobject);
+static void dom_nnodemap_object_dtor(zend_object *object);
#if defined(LIBXML_XPATH_ENABLED)
-void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC);
+void dom_xpath_objects_free_storage(zend_object *object);
#endif
/* {{{ PHP_MINIT_FUNCTION(dom) */
@@ -625,26 +625,26 @@ PHP_MINIT_FUNCTION(dom)
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
- dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL;
- zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC);
REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry);
zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domstringlist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry);
zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namelist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry);
zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domimplementationlist_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry);
@@ -653,35 +653,35 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMNode", NULL, php_dom_node_class_functions, dom_node_class_entry);
zend_hash_init(&dom_node_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "childNodes", dom_node_child_nodes_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "firstChild", dom_node_first_child_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "lastChild", dom_node_last_child_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "previousSibling", dom_node_previous_sibling_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "nextSibling", dom_node_next_sibling_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "attributes", dom_node_attributes_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "prefix", dom_node_prefix_read, dom_node_prefix_write);
+ dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL);
+ dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write);
zend_hash_add_ptr(&classes, ce.name, &dom_node_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNameSpaceNode", NULL, NULL, dom_namespace_node_class_entry);
zend_hash_init(&dom_namespace_node_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeName", dom_node_node_name_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeValue", dom_node_node_value_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "nodeType", dom_node_node_type_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "prefix", dom_node_prefix_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "localName", dom_node_local_name_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL);
+ dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namespace_node_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMDocumentFragment", dom_node_class_entry, php_dom_documentfragment_class_functions, dom_documentfragment_class_entry);
@@ -689,80 +689,80 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMDocument", dom_node_class_entry, php_dom_document_class_functions, dom_document_class_entry);
zend_hash_init(&dom_document_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write TSRMLS_CC);
- dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_document_prop_handlers, "doctype", dom_document_doctype_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "implementation", dom_document_implementation_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "documentElement", dom_document_document_element_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "actualEncoding", dom_document_encoding_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "encoding", dom_document_encoding_read, dom_document_encoding_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlEncoding", dom_document_encoding_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "standalone", dom_document_standalone_read, dom_document_standalone_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlStandalone", dom_document_standalone_read, dom_document_standalone_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "version", dom_document_version_read, dom_document_version_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "xmlVersion", dom_document_version_read, dom_document_version_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "strictErrorChecking", dom_document_strict_error_checking_read, dom_document_strict_error_checking_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "documentURI", dom_document_document_uri_read, dom_document_document_uri_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "config", dom_document_config_read, NULL);
+ dom_register_prop_handler(&dom_document_prop_handlers, "formatOutput", dom_document_format_output_read, dom_document_format_output_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "validateOnParse", dom_document_validate_on_parse_read, dom_document_validate_on_parse_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "resolveExternals", dom_document_resolve_externals_read, dom_document_resolve_externals_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "preserveWhiteSpace", dom_document_preserve_whitespace_read, dom_document_preserve_whitespace_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "recover", dom_document_recover_read, dom_document_recover_write);
+ dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write);
zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_document_prop_handlers);
INIT_CLASS_ENTRY(ce, "DOMNodeList", php_dom_nodelist_class_functions);
ce.create_object = dom_nnodemap_objects_new;
- dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_nodelist_class_entry = zend_register_internal_class_ex(&ce, NULL);
dom_nodelist_class_entry->get_iterator = php_dom_get_iterator;
- zend_class_implements(dom_nodelist_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(dom_nodelist_class_entry, 1, zend_ce_traversable);
zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_nodelist_prop_handlers);
INIT_CLASS_ENTRY(ce, "DOMNamedNodeMap", php_dom_namednodemap_class_functions);
ce.create_object = dom_nnodemap_objects_new;
- dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_namednodemap_class_entry = zend_register_internal_class_ex(&ce, NULL);
dom_namednodemap_class_entry->get_iterator = php_dom_get_iterator;
- zend_class_implements(dom_namednodemap_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(dom_namednodemap_class_entry, 1, zend_ce_traversable);
zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_namednodemap_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMCharacterData", dom_node_class_entry, php_dom_characterdata_class_functions, dom_characterdata_class_entry);
zend_hash_init(&dom_characterdata_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write TSRMLS_CC);
- dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write);
+ dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL);
zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_characterdata_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMAttr", dom_node_class_entry, php_dom_attr_class_functions, dom_attr_class_entry);
zend_hash_init(&dom_attr_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "name", dom_attr_name_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "specified", dom_attr_specified_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "value", dom_attr_value_read, dom_attr_value_write);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL);
+ dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL);
zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_attr_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMElement", dom_node_class_entry, php_dom_element_class_functions, dom_element_class_entry);
zend_hash_init(&dom_element_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL);
+ dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL);
zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_element_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMText", dom_characterdata_class_entry, php_dom_text_class_functions, dom_text_class_entry);
zend_hash_init(&dom_text_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL);
zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_text_prop_handlers);
@@ -772,31 +772,31 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry);
zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL);
+ dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_typeinfo_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry);
zend_hash_init(&dom_domerror_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "severity", dom_domerror_severity_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "message", dom_domerror_message_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "type", dom_domerror_type_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL);
+ dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domerror_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry);
zend_hash_init(&dom_domlocator_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "lineNumber", dom_domlocator_line_number_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "columnNumber", dom_domlocator_column_number_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL);
+ dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_domlocator_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry);
@@ -806,32 +806,32 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMDocumentType", dom_node_class_entry, php_dom_documenttype_class_functions, dom_documenttype_class_entry);
zend_hash_init(&dom_documenttype_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "name", dom_documenttype_name_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "entities", dom_documenttype_entities_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "notations", dom_documenttype_notations_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "publicId", dom_documenttype_public_id_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL);
+ dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL);
zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_documenttype_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMNotation", dom_node_class_entry, php_dom_notation_class_functions, dom_notation_class_entry);
zend_hash_init(&dom_notation_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_notation_prop_handlers, "publicId", dom_notation_public_id_read, NULL);
+ dom_register_prop_handler(&dom_notation_prop_handlers, "systemId", dom_notation_system_id_read, NULL);
zend_hash_merge(&dom_notation_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_notation_prop_handlers);
REGISTER_DOM_CLASS(ce, "DOMEntity", dom_node_class_entry, php_dom_entity_class_functions, dom_entity_class_entry);
zend_hash_init(&dom_entity_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write TSRMLS_CC);
- dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "publicId", dom_entity_public_id_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "systemId", dom_entity_system_id_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "notationName", dom_entity_notation_name_read, NULL);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "actualEncoding", dom_entity_actual_encoding_read, dom_entity_actual_encoding_write);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "encoding", dom_entity_encoding_read, dom_entity_encoding_write);
+ dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write);
zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_entity_prop_handlers);
@@ -841,8 +841,8 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_DOM_CLASS(ce, "DOMProcessingInstruction", dom_node_class_entry, php_dom_processinginstruction_class_functions, dom_processinginstruction_class_entry);
zend_hash_init(&dom_processinginstruction_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL TSRMLS_CC);
- dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write TSRMLS_CC);
+ dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL);
+ dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write);
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, dom_copy_prop_handler, 0);
zend_hash_add_ptr(&classes, ce.name, &dom_processinginstruction_prop_handlers);
@@ -855,10 +855,10 @@ PHP_MINIT_FUNCTION(dom)
INIT_CLASS_ENTRY(ce, "DOMXPath", php_dom_xpath_class_functions);
ce.create_object = dom_xpath_objects_new;
- dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ dom_xpath_class_entry = zend_register_internal_class_ex(&ce, NULL);
zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, dom_dtor_prop_handler, 1);
- dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL TSRMLS_CC);
+ dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL);
zend_hash_add_ptr(&classes, ce.name, &dom_xpath_prop_handlers);
#endif
@@ -979,7 +979,7 @@ PHP_MSHUTDOWN_FUNCTION(dom) /* {{{ */
/* }}} */
/* {{{ node_list_unlink */
-void node_list_unlink(xmlNodePtr node TSRMLS_DC)
+void node_list_unlink(xmlNodePtr node)
{
dom_object *wrapper;
@@ -992,7 +992,7 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
} else {
if (node->type == XML_ENTITY_REF_NODE)
break;
- node_list_unlink(node->children TSRMLS_CC);
+ node_list_unlink(node->children);
switch (node->type) {
case XML_ATTRIBUTE_DECL:
@@ -1003,7 +1003,7 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
case XML_TEXT_NODE:
break;
default:
- node_list_unlink((xmlNodePtr) node->properties TSRMLS_CC);
+ node_list_unlink((xmlNodePtr) node->properties);
}
}
@@ -1015,15 +1015,15 @@ void node_list_unlink(xmlNodePtr node TSRMLS_DC)
#if defined(LIBXML_XPATH_ENABLED)
/* {{{ dom_xpath_objects_free_storage */
-void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC)
+void dom_xpath_objects_free_storage(zend_object *object)
{
dom_xpath_object *intern = php_xpath_obj_from_obj(object);
- zend_object_std_dtor(&intern->dom.std TSRMLS_CC);
+ zend_object_std_dtor(&intern->dom.std);
if (intern->dom.ptr != NULL) {
xmlXPathFreeContext((xmlXPathContextPtr) intern->dom.ptr);
- php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
}
if (intern->registered_phpfunctions) {
@@ -1040,7 +1040,7 @@ void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC)
#endif
/* {{{ dom_objects_free_storage */
-void dom_objects_free_storage(zend_object *object TSRMLS_DC)
+void dom_objects_free_storage(zend_object *object)
{
dom_object *intern = php_dom_obj_from_obj(object);
#if defined(__GNUC__) && __GNUC__ >= 3
@@ -1049,21 +1049,21 @@ void dom_objects_free_storage(zend_object *object TSRMLS_DC)
int retcount;
#endif
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node != NULL) {
if (((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) ((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) {
- php_libxml_node_decrement_resource((php_libxml_node_object *) intern TSRMLS_CC);
+ php_libxml_node_decrement_resource((php_libxml_node_object *) intern);
} else {
- php_libxml_decrement_node_ptr((php_libxml_node_object *) intern TSRMLS_CC);
- retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_node_ptr((php_libxml_node_object *) intern);
+ retcount = php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
}
intern->ptr = NULL;
}
}
/* }}} */
-void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC) /* {{{ */
+void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns) /* {{{ */
{
dom_nnodemap_object *mapptr = (dom_nnodemap_object *) intern->ptr;
@@ -1079,7 +1079,7 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml
}
/* }}} */
-static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy TSRMLS_DC) /* {{{ */
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool hash_copy) /* {{{ */
{
dom_object *intern = ecalloc(1, sizeof(dom_object) + sizeof(zval) * (class_type->default_properties_count - 1));
@@ -1090,7 +1090,7 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool
intern->prop_handler = zend_hash_find_ptr(&classes, base_class->name);
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
if (hash_copy) {
object_properties_init(&intern->std, class_type);
}
@@ -1100,17 +1100,17 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool
/* }}} */
/* {{{ dom_objects_new */
-zend_object *dom_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *dom_objects_new(zend_class_entry *class_type)
{
- dom_object *intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
- intern->std.handlers = dom_get_obj_handlers(TSRMLS_C);
+ dom_object *intern = dom_objects_set_class(class_type, 1);
+ intern->std.handlers = dom_get_obj_handlers();
return &intern->std;
}
/* }}} */
#if defined(LIBXML_XPATH_ENABLED)
-/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) */
-zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
+/* {{{ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type) */
+zend_object *dom_xpath_objects_new(zend_class_entry *class_type)
{
dom_xpath_object *intern = ecalloc(1, sizeof(dom_xpath_object) + sizeof(zval) * (class_type->default_properties_count - 1));
@@ -1120,7 +1120,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
intern->dom.prop_handler = &dom_xpath_prop_handlers;
intern->dom.std.handlers = &dom_xpath_object_handlers;
- zend_object_std_init(&intern->dom.std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->dom.std, class_type);
object_properties_init(&intern->dom.std, class_type);
return &intern->dom.std;
@@ -1128,7 +1128,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
/* }}} */
#endif
-static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC) /* {{{ */
+static void dom_nnodemap_object_dtor(zend_object *object) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
@@ -1152,22 +1152,22 @@ static void dom_nnodemap_object_dtor(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-void dom_nnodemap_objects_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+void dom_nnodemap_objects_free_storage(zend_object *object) /* {{{ */
{
dom_object *intern = php_dom_obj_from_obj(object);
- php_libxml_decrement_doc_ref((php_libxml_node_object *)intern TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *)intern);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
-zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type) /* {{{ */
{
dom_object *intern;
dom_nnodemap_object *objmap;
- intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
+ intern = dom_objects_set_class(class_type, 1);
intern->ptr = emalloc(sizeof(dom_nnodemap_object));
objmap = (dom_nnodemap_object *)intern->ptr;
ZVAL_UNDEF(&objmap->baseobj_zv);
@@ -1183,7 +1183,7 @@ zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC) /*
}
/* }}} */
-void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) /* {{{ */
+void php_dom_create_interator(zval *return_value, int ce_type) /* {{{ */
{
zend_class_entry *ce;
@@ -1198,7 +1198,7 @@ void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC) /* {{{
/* }}} */
/* {{{ php_dom_create_object */
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj TSRMLS_DC)
+PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj)
{
zend_class_entry *ce;
dom_object *intern;
@@ -1284,13 +1284,13 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d", obj->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported node type: %d", obj->type);
ZVAL_NULL(return_value);
return 0;
}
if (domobj && domobj->document) {
- ce = dom_get_doc_classmap(domobj->document, ce TSRMLS_CC);
+ ce = dom_get_doc_classmap(domobj->document, ce);
}
object_init_ex(return_value, ce);
@@ -1299,15 +1299,15 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu
if (domobj != NULL) {
intern->document = domobj->document;
}
- php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)intern, obj->doc);
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, obj, (void *)intern);
return 0;
}
/* }}} end php_domobject_new */
-void php_dom_create_implementation(zval *retval TSRMLS_DC) {
+void php_dom_create_implementation(zval *retval) {
object_init_ex(retval, dom_domimplementation_class_entry);
}
@@ -1374,8 +1374,8 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *l
/* }}} */
/* }}} end dom_element_get_elements_by_tag_name_ns_raw */
-/* {{{ void dom_normalize (xmlNodePtr nodep TSRMLS_DC) */
-void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
+/* {{{ void dom_normalize (xmlNodePtr nodep) */
+void dom_normalize (xmlNodePtr nodep)
{
xmlNodePtr child, nextp, newnextp;
xmlAttrPtr attr;
@@ -1393,7 +1393,7 @@ void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
xmlNodeAddContent(child, strContent);
xmlFree(strContent);
xmlUnlinkNode(nextp);
- php_libxml_node_free_resource(nextp TSRMLS_CC);
+ php_libxml_node_free_resource(nextp);
nextp = newnextp;
} else {
break;
@@ -1401,15 +1401,15 @@ void dom_normalize (xmlNodePtr nodep TSRMLS_DC)
}
break;
case XML_ELEMENT_NODE:
- dom_normalize (child TSRMLS_CC);
+ dom_normalize (child);
attr = child->properties;
while (attr != NULL) {
- dom_normalize((xmlNodePtr) attr TSRMLS_CC);
+ dom_normalize((xmlNodePtr) attr);
attr = attr->next;
}
break;
case XML_ATTRIBUTE_NODE:
- dom_normalize (child TSRMLS_CC);
+ dom_normalize (child);
break;
default:
break;
@@ -1544,7 +1544,7 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) {
}
/* }}} end dom_get_nsdecl */
-zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
zval offset_copy;
@@ -1559,14 +1559,14 @@ zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv
return rv;
} /* }}} end dom_nodelist_read_dimension */
-int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC)
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty)
{
zend_long offset = zval_get_long(member);
if (offset < 0) {
return 0;
} else {
- zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC);
+ zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0);
return length && offset < Z_LVAL_P(length);
}
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index 02eb2d9509..bb4aa160e6 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -99,45 +99,45 @@ typedef struct {
dom_object *dom_object_get_data(xmlNodePtr obj);
dom_doc_propsptr dom_get_doc_props(php_libxml_ref_obj *document);
-zend_object *dom_objects_new(zend_class_entry *class_type TSRMLS_DC);
-zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_DC);
+zend_object *dom_objects_new(zend_class_entry *class_type);
+zend_object *dom_nnodemap_objects_new(zend_class_entry *class_type);
#if defined(LIBXML_XPATH_ENABLED)
-zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC);
+zend_object *dom_xpath_objects_new(zend_class_entry *class_type);
#endif
int dom_get_strict_error(php_libxml_ref_obj *document);
-void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC);
-void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC);
-void node_list_unlink(xmlNodePtr node TSRMLS_DC);
+void php_dom_throw_error(int error_code, int strict_error);
+void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error);
+void node_list_unlink(xmlNodePtr node);
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len);
xmlNsPtr dom_get_ns(xmlNodePtr node, char *uri, int *errorcode, char *prefix);
void dom_set_old_ns(xmlDoc *doc, xmlNs *ns);
xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName);
-void dom_normalize (xmlNodePtr nodep TSRMLS_DC);
+void dom_normalize (xmlNodePtr nodep);
xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *local, int *cur, int index);
-void php_dom_create_implementation(zval *retval TSRMLS_DC);
+void php_dom_create_implementation(zval *retval);
int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child);
int dom_has_feature(char *feature, char *version);
int dom_node_is_read_only(xmlNodePtr node);
int dom_node_children_valid(xmlNodePtr node);
-void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC);
-void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC);
+void php_dom_create_interator(zval *return_value, int ce_type);
+void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns);
xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID);
xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index);
xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index);
-zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
-int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC);
-zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC);
-int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC);
+zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
+int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce);
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type, zval *rv);
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = dom_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+entry = zend_register_internal_class_ex(&ce, parent_ce);
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_DOMOBJ_P(__id); \
if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name->val);\
RETURN_NULL();\
} \
}
@@ -148,7 +148,7 @@ entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
}
#define DOM_NOT_IMPLEMENTED() \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); \
+ php_error_docref(NULL, E_WARNING, "Not yet implemented"); \
return;
#define DOM_NODELIST 0
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c
index a42cc9508b..df66fb0bef 100644
--- a/ext/dom/processinginstruction.c
+++ b/ext/dom/processinginstruction.c
@@ -58,33 +58,33 @@ PHP_METHOD(domprocessinginstruction, __construct)
int name_valid;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
- php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_CHARACTER_ERR, 1);
RETURN_FALSE;
}
nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(id);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
/* }}} end DOMProcessingInstruction::__construct */
@@ -93,12 +93,12 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1478689192
Since:
*/
-int dom_processinginstruction_target_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_processinginstruction_target_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -114,7 +114,7 @@ readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-837822393
Since:
*/
-int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_processinginstruction_data_read(dom_object *obj, zval *retval)
{
xmlNodePtr nodep;
xmlChar *content;
@@ -122,7 +122,7 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
nodep = dom_object_get_node(obj);
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -136,13 +136,13 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
return SUCCESS;
}
-int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC)
+int dom_processinginstruction_data_write(dom_object *obj, zval *newval)
{
xmlNode *nodep = dom_object_get_node(obj);
zend_string *str;
if (nodep == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
diff --git a/ext/dom/text.c b/ext/dom/text.c
index 1cefa665aa..fc5f2d50e0 100644
--- a/ext/dom/text.c
+++ b/ext/dom/text.c
@@ -72,17 +72,17 @@ PHP_METHOD(domtext, __construct)
size_t value_len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
nodep = xmlNewText((xmlChar *) value);
if (!nodep) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -90,9 +90,9 @@ PHP_METHOD(domtext, __construct)
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
- php_libxml_node_free_resource(oldnode TSRMLS_CC);
+ php_libxml_node_free_resource(oldnode );
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern);
}
}
/* }}} end DOMText::__construct */
@@ -102,7 +102,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-wholeText
Since: DOM Level 3
*/
-int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_text_whole_text_read(dom_object *obj, zval *retval)
{
xmlNodePtr node;
xmlChar *wholetext = NULL;
@@ -110,7 +110,7 @@ int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
node = dom_object_get_node(obj);
if (node == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 0);
return FAILURE;
}
@@ -153,7 +153,7 @@ PHP_FUNCTION(dom_text_split_text)
int length;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &id, dom_text_class_entry, &offset) == FAILURE) {
return;
}
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
@@ -194,7 +194,7 @@ PHP_FUNCTION(dom_text_split_text)
nnode->type = XML_TEXT_NODE;
}
- php_dom_create_object(nnode, return_value, intern TSRMLS_CC);
+ php_dom_create_object(nnode, return_value, intern);
}
/* }}} end dom_text_split_text */
@@ -208,7 +208,7 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content)
xmlNodePtr node;
dom_object *intern;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_text_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &id, dom_text_class_entry) == FAILURE) {
return;
}
DOM_GET_OBJ(node, id, xmlNodePtr, intern);
diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c
index 5267ee6f77..49dddfafcd 100644
--- a/ext/dom/typeinfo.c
+++ b/ext/dom/typeinfo.c
@@ -46,7 +46,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeName
Since:
*/
-int dom_typeinfo_type_name_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_typeinfo_type_name_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
@@ -59,7 +59,7 @@ readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#TypeInfo-typeNamespace
Since:
*/
-int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_typeinfo_type_namespace_read(dom_object *obj, zval *retval)
{
ZVAL_NULL(retval);
return SUCCESS;
diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h
index 9d5ffe8fb6..9fad36d005 100644
--- a/ext/dom/xml_common.h
+++ b/ext/dom/xml_common.h
@@ -59,7 +59,7 @@ static inline dom_object *php_dom_obj_from_obj(zend_object *obj) {
PHP_DOM_EXPORT extern zend_class_entry *dom_node_class_entry;
PHP_DOM_EXPORT dom_object *php_dom_object_get_data(xmlNodePtr obj);
-PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj TSRMLS_DC);
+PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval* return_value, dom_object *domobj);
PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define DOM_XMLNS_NAMESPACE \
@@ -68,7 +68,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
#define NODE_GET_OBJ(__ptr, __id, __prtype, __intern) { \
__intern = Z_LIBXML_NODE_P(__id); \
if (__intern->node == NULL || !(__ptr = (__prtype)__intern->node->node)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", \
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", \
__intern->std.ce->name->val);\
RETURN_NULL();\
} \
@@ -78,18 +78,18 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
__intern = Z_LIBXML_NODE_P(__id); \
if (__intern->document != NULL) { \
if (!(__ptr = (__prtype)__intern->document->ptr)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", __intern->std.ce->name);\
RETURN_NULL();\
} \
} \
}
#define DOM_RET_OBJ(obj, ret, domobject) \
- *ret = php_dom_create_object(obj, return_value, domobject TSRMLS_CC)
+ *ret = php_dom_create_object(obj, return_value, domobject)
#define DOM_GET_THIS(zval) \
if (NULL == (zval = getThis())) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Underlying object missing"); \
+ php_error_docref(NULL, E_WARNING, "Underlying object missing"); \
RETURN_FALSE; \
}
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 336365e342..c957916156 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -83,9 +83,8 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
zend_string *callable = NULL;
dom_xpath_object *intern;
- TSRMLS_FETCH();
- if (! zend_is_executing(TSRMLS_C)) {
+ if (! zend_is_executing()) {
xmlGenericError(xmlGenericErrorContext,
"xmlExtFunctionTest: Function called from outside of PHP\n");
error = 1;
@@ -159,7 +158,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
node->parent = nsparent;
node->ns = curns;
}
- php_dom_create_object(node, &child, &intern->dom TSRMLS_CC);
+ php_dom_create_object(node, &child, &intern->dom);
add_next_index_zval(&fci.params[i], &child);
}
}
@@ -176,7 +175,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
+ php_error_docref(NULL, E_WARNING, "Handler name must be a string");
xmlXPathFreeObject(obj);
if (fci.param_count > 0) {
for (i = 0; i < nargs - 1; i++) {
@@ -194,16 +193,16 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
fci.retval = &retval;
fci.no_separation = 0;
- if (!zend_make_callable(&fci.function_name, &callable TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable->val);
+ if (!zend_make_callable(&fci.function_name, &callable)) {
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", callable->val);
} else if (intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'.", callable->val);
+ php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'.", callable->val);
/* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
- if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry TSRMLS_CC)) {
+ if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry)) {
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
@@ -218,7 +217,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
} else if (Z_TYPE(retval) == IS_FALSE || Z_TYPE(retval) == IS_TRUE) {
valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE));
} else if (Z_TYPE(retval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
+ php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
zend_string *str = zval_get_string(&retval);
@@ -261,18 +260,18 @@ PHP_METHOD(domxpath, __construct)
xmlXPathContextPtr ctx, oldctx;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling TSRMLS_CC);
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, dom_domexception_class_entry, &error_handling);
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj);
ctx = xmlXPathNewContext(docp);
if (ctx == NULL) {
- php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
+ php_dom_throw_error(INVALID_STATE_ERR, 1);
RETURN_FALSE;
}
@@ -280,7 +279,7 @@ PHP_METHOD(domxpath, __construct)
if (intern != NULL) {
oldctx = (xmlXPathContextPtr)intern->dom.ptr;
if (oldctx != NULL) {
- php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom TSRMLS_CC);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
xmlXPathFreeContext(oldctx);
}
@@ -294,13 +293,13 @@ PHP_METHOD(domxpath, __construct)
intern->dom.ptr = ctx;
ctx->userData = (void *)intern;
intern->dom.document = docobj->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp);
}
}
/* }}} end DOMXPath::__construct */
/* {{{ document DOMDocument*/
-int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC)
+int dom_xpath_document_read(dom_object *obj, zval *retval)
{
xmlDoc *docp = NULL;
xmlXPathContextPtr ctx = (xmlXPathContextPtr) obj->ptr;
@@ -309,7 +308,7 @@ int dom_xpath_document_read(dom_object *obj, zval *retval TSRMLS_DC)
docp = (xmlDocPtr) ctx->doc;
}
- php_dom_create_object((xmlNodePtr) docp, retval, obj TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) docp, retval, obj);
return SUCCESS;
}
/* }}} */
@@ -323,7 +322,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
dom_xpath_object *intern;
unsigned char *prefix, *ns_uri;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oss", &id, dom_xpath_class_entry, &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
@@ -331,7 +330,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
ctxp = (xmlXPathContextPtr) intern->dom.ptr;
if (ctxp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
@@ -365,7 +364,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
xmlNsPtr *ns = NULL;
zend_bool register_node_ns = 1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|O!b", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry, &register_node_ns) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|O!b", &id, dom_xpath_class_entry, &expr, &expr_len, &context, dom_node_class_entry, &register_node_ns) == FAILURE) {
return;
}
@@ -373,13 +372,13 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ctxp = (xmlXPathContextPtr) intern->dom.ptr;
if (ctxp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Context");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Context");
RETURN_FALSE;
}
docp = (xmlDocPtr) ctxp->doc;
if (docp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid XPath Document Pointer");
+ php_error_docref(NULL, E_WARNING, "Invalid XPath Document Pointer");
RETURN_FALSE;
}
@@ -392,7 +391,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
}
if (nodep && docp != nodep->doc) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node From Wrong Document");
+ php_error_docref(NULL, E_WARNING, "Node From Wrong Document");
RETURN_FALSE;
}
@@ -464,11 +463,11 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
node->parent = nsparent;
node->ns = curns;
}
- php_dom_create_object(node, &child, &intern->dom TSRMLS_CC);
+ php_dom_create_object(node, &child, &intern->dom);
add_next_index_zval(&retval, &child);
}
}
- php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
+ php_dom_create_interator(return_value, DOM_NODELIST);
nodeobj = Z_DOMOBJ_P(return_value);
dom_xpath_iter(&retval, nodeobj);
break;
@@ -519,7 +518,7 @@ PHP_FUNCTION(dom_xpath_register_php_functions)
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
intern = Z_XPATHOBJ_P(id);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(array_value));
while ((entry = zend_hash_get_current_data(Z_ARRVAL_P(array_value)))) {
@@ -532,7 +531,7 @@ PHP_FUNCTION(dom_xpath_register_php_functions)
intern->registerPhpFunctions = 2;
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
intern = Z_XPATHOBJ_P(id);
ZVAL_LONG(&new_string, 1);
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index ca33700982..d117fc167e 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -232,7 +232,7 @@ static void php_enchant_list_dicts_fn( const char * const lang_tag,
}
/* }}} */
-static void php_enchant_broker_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_enchant_broker_free(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
enchant_broker *broker = (enchant_broker *)rsrc->ptr;
@@ -263,7 +263,7 @@ static void php_enchant_broker_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_enchant_dict_free(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_enchant_dict_free(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
@@ -340,14 +340,14 @@ PHP_MINFO_FUNCTION(enchant)
#define PHP_ENCHANT_GET_BROKER \
ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, broker, -1, "enchant_broker", le_enchant_broker); \
if (!pbroker || !pbroker->pbroker) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \
+ php_error_docref(NULL, E_WARNING, "%s", "Resource broker invalid"); \
RETURN_FALSE; \
}
#define PHP_ENCHANT_GET_DICT \
ZEND_FETCH_RESOURCE(pdict, enchant_dict *, dict, -1, "enchant_dict", le_enchant_dict); \
if (!pdict || !pdict->pdict) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \
+ php_error_docref(NULL, E_WARNING, "%s", "Invalid dictionary resource."); \
RETURN_FALSE; \
}
@@ -383,7 +383,7 @@ PHP_FUNCTION(enchant_broker_free)
zval *broker;
enchant_broker *pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
@@ -401,7 +401,7 @@ PHP_FUNCTION(enchant_broker_get_error)
enchant_broker *pbroker;
char *msg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -426,7 +426,7 @@ PHP_FUNCTION(enchant_broker_set_dict_path)
char *value;
size_t value_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls", &broker, &dict_type, &value, &value_len) == FAILURE) {
RETURN_FALSE;
}
@@ -465,7 +465,7 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
zend_long dict_type;
char *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &broker, &dict_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &broker, &dict_type) == FAILURE) {
RETURN_FALSE;
}
@@ -515,7 +515,7 @@ PHP_FUNCTION(enchant_broker_list_dicts)
zval *broker;
enchant_broker *pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -538,14 +538,14 @@ PHP_FUNCTION(enchant_broker_request_dict)
size_t taglen;
int pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
if (taglen == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tag cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Tag cannot be empty");
RETURN_FALSE;
}
@@ -586,14 +586,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
size_t pwllen;
int pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &broker, &pwl, &pwllen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &broker, &pwl, &pwllen) == FAILURE) {
RETURN_FALSE;
}
#if PHP_API_VERSION < 20100412
- if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl)) {
#else
- if (php_check_open_basedir(pwl TSRMLS_CC)) {
+ if (php_check_open_basedir(pwl)) {
#endif
RETURN_FALSE;
}
@@ -631,7 +631,7 @@ PHP_FUNCTION(enchant_broker_free_dict)
zval *dict;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
@@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_dict_exists)
size_t taglen;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
@@ -677,7 +677,7 @@ PHP_FUNCTION(enchant_broker_set_ordering)
size_t ptaglen;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
RETURN_FALSE;
}
@@ -696,7 +696,7 @@ PHP_FUNCTION(enchant_broker_describe)
zval *broker;
enchant_broker * pbroker;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &broker) == FAILURE) {
RETURN_FALSE;
}
@@ -716,7 +716,7 @@ PHP_FUNCTION(enchant_dict_quick_check)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
RETURN_FALSE;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(enchant_dict_check)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -784,7 +784,7 @@ PHP_FUNCTION(enchant_dict_suggest)
int n_sugg;
size_t n_sugg_st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -814,7 +814,7 @@ PHP_FUNCTION(enchant_dict_add_to_personal)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -833,7 +833,7 @@ PHP_FUNCTION(enchant_dict_add_to_session)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -852,7 +852,7 @@ PHP_FUNCTION(enchant_dict_is_in_session)
size_t wordlen;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
@@ -875,7 +875,7 @@ PHP_FUNCTION(enchant_dict_store_replacement)
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
RETURN_FALSE;
}
@@ -893,7 +893,7 @@ PHP_FUNCTION(enchant_dict_get_error)
enchant_dict *pdict;
char *msg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
@@ -915,7 +915,7 @@ PHP_FUNCTION(enchant_dict_describe)
zval *dict;
enchant_dict *pdict;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &dict) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index c626fef5c7..7d478d682f 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -103,7 +103,7 @@ ZEND_GET_MODULE(ereg)
/* }}} */
/* {{{ ereg_lru_cmp */
-static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
+static int ereg_lru_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -121,7 +121,7 @@ static int ereg_lru_cmp(const void *a, const void *b TSRMLS_DC)
/* }}} */
/* {{{ static ereg_clean_cache */
-static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
+static int ereg_clean_cache(zval *data, void *arg)
{
int *num_clean = (int *)arg;
@@ -136,7 +136,7 @@ static int ereg_clean_cache(zval *data, void *arg TSRMLS_DC)
/* {{{ _php_regcomp
*/
-static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC)
+static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
{
int r = 0;
int patlen = strlen(pattern);
@@ -144,12 +144,12 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC
if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) {
/* easier than dealing with overflow as it happens */
- if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0 TSRMLS_CC) == FAILURE) {
+ if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0) == FAILURE) {
zend_hash_clean(&EREG(ht_rc));
EREG(lru_counter) = 0;
} else {
int num_clean = EREG_CACHE_SIZE / 4;
- zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean TSRMLS_CC);
+ zend_hash_apply_with_argument(&EREG(ht_rc), ereg_clean_cache, &num_clean);
}
}
@@ -215,7 +215,7 @@ static void _free_ereg_cache(zval *zv)
#undef regfree
#define regfree(a);
#undef regcomp
-#define regcomp(a, b, c) _php_regcomp(a, b, c TSRMLS_CC)
+#define regcomp(a, b, c) _php_regcomp(a, b, c)
/* {{{ PHP_GINIT_FUNCTION
*/
@@ -249,7 +249,7 @@ PHP_MINFO_FUNCTION(ereg)
/* {{{ php_ereg_eprint
* php_ereg_eprint - convert error number to name
*/
-static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
+static void php_ereg_eprint(int err, regex_t *re) {
char *buf = NULL, *message = NULL;
size_t len;
size_t buf_len;
@@ -279,7 +279,7 @@ static void php_ereg_eprint(int err, regex_t *re TSRMLS_DC) {
/* drop the message into place */
regerror(err, re, message + buf_len, len);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
}
if (buf) efree(buf);
@@ -305,7 +305,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
char *string = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
+ if (zend_parse_parameters(argc, "zs|z/", &regex, &findin, &findin_len, &array) == FAILURE) {
return;
}
@@ -331,7 +331,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -344,7 +344,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* actually execute the regular expression */
err = regexec(&re, string, re.re_nsub+1, subs, 0);
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
efree(subs);
RETURN_FALSE;
@@ -403,7 +403,7 @@ PHP_FUNCTION(eregi)
/* {{{ php_ereg_replace
* this is the meat and potatoes of regex replacement! */
-PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC)
+PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended)
{
regex_t re;
regmatch_t *subs;
@@ -427,7 +427,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regcomp(&re, pattern, copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
return ((char *) -1);
}
@@ -446,7 +446,7 @@ PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, co
err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0));
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
efree(subs);
efree(buf);
regfree(&re);
@@ -559,7 +559,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
zend_string *replace;
char *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzS", &arg_pattern, &arg_replace, &arg_string) == FAILURE) {
return;
}
@@ -596,7 +596,7 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
/* do the actual work */
- ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1 TSRMLS_CC);
+ ret = php_ereg_replace(pattern->val, replace->val, string->val, icase, 1);
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
@@ -637,7 +637,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
size_t spliton_len, str_len;
int err, size, copts = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
return;
}
@@ -650,7 +650,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
err = regcomp(&re, spliton, REG_EXTENDED | copts);
if (err) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
RETURN_FALSE;
}
@@ -667,7 +667,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* No more matches */
regfree(&re);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression");
+ php_error_docref(NULL, E_WARNING, "Invalid Regular Expression");
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -694,7 +694,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
/* see if we encountered an error */
if (err && err != REG_NOMATCH) {
- php_ereg_eprint(err, &re TSRMLS_CC);
+ php_ereg_eprint(err, &re);
regfree(&re);
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARR_P(return_value));
@@ -737,7 +737,7 @@ PHP_EREG_API PHP_FUNCTION(sql_regcase)
unsigned char c;
register int i, j;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &string, &string_len) == FAILURE) {
return;
}
diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h
index a1081e2669..4396fb9304 100644
--- a/ext/ereg/php_ereg.h
+++ b/ext/ereg/php_ereg.h
@@ -35,7 +35,7 @@ extern zend_module_entry ereg_module_entry;
# define PHP_EREG_API
#endif
-PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC);
+PHP_EREG_API char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended);
PHP_FUNCTION(ereg);
PHP_FUNCTION(eregi);
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 5d00672c5c..3a2d2fcb76 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -173,13 +173,13 @@ ZEND_INI_MH(OnUpdateEncode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
ZEND_INI_MH(OnUpdateDecode)
@@ -188,13 +188,13 @@ ZEND_INI_MH(OnUpdateDecode)
const zend_encoding **return_list;
size_t return_size;
if (FAILURE == zend_multibyte_parse_encoding_list(new_value->val, new_value->len,
- &return_list, &return_size, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
+ &return_list, &return_size, 0)) {
+ php_error_docref(NULL, E_WARNING, "Illegal encoding ignored: '%s'", new_value->val);
return FAILURE;
}
efree(return_list);
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
PHP_INI_BEGIN()
@@ -1003,7 +1003,7 @@ static const maker_note_type maker_note_array[] = {
/* {{{ exif_get_tagname
Get headername for tag_num or NULL if not defined */
-static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table TSRMLS_DC)
+static char * exif_get_tagname(int tag_num, char *ret, int len, tag_table_type tag_table)
{
int i, t;
char tmp[32];
@@ -1160,7 +1160,7 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
/* }}} */
#ifdef EXIF_DEBUG
-char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr TSRMLS_DC) /* {{{ */
+char * exif_dump_data(int *dump_free, int format, int components, int length, int motorola_intel, char *value_ptr) /* {{{ */
{
char *dump;
int len;
@@ -1235,7 +1235,7 @@ char * exif_dump_data(int *dump_free, int format, int components, int length, in
/* {{{ exif_convert_any_format
* Evaluate number, be it int, rational, or float from directory. */
-static double exif_convert_any_format(void *value, int format, int motorola_intel TSRMLS_DC)
+static double exif_convert_any_format(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1269,12 +1269,12 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (double)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return *(double *)value;
}
@@ -1284,7 +1284,7 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
/* {{{ exif_convert_any_to_int
* Evaluate number, be it int, rational, or float from directory. */
-static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel TSRMLS_DC)
+static size_t exif_convert_any_to_int(void *value, int format, int motorola_intel)
{
int s_den;
unsigned u_den;
@@ -1318,12 +1318,12 @@ static size_t exif_convert_any_to_int(void *value, int format, int motorola_inte
/* Not sure if this is correct (never seen float used in Exif format) */
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
+ php_error_docref(NULL, E_NOTICE, "Found value of type single");
#endif
return (size_t)*(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
+ php_error_docref(NULL, E_NOTICE, "Found value of type double");
#endif
return (size_t)*(double *)value;
}
@@ -1455,7 +1455,7 @@ static tag_table_type exif_get_tag_table(int section)
/* {{{ exif_get_sectionlist
Return list of sectionnames specified by sectionlist. Return value must be freed
*/
-static char *exif_get_sectionlist(int sectionlist TSRMLS_DC)
+static char *exif_get_sectionlist(int sectionlist)
{
int i, len, ml = 0;
char *sections;
@@ -1577,11 +1577,11 @@ static void exif_error_docref(const char *docref EXIFERR_DC, const image_info_ty
char *buf;
spprintf(&buf, 0, "%s(%d): %s", _file, _line, format);
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, buf, args);
efree(buf);
}
#else
- php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args TSRMLS_CC);
+ php_verror(docref, ImageInfo->FileName?ImageInfo->FileName:"", type, format, args);
#endif
va_end(args);
}
@@ -1627,7 +1627,7 @@ static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t s
/* {{{ exif_file_sections_realloc
Reallocate a file section returns 0 on success and -1 on failure
*/
-static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size TSRMLS_DC)
+static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_index, size_t size)
{
void *tmp;
@@ -1666,7 +1666,7 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
/* {{{ exif_iif_add_value
Add a value to image_info
*/
-static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
+static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel)
{
size_t idex;
void *vptr;
@@ -1773,13 +1773,13 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
case TAG_FMT_SINGLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type single");
+ php_error_docref(NULL, E_WARNING, "Found value of type single");
#endif
info_value->f = *(float *)value;
case TAG_FMT_DOUBLE:
#ifdef EXIF_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Found value of type double");
+ php_error_docref(NULL, E_WARNING, "Found value of type double");
#endif
info_value->d = *(double *)value;
break;
@@ -1794,16 +1794,16 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
/* {{{ exif_iif_add_tag
Add a tag from IFD to image_info
*/
-static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
+static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value)
{
- exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
+ exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel);
}
/* }}} */
/* {{{ exif_iif_add_int
Add an int value to image_info
*/
-static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value TSRMLS_DC)
+static void exif_iif_add_int(image_info_type *image_info, int section_index, char *name, int value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1825,7 +1825,7 @@ static void exif_iif_add_int(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value TSRMLS_DC)
+static void exif_iif_add_str(image_info_type *image_info, int section_index, char *name, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1848,7 +1848,7 @@ static void exif_iif_add_str(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_fmt
Add a format string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name TSRMLS_DC, char *value, ...)
+static void exif_iif_add_fmt(image_info_type *image_info, int section_index, char *name, char *value, ...)
{
char *tmp;
va_list arglist;
@@ -1856,7 +1856,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
va_start(arglist, value);
if (value) {
vspprintf(&tmp, 0, value, arglist);
- exif_iif_add_str(image_info, section_index, name, tmp TSRMLS_CC);
+ exif_iif_add_str(image_info, section_index, name, tmp);
efree(tmp);
}
va_end(arglist);
@@ -1866,7 +1866,7 @@ static void exif_iif_add_fmt(image_info_type *image_info, int section_index, cha
/* {{{ exif_iif_add_str
Add a string value to image_info MUST BE NUL TERMINATED
*/
-static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value TSRMLS_DC)
+static void exif_iif_add_buffer(image_info_type *image_info, int section_index, char *name, int length, char *value)
{
image_info_data *info_data;
image_info_data *list;
@@ -1938,7 +1938,7 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
/* {{{ add_assoc_image_info
* Add image_info to associative array value. */
-static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC)
+static void add_assoc_image_info(zval *value, int sub_array, image_info_type *image_info, int section_index)
{
char buffer[64], *val, *name, uname[64];
int i, ap, l, b, idx=0, unknown=0;
@@ -1950,7 +1950,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
zval tmpi, array;
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding %d infos from section %s", image_info->info_list[section_index].count, exif_get_sectionname(section_index));*/
#endif
if (image_info->info_list[section_index].count) {
if (sub_array) {
@@ -1970,7 +1970,7 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
name = uname;
}
#ifdef EXIF_DEBUG
-/* php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index) TSRMLS_CC), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:"<no data>"):exif_get_tagformat(info_data->format));*/
+/* php_error_docref(NULL, E_NOTICE, "Adding infos: tag(0x%04X,%12s,L=0x%04X): %s", info_tag, exif_get_tagname(info_tag, buffer, -12, exif_get_tag_table(section_index)), info_data->length, info_data->format==TAG_FMT_STRING?(info_value&&info_value->s?info_value->s:"<no data>"):exif_get_tagformat(info_data->format));*/
#endif
if (info_data->length==0) {
add_assoc_null(&tmpi, name);
@@ -2215,9 +2215,9 @@ static void add_assoc_image_info(zval *value, int sub_array, image_info_type *im
We want to print out the marker contents as legible text;
we must guard against random junk and varying newline representations.
*/
-static void exif_process_COM (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_COM (image_info_type *image_info, char *value, size_t length)
{
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2 TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length-2, value+2);
}
/* }}} */
@@ -2227,23 +2227,23 @@ static void exif_process_COM (image_info_type *image_info, char *value, size_t l
we must guard against random junk and varying newline representations.
*/
#ifdef EXIF_JPEG2000
-static void exif_process_CME (image_info_type *image_info, char *value, size_t length TSRMLS_DC)
+static void exif_process_CME (image_info_type *image_info, char *value, size_t length)
{
if (length>3) {
switch(value[2]) {
case 0:
- exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value TSRMLS_CC);
+ exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, length, value);
break;
case 1:
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_STRING, length, value);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Undefined JPEG2000 comment encoding");
+ php_error_docref(NULL, E_NOTICE, "Undefined JPEG2000 comment encoding");
break;
}
} else {
exif_iif_add_tag(image_info, SECTION_COMMENT, "Comment", TAG_COMPUTED_VALUE, TAG_FMT_UNDEFINED, 0, NULL);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "JPEG2000 comment section too small");
+ php_error_docref(NULL, E_NOTICE, "JPEG2000 comment section too small");
}
}
#endif
@@ -2279,8 +2279,8 @@ static void exif_process_SOFn (uchar *Data, int marker, jpeg_sof_info *result)
/* }}} */
/* forward declarations */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC);
-static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC);
+static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index);
+static int exif_process_IFD_TAG( image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table);
/* {{{ exif_get_markername
Get name of marker */
@@ -2343,11 +2343,11 @@ PHP_FUNCTION(exif_tagname)
zend_long tag;
char *szTemp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &tag) == FAILURE) {
return;
}
- szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD TSRMLS_CC);
+ szTemp = exif_get_tagname(tag, NULL, 0, tag_table_IFD);
if (tag < 0 || !szTemp || !szTemp[0]) {
RETURN_FALSE;
@@ -2359,7 +2359,7 @@ PHP_FUNCTION(exif_tagname)
/* {{{ exif_ifd_make_value
* Create a value for an ifd from an info_data pointer */
-static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel TSRMLS_DC) {
+static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel) {
size_t byte_count;
char *value_ptr, *data_ptr;
size_t i;
@@ -2435,7 +2435,7 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
/* {{{ exif_thumbnail_build
* Check and build thumbnail */
-static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
+static void exif_thumbnail_build(image_info_type *ImageInfo) {
size_t new_size, new_move, new_value;
char *new_data;
void *value_ptr;
@@ -2490,7 +2490,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
info_data = &info_list->list[i];
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
#ifdef EXIF_DEBUG
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD TSRMLS_CC), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail: process tag(x%04X=%s): %s%s (%d bytes)", info_data->tag, exif_get_tagname(info_data->tag, tagname, -12, tag_table_IFD), (info_data->length>1)&&info_data->format!=TAG_FMT_UNDEFINED&&info_data->format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(info_data->format), byte_count);
#endif
if (info_data->tag==TAG_STRIP_OFFSETS || info_data->tag==TAG_JPEG_INTERCHANGE_FORMAT) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
@@ -2501,7 +2501,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
php_ifd_set16u(new_data + 0, info_data->tag, ImageInfo->motorola_intel);
php_ifd_set16u(new_data + 2, info_data->format, ImageInfo->motorola_intel);
php_ifd_set32u(new_data + 4, info_data->length, ImageInfo->motorola_intel);
- value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel TSRMLS_CC);
+ value_ptr = exif_ifd_make_value(info_data, ImageInfo->motorola_intel);
if (byte_count <= 4) {
memmove(new_data+8, value_ptr, 4);
} else {
@@ -2527,7 +2527,7 @@ static void exif_thumbnail_build(image_info_type *ImageInfo TSRMLS_DC) {
/* {{{ exif_thumbnail_extract
* Grab the thumbnail, corrected */
-static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length TSRMLS_DC) {
+static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, size_t length) {
if (ImageInfo->Thumbnail.data) {
exif_error_docref("exif_read_data#error_mult_thumb" EXIFERR_CC, ImageInfo, E_WARNING, "Multiple possible thumbnails");
return; /* Should not happen */
@@ -2549,13 +2549,13 @@ static void exif_thumbnail_extract(image_info_type *ImageInfo, char *offset, siz
return;
}
ImageInfo->Thumbnail.data = estrndup(offset + ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
/* }}} */
/* {{{ exif_process_undefined
* Copy a string/buffer in Exif header to a character string and return length of allocated buffer if any. */
-static int exif_process_undefined(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_undefined(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we have to copy NUL
* chars up to byte_count, we also have to add a single NUL character to
* force end of string.
@@ -2589,7 +2589,7 @@ static int exif_process_string_raw(char **result, char *value, size_t byte_count
/* {{{ exif_process_string
* Copy a string in Exif header to a character string and return length of allocated buffer if any.
* In contrast to exif_process_string this function does always return a string buffer */
-static int exif_process_string(char **result, char *value, size_t byte_count TSRMLS_DC) {
+static int exif_process_string(char **result, char *value, size_t byte_count) {
/* we cannot use strlcpy - here the problem is that we cannot use strlen to
* determin length of string and we cannot use strlcpy with len=byte_count+1
* because then we might get into an EXCEPTION if we exceed an allocated
@@ -2598,7 +2598,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
* estrdup would sometimes allocate more memory and does not return length
*/
if ((byte_count=php_strnlen(value, byte_count)) > 0) {
- return exif_process_undefined(result, value, byte_count TSRMLS_CC);
+ return exif_process_undefined(result, value, byte_count);
}
(*result) = estrndup("", 1); /* force empty string */
return byte_count+1;
@@ -2607,7 +2607,7 @@ static int exif_process_string(char **result, char *value, size_t byte_count TSR
/* {{{ exif_process_user_comment
* Process UserComment in IFD. */
-static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoPtr, char **pszEncoding, char *szValuePtr, int ByteCount)
{
int a;
char *decode;
@@ -2642,8 +2642,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(decode TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(decode)
TSRMLS_CC) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
@@ -2663,8 +2663,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
&len,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_jis),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le)
TSRMLS_CC) == (size_t)-1) {
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
}
@@ -2685,14 +2685,14 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
}
/* normal text without encoding */
- exif_process_string(pszInfoPtr, szValuePtr, ByteCount TSRMLS_CC);
+ exif_process_string(pszInfoPtr, szValuePtr, ByteCount);
return strlen(*pszInfoPtr);
}
/* }}} */
/* {{{ exif_process_unicode
* Process unicode field in IFD. */
-static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
+static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount)
{
xp_field->tag = tag;
@@ -2702,8 +2702,8 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
&xp_field->size,
(unsigned char*)szValuePtr,
ByteCount,
- zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
- zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC)
+ zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
+ zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le)
TSRMLS_CC) == (size_t)-1) {
xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount);
}
@@ -2713,7 +2713,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
/* {{{ exif_process_IFD_in_MAKERNOTE
* Process nested IFDs directories in Maker Note. */
-static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
+static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement)
{
int de, i=0, section_index = SECTION_MAKERNOTE;
int NumDirEntries, old_motorola_intel, offset_diff;
@@ -2781,7 +2781,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table)) {
return FALSE;
}
}
@@ -2796,7 +2796,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
/* {{{ exif_process_IFD_TAG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC)
+static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table)
{
size_t length;
int tag, format, components;
@@ -2822,20 +2822,20 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (!format || format > NUM_FORMATS) {
/* (-1) catches illegal zero case as unsigned underflows to positive large. */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), format);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal format code 0x%04X, suppose BYTE", tag, exif_get_tagname(tag, tagname, -12, tag_table), format);
format = TAG_FMT_BYTE;
/*return TRUE;*/
}
if (components < 0) {
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), components);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal components(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), components);
return FALSE;
}
byte_count_signed = (int64_t)components * php_tiff_bytes_per_format[format];
if (byte_count_signed < 0 || (byte_count_signed > INT32_MAX)) {
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC));
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal byte_count", tag, exif_get_tagname(tag, tagname, -12, tag_table));
return FALSE;
}
@@ -2858,11 +2858,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
if (value_ptr < dir_entry) {
/* we can read this if offset_val > 0 */
/* some files have their values in other parts of the file */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, dir_entry);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X < x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, dir_entry);
} else {
/* this is for sure not allowed */
/* exception are IFD pointers */
- exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val, byte_count, offset_val+byte_count, IFDlength);
+ exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Process tag(x%04X=%s): Illegal pointer offset(x%04X + x%04X = x%04X > x%04X)", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val, byte_count, offset_val+byte_count, IFDlength);
}
return FALSE;
}
@@ -2904,8 +2904,8 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_ANY_TAG;
#ifdef EXIF_DEBUG
- dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr TSRMLS_CC);
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table TSRMLS_CC), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data);
+ dump_data = exif_dump_data(&dump_free, format, components, length, ImageInfo->motorola_intel, value_ptr);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname(tag, tagname, -12, tag_table), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data);
if (dump_free) {
efree(dump_data);
}
@@ -2916,18 +2916,18 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
switch(tag) {
case TAG_IMAGEWIDTH:
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.width = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_IMAGEHEIGHT:
case TAG_COMP_IMAGE_HEIGHT:
- ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.height = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_OFFSETS:
case TAG_JPEG_INTERCHANGE_FORMAT:
/* accept both formats */
- ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.offset = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_STRIP_BYTE_COUNTS:
@@ -2937,13 +2937,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* motorola is easier to read */
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_TIFF_MM;
}
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_JPEG_INTERCHANGE_FORMAT_LEN:
if (ImageInfo->Thumbnail.filetype == IMAGE_FILETYPE_UNKNOWN) {
ImageInfo->Thumbnail.filetype = IMAGE_FILETYPE_JPEG;
- ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Thumbnail.size = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
}
break;
}
@@ -2969,7 +2969,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_USERCOMMENT:
- ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count TSRMLS_CC);
+ ImageInfo->UserCommentLength = exif_process_user_comment(ImageInfo, &(ImageInfo->UserComment), &(ImageInfo->UserCommentEncoding), value_ptr, byte_count);
break;
case TAG_XP_TITLE:
@@ -2981,13 +2981,13 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
ImageInfo->sections_found |= FOUND_WINXP;
ImageInfo->xp_fields.list = tmp_xp;
ImageInfo->xp_fields.count++;
- exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count TSRMLS_CC);
+ exif_process_unicode(ImageInfo, &(ImageInfo->xp_fields.list[ImageInfo->xp_fields.count-1]), tag, value_ptr, byte_count);
break;
case TAG_FNUMBER:
/* Simplest way of expressing aperture, so I trust it the most.
(overwrite previously computed value if there is one) */
- ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ApertureFNumber = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_APERTURE:
@@ -2996,7 +2996,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
have appropriate aperture information yet. */
if (ImageInfo->ApertureFNumber == 0) {
ImageInfo->ApertureFNumber
- = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)*0.5);
+ = (float)exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)*0.5);
}
break;
@@ -3007,7 +3007,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
*/
if (ImageInfo->ExposureTime == 0) {
ImageInfo->ExposureTime
- = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)*log(2)));
+ = (float)(1/exp(exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)*log(2)));
}
break;
case TAG_EXPOSURETIME:
@@ -3015,21 +3015,21 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_COMP_IMAGE_WIDTH:
- ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->ExifImageWidth = exif_convert_any_to_int(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_X_RES:
- ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->FocalplaneXRes = exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_SUBJECT_DISTANCE:
/* Inidcates the distacne the autofocus camera is focused to.
Tends to be less accurate as distance increases. */
- ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC);
+ ImageInfo->Distance = (float)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel);
break;
case TAG_FOCALPLANE_RESOLUTION_UNIT:
- switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel TSRMLS_CC)) {
+ switch((int)exif_convert_any_format(value_ptr, format, ImageInfo->motorola_intel)) {
case 1: ImageInfo->FocalplaneUnits = 25.4; break; /* inch */
case 2:
/* According to the information I was using, 2 measn meters.
@@ -3061,7 +3061,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
break;
case TAG_MAKER_NOTE:
- exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC);
+ exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement);
break;
case TAG_EXIF_IFD_POINTER:
@@ -3098,7 +3098,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
return FALSE;
}
- if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index TSRMLS_CC)) {
+ if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index)) {
return FALSE;
}
#ifdef EXIF_DEBUG
@@ -3107,7 +3107,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
}
}
}
- exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table TSRMLS_CC), tag, format, components, value_ptr TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, section_index, exif_get_tagname(tag, tagname, sizeof(tagname), tag_table), tag, format, components, value_ptr);
EFREE_IF(outside);
return TRUE;
}
@@ -3115,7 +3115,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* {{{ exif_process_IFD_in_JPEG
* Process one of the nested IFDs directories. */
-static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC)
+static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index)
{
int de;
int NumDirEntries;
@@ -3136,7 +3136,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
for (de=0;de<NumDirEntries;de++) {
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
- offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index) TSRMLS_CC)) {
+ offset_base, IFDlength, displacement, section_index, 1, exif_get_tag_table(section_index))) {
return FALSE;
}
}
@@ -3161,7 +3161,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Expect next IFD to be thumbnail");
#endif
- if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL TSRMLS_CC)) {
+ if (exif_process_IFD_in_JPEG(ImageInfo, offset_base + NextDirOffset, offset_base, IFDlength, displacement, SECTION_THUMBNAIL)) {
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Thumbnail size: 0x%04X", ImageInfo->Thumbnail.size);
#endif
@@ -3170,7 +3170,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
&& ImageInfo->Thumbnail.offset
&& ImageInfo->read_thumbnail
) {
- exif_thumbnail_extract(ImageInfo, offset_base, IFDlength TSRMLS_CC);
+ exif_thumbnail_extract(ImageInfo, offset_base, IFDlength);
}
return TRUE;
} else {
@@ -3184,7 +3184,7 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
/* {{{ exif_process_TIFF_in_JPEG
Process a TIFF header in a JPEG file
*/
-static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
unsigned exif_value_2a, offset_of_ifd;
@@ -3212,7 +3212,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
ImageInfo->sections_found |= FOUND_IFD0;
/* First directory starts at offset 8. Offsets starts at 0. */
- exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0 TSRMLS_CC);
+ exif_process_IFD_in_JPEG(ImageInfo, CharBuf+offset_of_ifd, CharBuf, length/*-14*/, displacement, SECTION_IFD0);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process TIFF in JPEG done");
@@ -3229,7 +3229,7 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
Process an JPEG APP1 block marker
Describes all the drivel that most digital cameras include...
*/
-static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement TSRMLS_DC)
+static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t length, size_t displacement)
{
/* Check the APP1 for Exif Identifier Code */
static const uchar ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00};
@@ -3237,7 +3237,7 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Incorrect APP1 Exif Identifier Code");
return;
}
- exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8 TSRMLS_CC);
+ exif_process_TIFF_in_JPEG(ImageInfo, CharBuf + 8, length - 8, displacement+8);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process APP1/EXIF done");
#endif
@@ -3247,15 +3247,15 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, size_t
/* {{{ exif_process_APP12
Process an JPEG APP12 block marker used by OLYMPUS
*/
-static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length TSRMLS_DC)
+static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length)
{
size_t l1, l2=0;
if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2);
if (length > 2+l1+1) {
l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
- exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
+ exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1);
}
}
#ifdef EXIF_DEBUG
@@ -3266,7 +3266,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
/* {{{ exif_scan_JPEG_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_JPEG_header(image_info_type *ImageInfo)
{
int section, sn;
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
@@ -3374,7 +3374,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
return (ImageInfo->sections_found&(~FOUND_COMPUTED)) ? TRUE : FALSE;
case M_COM: /* Comment section */
- exif_process_COM(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_COM(ImageInfo, (char *)Data, itemlen);
break;
case M_EXIF:
@@ -3382,12 +3382,12 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/*ImageInfo->sections_found |= FOUND_EXIF;*/
/* Seen files from some 'U-lead' software with Vivitar scanner
that uses marker 31 later in the file (no clue what for!) */
- exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos TSRMLS_CC);
+ exif_process_APP1(ImageInfo, (char *)Data, itemlen, fpos);
}
break;
case M_APP12:
- exif_process_APP12(ImageInfo, (char *)Data, itemlen TSRMLS_CC);
+ exif_process_APP12(ImageInfo, (char *)Data, itemlen);
break;
@@ -3434,7 +3434,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_scan_thumbnail
* scan JPEG in thumbnail (memory) */
-static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_thumbnail(image_info_type *ImageInfo)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
@@ -3518,7 +3518,7 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
/* {{{ exif_process_IFD_in_TIFF
* Parse the TIFF header; */
-static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index TSRMLS_DC)
+static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offset, int section_index)
{
int i, sn, num_entries, sub_section_index = 0;
unsigned char *dir_entry;
@@ -3544,7 +3544,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X), IFD entries(%d)", ImageInfo->FileSize, dir_offset+2, dir_size-2, num_entries);
#endif
- if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, dir_size)) {
return FALSE;
}
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2);
@@ -3560,7 +3560,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
entry_tag = php_ifd_get16u(dir_entry+0, ImageInfo->motorola_intel);
entry_type = php_ifd_get16u(dir_entry+2, ImageInfo->motorola_intel);
if (entry_type > NUM_FORMATS) {
- exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table TSRMLS_CC), entry_type);
+ exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read from TIFF: tag(0x%04X,%12s): Illegal format code 0x%04X, switching to BYTE", entry_tag, exif_get_tagname(entry_tag, tagname, -12, tag_table), entry_type);
/* Since this is repeated in exif_process_IFD_TAG make it a notice here */
/* and make it a warning in the exif_process_IFD_TAG which is called */
/* elsewhere. */
@@ -3629,7 +3629,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Error in TIFF: filesize(x%04X) less than size of IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
return FALSE;
}
- if (exif_file_sections_realloc(ImageInfo, sn, ifd_size TSRMLS_CC)) {
+ if (exif_file_sections_realloc(ImageInfo, sn, ifd_size)) {
return FALSE;
}
/* read values not stored in directory itself */
@@ -3675,7 +3675,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index);
if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) {
if (ImageInfo->Thumbnail.filetype != IMAGE_FILETYPE_UNKNOWN
&& ImageInfo->Thumbnail.size
@@ -3692,7 +3692,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
}
}
@@ -3702,7 +3702,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
} else {
if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry,
(char*)(ImageInfo->file.list[sn].data-dir_offset),
- ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) {
+ ifd_size, 0, section_index, 0, tag_table)) {
return FALSE;
}
}
@@ -3715,7 +3715,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) at x%04X", next_offset);
#endif
ImageInfo->ifd_nesting_level++;
- exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL TSRMLS_CC);
+ exif_process_IFD_in_TIFF(ImageInfo, next_offset, SECTION_THUMBNAIL);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
#endif
@@ -3726,7 +3726,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
}
- exif_thumbnail_build(ImageInfo TSRMLS_CC);
+ exif_thumbnail_build(ImageInfo);
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
@@ -3750,7 +3750,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
/* {{{ exif_scan_FILE_header
* Parse the marker stream until SOS or EOI is seen; */
-static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
+static int exif_scan_FILE_header(image_info_type *ImageInfo)
{
unsigned char file_header[8];
int ret = FALSE;
@@ -3764,7 +3764,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
}
if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) {
ImageInfo->FileType = IMAGE_FILETYPE_JPEG;
- if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) {
+ if (exif_scan_JPEG_header(ImageInfo)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid JPEG file");
@@ -3782,7 +3782,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3796,7 +3796,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
ImageInfo->sections_found |= FOUND_IFD0;
if (exif_process_IFD_in_TIFF(ImageInfo,
php_ifd_get32u(file_header + 4, ImageInfo->motorola_intel),
- SECTION_IFD0 TSRMLS_CC)) {
+ SECTION_IFD0)) {
ret = TRUE;
} else {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF file");
@@ -3850,7 +3850,7 @@ static int exif_discard_imageinfo(image_info_type *ImageInfo)
/* {{{ exif_read_file
*/
-static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all TSRMLS_DC)
+static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_thumbnail, int read_all)
{
int ret;
zend_stat_t st;
@@ -3888,7 +3888,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
}
}
- base = php_basename(FileName, strlen(FileName), NULL, 0 TSRMLS_CC);
+ base = php_basename(FileName, strlen(FileName), NULL, 0);
ImageInfo->FileName = estrndup(base->val, base->len);
zend_string_release(base);
ImageInfo->read_thumbnail = read_thumbnail;
@@ -3906,7 +3906,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
ImageInfo->ifd_nesting_level = 0;
/* Scan the JPEG headers. */
- ret = exif_scan_FILE_header(ImageInfo TSRMLS_CC);
+ ret = exif_scan_FILE_header(ImageInfo);
php_stream_close(ImageInfo->infile);
return ret;
@@ -3925,7 +3925,7 @@ PHP_FUNCTION(exif_read_data)
image_info_type ImageInfo;
char tmp[64], *sections_str, *s;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbb", &p_name, &p_name_len, &p_sections_needed, &p_sections_needed_len, &sub_arrays, &read_thumbnail) == FAILURE) {
return;
}
@@ -3950,7 +3950,7 @@ PHP_FUNCTION(exif_read_data)
EFREE_IF(sections_str);
/* now see what we need */
#ifdef EXIF_DEBUG
- sections_str = exif_get_sectionlist(sections_needed TSRMLS_CC);
+ sections_str = exif_get_sectionlist(sections_needed);
if (!sections_str) {
RETURN_FALSE;
}
@@ -3959,8 +3959,8 @@ PHP_FUNCTION(exif_read_data)
#endif
}
- ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all TSRMLS_CC);
- sections_str = exif_get_sectionlist(ImageInfo.sections_found TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, read_thumbnail, read_all);
+ sections_str = exif_get_sectionlist(ImageInfo.sections_found);
#ifdef EXIF_DEBUG
if (sections_str)
@@ -3983,81 +3983,81 @@ PHP_FUNCTION(exif_read_data)
#endif
/* now we can add our information */
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType) TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "FileName", ImageInfo.FileName);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileDateTime", ImageInfo.FileDateTime);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileSize", ImageInfo.FileSize);
+ exif_iif_add_int(&ImageInfo, SECTION_FILE, "FileType", ImageInfo.FileType);
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "MimeType", (char*)php_image_type_to_mime_type(ImageInfo.FileType));
+ exif_iif_add_str(&ImageInfo, SECTION_FILE, "SectionsFound", sections_str ? sections_str : "NONE");
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Generate section COMPUTED");
#endif
if (ImageInfo.Width>0 && ImageInfo.Height>0) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" TSRMLS_CC, "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width TSRMLS_CC);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "html" , "width=\"%d\" height=\"%d\"", ImageInfo.Width, ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Height", ImageInfo.Height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Width", ImageInfo.Width);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "IsColor", ImageInfo.IsColor);
if (ImageInfo.motorola_intel != -1) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel);
}
if (ImageInfo.FocalLength) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength", "%4.1Fmm", ImageInfo.FocalLength);
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength", "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5));
}
}
if(ImageInfo.CCDWidth) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth" TSRMLS_CC, "%dmm", (int)ImageInfo.CCDWidth);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "CCDWidth", "%dmm", (int)ImageInfo.CCDWidth);
}
if(ImageInfo.ExposureTime>0) {
if(ImageInfo.ExposureTime <= 0.5) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime));
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime", "%0.3F s", ImageInfo.ExposureTime);
}
}
if(ImageInfo.ApertureFNumber) {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber", "f/%.1F", ImageInfo.ApertureFNumber);
}
if(ImageInfo.Distance) {
if(ImageInfo.Distance<0) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite");
} else {
- exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance);
+ exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "%0.2Fm", ImageInfo.Distance);
}
}
if (ImageInfo.UserComment) {
- exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment TSRMLS_CC);
+ exif_iif_add_buffer(&ImageInfo, SECTION_COMPUTED, "UserComment", ImageInfo.UserCommentLength, ImageInfo.UserComment);
if (ImageInfo.UserCommentEncoding && strlen(ImageInfo.UserCommentEncoding)) {
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "UserCommentEncoding", ImageInfo.UserCommentEncoding);
}
}
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright", ImageInfo.Copyright);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Photographer", ImageInfo.CopyrightPhotographer);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Copyright.Editor", ImageInfo.CopyrightEditor);
for (i=0; i<ImageInfo.xp_fields.count; i++) {
- exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP) TSRMLS_CC), ImageInfo.xp_fields.list[i].value TSRMLS_CC);
+ exif_iif_add_str(&ImageInfo, SECTION_WINXP, exif_get_tagname(ImageInfo.xp_fields.list[i].tag, NULL, 0, exif_get_tag_table(SECTION_WINXP)), ImageInfo.xp_fields.list[i].value);
}
if (ImageInfo.Thumbnail.size) {
if (read_thumbnail) {
/* not exif_iif_add_str : this is a buffer */
- exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data TSRMLS_CC);
+ exif_iif_add_tag(&ImageInfo, SECTION_THUMBNAIL, "THUMBNAIL", TAG_NONE, TAG_FMT_UNDEFINED, ImageInfo.Thumbnail.size, ImageInfo.Thumbnail.data);
}
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
/* try to evaluate if thumbnail data is present */
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype TSRMLS_CC);
- exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype) TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.FileType", ImageInfo.Thumbnail.filetype);
+ exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "Thumbnail.MimeType", (char*)php_image_type_to_mime_type(ImageInfo.Thumbnail.filetype));
}
if (ImageInfo.Thumbnail.width && ImageInfo.Thumbnail.height) {
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height TSRMLS_CC);
- exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width TSRMLS_CC);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height);
+ exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width);
}
EFREE_IF(sections_str);
@@ -4065,19 +4065,19 @@ PHP_FUNCTION(exif_read_data)
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos");
#endif
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL TSRMLS_CC);
- add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP TSRMLS_CC);
- add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE TSRMLS_CC);
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMPUTED );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0 );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_THUMBNAIL );
+ add_assoc_image_info(return_value, 1, &ImageInfo, SECTION_COMMENT );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP );
+ add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE );
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Discarding info");
@@ -4086,7 +4086,7 @@ PHP_FUNCTION(exif_read_data)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, Z_STRVAL_PP(p_name), E_NOTICE, "done");
+ php_error_docref1(NULL, Z_STRVAL_PP(p_name), E_NOTICE, "done");
#endif
}
/* }}} */
@@ -4107,11 +4107,11 @@ PHP_FUNCTION(exif_thumbnail)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(arg_c TSRMLS_CC, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
+ if (zend_parse_parameters(arg_c, "p|z/z/z/", &p_name, &p_name_len, &p_width, &p_height, &p_imagetype) == FAILURE) {
return;
}
- ret = exif_read_file(&ImageInfo, p_name, 1, 0 TSRMLS_CC);
+ ret = exif_read_file(&ImageInfo, p_name, 1, 0);
if (ret==FALSE) {
exif_discard_imageinfo(&ImageInfo);
RETURN_FALSE;
@@ -4132,7 +4132,7 @@ PHP_FUNCTION(exif_thumbnail)
ZVAL_STRINGL(return_value, ImageInfo.Thumbnail.data, ImageInfo.Thumbnail.size);
if (arg_c >= 3) {
if (!ImageInfo.Thumbnail.width || !ImageInfo.Thumbnail.height) {
- exif_scan_thumbnail(&ImageInfo TSRMLS_CC);
+ exif_scan_thumbnail(&ImageInfo);
}
zval_dtor(p_width);
zval_dtor(p_height);
@@ -4151,7 +4151,7 @@ PHP_FUNCTION(exif_thumbnail)
exif_discard_imageinfo(&ImageInfo);
#ifdef EXIF_DEBUG
- php_error_docref1(NULL TSRMLS_CC, p_name, E_NOTICE, "Done");
+ php_error_docref1(NULL, p_name, E_NOTICE, "Done");
#endif
}
/* }}} */
@@ -4165,7 +4165,7 @@ PHP_FUNCTION(exif_imagetype)
php_stream * stream;
int itype = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &imagefile, &imagefile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &imagefile, &imagefile_len) == FAILURE) {
return;
}
@@ -4175,7 +4175,7 @@ PHP_FUNCTION(exif_imagetype)
RETURN_FALSE;
}
- itype = php_getimagetype(stream, NULL TSRMLS_CC);
+ itype = php_getimagetype(stream, NULL);
php_stream_close(stream);
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 6879926eca..c89748c9e8 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -77,14 +77,14 @@ static inline finfo_object *php_finfo_fetch_object(zend_object *obj) {
finfo_object *obj = Z_FINFO_P(object); \
finfo = obj->ptr; \
if (!finfo) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The invalid fileinfo object."); \
+ php_error_docref(NULL, E_WARNING, "The invalid fileinfo object."); \
RETURN_FALSE; \
} \
}
/* {{{ finfo_objects_free
*/
-static void finfo_objects_free(zend_object *object TSRMLS_DC)
+static void finfo_objects_free(zend_object *object)
{
finfo_object *intern = php_finfo_fetch_object(object);
@@ -93,19 +93,19 @@ static void finfo_objects_free(zend_object *object TSRMLS_DC)
efree(intern->ptr);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
/* {{{ finfo_objects_new
*/
-PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type TSRMLS_DC)
+PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type)
{
finfo_object *intern;
intern = ecalloc(1, sizeof(finfo_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &finfo_object_handlers;
@@ -176,7 +176,7 @@ zend_function_entry finfo_class_functions[] = {
#define FINFO_SET_OPTION(magic, options) \
if (magic_setflags(magic, options) == -1) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%pd' %d:%s", \
+ php_error_docref(NULL, E_WARNING, "Failed to set option '%pd' %d:%s", \
options, magic_errno(magic), magic_error(magic)); \
RETURN_FALSE; \
}
@@ -185,7 +185,7 @@ zend_function_entry finfo_class_functions[] = {
static int le_fileinfo;
/* }}} */
-void finfo_resource_destructor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+void finfo_resource_destructor(zend_resource *rsrc) /* {{{ */
{
if (rsrc->ptr) {
php_fileinfo *finfo = (php_fileinfo *) rsrc->ptr;
@@ -217,7 +217,7 @@ PHP_MINIT_FUNCTION(finfo)
zend_class_entry _finfo_class_entry;
INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions);
_finfo_class_entry.create_object = finfo_objects_new;
- finfo_class_entry = zend_register_internal_class(&_finfo_class_entry TSRMLS_CC);
+ finfo_class_entry = zend_register_internal_class(&_finfo_class_entry);
/* copy the standard object handlers to you handler table */
memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
@@ -285,7 +285,7 @@ PHP_MINFO_FUNCTION(fileinfo)
#define FILEINFO_DESTROY_OBJECT(object) \
do { \
if (object) { \
- zend_object_store_ctor_failed(Z_OBJ_P(object) TSRMLS_CC); \
+ zend_object_store_ctor_failed(Z_OBJ_P(object)); \
Z_OBJ_P(object) = NULL; \
ZEND_CTOR_MAKE_NULL(); \
} \
@@ -302,7 +302,7 @@ PHP_FUNCTION(finfo_open)
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lp", &options, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lp", &options, &file, &file_len) == FAILURE) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -321,11 +321,11 @@ PHP_FUNCTION(finfo_open)
file = NULL;
} else if (file && *file) { /* user specified file, perform open_basedir checks */
- if (php_check_open_basedir(file TSRMLS_CC)) {
+ if (php_check_open_basedir(file)) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
- if (!expand_filepath_with_mode(file, resolved_path, NULL, 0, CWD_EXPAND TSRMLS_CC)) {
+ if (!expand_filepath_with_mode(file, resolved_path, NULL, 0, CWD_EXPAND)) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -339,13 +339,13 @@ PHP_FUNCTION(finfo_open)
if (finfo->magic == NULL) {
efree(finfo);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%pd'.", options);
+ php_error_docref(NULL, E_WARNING, "Invalid mode '%pd'.", options);
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
if (magic_load(finfo->magic, file) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
+ php_error_docref(NULL, E_WARNING, "Failed to load magic database at '%s'.", file);
magic_close(finfo->magic);
efree(finfo);
FILEINFO_DESTROY_OBJECT(object);
@@ -367,7 +367,7 @@ PHP_FUNCTION(finfo_close)
php_fileinfo *finfo;
zval *zfinfo;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfinfo) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zfinfo) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -388,12 +388,12 @@ PHP_FUNCTION(finfo_set_flags)
FILEINFO_DECLARE_INIT_OBJECT(object)
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &options) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zfinfo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zfinfo, &options) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -426,7 +426,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
if (mimetype_emu) {
/* mime_content_type(..) emulation */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &what) == FAILURE) {
return;
}
@@ -442,23 +442,23 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only process string or stream arguments");
+ php_error_docref(NULL, E_WARNING, "Can only process string or stream arguments");
RETURN_FALSE;
}
magic = magic_open(MAGIC_MIME_TYPE);
if (magic_load(magic, NULL) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database.");
+ php_error_docref(NULL, E_WARNING, "Failed to load magic database.");
goto common;
}
} else if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
magic = finfo->magic;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|lr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, php_fileinfo *, zfinfo, -1, "file_info", le_fileinfo);
@@ -504,12 +504,12 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
php_stream_statbuf ssb;
if (buffer == NULL || !*buffer) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty filename or path");
+ php_error_docref(NULL, E_WARNING, "Empty filename or path");
RETVAL_FALSE;
goto clean;
}
- wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
+ wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0);
if (wrap) {
php_stream *stream;
@@ -549,14 +549,14 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only process string or stream arguments");
+ php_error_docref(NULL, E_WARNING, "Can only process string or stream arguments");
}
common:
if (ret_val) {
RETVAL_STRING(ret_val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed identify data %d:%s", magic_errno(magic), magic_error(magic));
+ php_error_docref(NULL, E_WARNING, "Failed identify data %d:%s", magic_errno(magic), magic_error(magic));
RETVAL_FALSE;
}
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index b8e43b602d..2fe559f123 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -303,8 +303,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- if (f == NULL) {
+ php_stream *stream;
+
-+ TSRMLS_FETCH();
-+
+++
+ ms->file = fn;
+ stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
+
@@ -367,8 +366,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ php_stream *dir;
+ php_stream_dirent d;
+
-+ TSRMLS_FETCH();
-
++
memset(mset, 0, sizeof(mset));
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
@@ -551,8 +549,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- fd = -1;
- if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
+
-+ TSRMLS_FETCH();
-+
+++
+ if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
file_oomem(ms, sizeof(*map));
+ efree(map);
@@ -710,8 +707,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
uint32_t i;
+ php_stream *stream;
+
-+ TSRMLS_FETCH();
-
++
- dbname = mkdbname(ms, fn, 1);
+ dbname = mkdbname(ms, fn, 0);
@@ -771,8 +767,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
const char *p, *q;
char *buf;
-+ TSRMLS_FETCH();
-
++
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
@@ -2775,16 +2842,18 @@
@@ -1628,8 +1623,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
- ssize_t nch;
- struct stat tstatbuf;
-#endif
-+ TSRMLS_FETCH();
-
++
if (ms->flags & MAGIC_APPLE)
return 0;
- if (fn == NULL)
@@ -2082,8 +2076,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
- goto done;
+ if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
+ php_socket_t fd;
-+ TSRMLS_FETCH();
-+ if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
++ + if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
+ if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "cdf %d\n", m);
@@ -2177,8 +2170,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ zend_string *res;
+ zval repl;
+ int rep_cnt = 0;
-+ TSRMLS_FETCH();
-
++
(void)setlocale(LC_CTYPE, "C");
- rc = regcomp(&rx, pat, REG_EXTENDED);
- if (rc) {
@@ -2200,7 +2192,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+
+ opts |= PCRE_MULTILINE;
+ convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
+ zval_ptr_dtor(&patt);
+ rep_cnt = -1;
+ goto out;
@@ -2208,7 +2200,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+ zval_ptr_dtor(&patt);
+
+ ZVAL_STRING(&repl, rep);
-+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt TSRMLS_CC);
++ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt);
+
+ zval_ptr_dtor(&repl);
+ if (NULL == res) {
@@ -2432,8 +2424,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
- int ispipe = 0;
- off_t pos = (off_t)-1;
+ int no_in_stream = 0;
-+ TSRMLS_FETCH();
-+
+++
+ if (!inname && !stream) {
+ return NULL;
+ }
@@ -2790,8 +2781,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
{
va_list va;
+ char *expanded_format;
-+ TSRMLS_FETCH();
-
++
- /* cuz we use stdout for most, stderr here */
- (void) fflush(stdout);
-
@@ -2805,7 +2795,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
va_end(va);
- (void) fputc('\n', stderr);
+
-+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
++ php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format);
+
+ free(expanded_format);
}
@@ -3103,8 +3093,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ int re_options, rv = -1;
+ pcre_extra *re_extra;
+ zend_string *pattern;
-+ TSRMLS_FETCH();
-+
+++
if (strchr(m->desc, '%') == NULL)
return 0;
@@ -3115,7 +3104,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
- file_magerror(ms, "regex error %d, (%s)", rc, errmsg);
+ pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
-+ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
+ rv = -1;
} else {
- rc = regexec(&rx, m->desc, 0, 0, 0);
@@ -3380,8 +3369,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ zval pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
-+ TSRMLS_FETCH();
-+
++ +
+ options |= PCRE_MULTILINE;
+
+ if (m->str_flags & STRING_IGNORE_CASE) {
@@ -3391,7 +3379,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options);
+
+ l = v = 0;
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) {
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
+ zval_ptr_dtor(&pattern);
+ return -1;
+ } else {
@@ -3407,7 +3395,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ haystack = estrndup(ms->search.s, ms->search.s_len);
+
+ /* match v = 0, no match v = 1 */
-+ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
++ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0);
+ /* Free haystack */
+ efree(haystack);
+
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index c1dc5aa1fa..83eb1f44f7 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -960,7 +960,6 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
php_stream *stream;
- TSRMLS_FETCH();
ms->file = fn;
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
@@ -1151,7 +1150,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
php_stream *dir;
php_stream_dirent d;
- TSRMLS_FETCH();
memset(mset, 0, sizeof(mset));
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
@@ -2608,7 +2606,6 @@ apprentice_map(struct magic_set *ms, const char *fn)
php_stream_statbuf st;
- TSRMLS_FETCH();
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
file_oomem(ms, sizeof(*map));
@@ -2761,7 +2758,6 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
uint32_t i;
php_stream *stream;
- TSRMLS_FETCH();
dbname = mkdbname(ms, fn, 0);
@@ -2820,7 +2816,6 @@ mkdbname(struct magic_set *ms, const char *fn, int strip)
{
const char *p, *q;
char *buf;
- TSRMLS_FETCH();
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
diff --git a/ext/fileinfo/libmagic/fsmagic.c b/ext/fileinfo/libmagic/fsmagic.c
index a7b420ff5d..0f6f4acbdf 100644
--- a/ext/fileinfo/libmagic/fsmagic.c
+++ b/ext/fileinfo/libmagic/fsmagic.c
@@ -94,7 +94,6 @@ file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *
{
int ret, did = 0;
int mime = ms->flags & MAGIC_MIME;
- TSRMLS_FETCH();
if (ms->flags & MAGIC_APPLE)
return 0;
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c
index c7d9a7e4f1..81c5faaafb 100644
--- a/ext/fileinfo/libmagic/funcs.c
+++ b/ext/fileinfo/libmagic/funcs.c
@@ -221,8 +221,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
/* Check if we have a CDF file */
if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
php_socket_t fd;
- TSRMLS_FETCH();
- if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
+ if (stream && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **)&fd, 0)) {
if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "cdf %d\n", m);
@@ -445,13 +444,12 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zend_string *res;
zval repl;
int rep_cnt = 0;
- TSRMLS_FETCH();
(void)setlocale(LC_CTYPE, "C");
opts |= PCRE_MULTILINE;
convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
- if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
zval_ptr_dtor(&patt);
rep_cnt = -1;
goto out;
@@ -459,7 +457,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
zval_ptr_dtor(&patt);
ZVAL_STRING(&repl, rep);
- res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt TSRMLS_CC);
+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt);
zval_ptr_dtor(&repl);
if (NULL == res) {
diff --git a/ext/fileinfo/libmagic/magic.c b/ext/fileinfo/libmagic/magic.c
index 7f5cff6a7b..5aeb0084cb 100644
--- a/ext/fileinfo/libmagic/magic.c
+++ b/ext/fileinfo/libmagic/magic.c
@@ -353,7 +353,6 @@ file_or_stream(struct magic_set *ms, const char *inname, php_stream *stream)
zend_stat_t sb;
ssize_t nbytes = 0; /* number of bytes read from a datafile */
int no_in_stream = 0;
- TSRMLS_FETCH();
if (!inname && !stream) {
return NULL;
diff --git a/ext/fileinfo/libmagic/print.c b/ext/fileinfo/libmagic/print.c
index eb4e6e8ce4..7e4a812818 100644
--- a/ext/fileinfo/libmagic/print.c
+++ b/ext/fileinfo/libmagic/print.c
@@ -60,13 +60,12 @@ file_magwarn(struct magic_set *ms, const char *f, ...)
{
va_list va;
char *expanded_format;
- TSRMLS_FETCH();
va_start(va, f);
if (vasprintf(&expanded_format, f, va)); /* silence */
va_end(va);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
+ php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format);
free(expanded_format);
}
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index e626929c9e..727446b81a 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -360,14 +360,13 @@ check_fmt(struct magic_set *ms, struct magic *m)
int re_options, rv = -1;
pcre_extra *re_extra;
zend_string *pattern;
- TSRMLS_FETCH();
if (strchr(m->desc, '%') == NULL)
return 0;
(void)setlocale(LC_CTYPE, "C");
pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
- if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options)) == NULL) {
rv = -1;
} else {
rv = !pcre_exec(pce, re_extra, m->desc, strlen(m->desc), 0, re_options, NULL, 0);
@@ -2079,8 +2078,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
zval pattern;
int options = 0;
pcre_cache_entry *pce;
- TSRMLS_FETCH();
-
+
options |= PCRE_MULTILINE;
if (m->str_flags & STRING_IGNORE_CASE) {
@@ -2090,7 +2088,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options);
l = v = 0;
- if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern))) == NULL) {
zval_ptr_dtor(&pattern);
return -1;
} else {
@@ -2106,7 +2104,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
haystack = estrndup(ms->search.s, ms->search.s_len);
/* match v = 0, no match v = 1 */
- php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
+ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0);
/* Free haystack */
efree(haystack);
diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c
index 5a0ea0777d..dc61bbffc7 100644
--- a/ext/filter/callback_filter.c
+++ b/ext/filter/callback_filter.c
@@ -26,8 +26,8 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
zval *args;
int status;
- if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
+ if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
+ php_error_docref(NULL, E_WARNING, "First argument is expected to be a valid callback");
zval_ptr_dtor(value);
ZVAL_NULL(value);
return;
@@ -35,7 +35,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
args = safe_emalloc(sizeof(zval), 1, 0);
ZVAL_COPY(&args[0], value);
- status = call_user_function_ex(EG(function_table), NULL, option_array, &retval, 1, args, 0, NULL TSRMLS_CC);
+ status = call_user_function_ex(EG(function_table), NULL, option_array, &retval, 1, args, 0, NULL);
if (status == SUCCESS && !Z_ISUNDEF(retval)) {
zval_ptr_dtor(value);
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index d1b2abf2aa..20eac4577b 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -78,8 +78,8 @@ static const filter_list_entry filter_list[] = {
#define PARSE_SESSION 6
#endif
-static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC);
-static unsigned int php_sapi_filter_init(TSRMLS_D);
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len);
+static unsigned int php_sapi_filter_init(void);
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_filter_input, 0, 0, 2)
@@ -288,7 +288,7 @@ PHP_MINIT_FUNCTION(filter)
REGISTER_LONG_CONSTANT("FILTER_FLAG_HOSTNAME", FILTER_FLAG_HOSTNAME, CONST_CS | CONST_PERSISTENT);
- sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init TSRMLS_CC);
+ sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init);
return SUCCESS;
}
@@ -357,7 +357,7 @@ static filter_list_entry php_find_filter(zend_long id) /* {{{ */
}
/* }}} */
-static unsigned int php_sapi_filter_init(TSRMLS_D)
+static unsigned int php_sapi_filter_init(void)
{
ZVAL_UNDEF(&IF_G(get_array));
ZVAL_UNDEF(&IF_G(post_array));
@@ -368,7 +368,7 @@ static unsigned int php_sapi_filter_init(TSRMLS_D)
return SUCCESS;
}
-static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval *options, char* charset, zend_bool copy) /* {{{ */
{
filter_list_entry filter_func;
@@ -398,7 +398,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
/* Here be strings */
convert_to_string(value);
- filter_func.function(value, flags, options, charset TSRMLS_CC);
+ filter_func.function(value, flags, options, charset);
if (options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_P(value) == IS_NULL) ||
@@ -412,7 +412,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
}
/* }}} */
-static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len TSRMLS_DC) /* {{{ */
+static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_len, size_t *new_val_len) /* {{{ */
{
zval new_var, raw_var;
zval *array_ptr = NULL, *orig_array_ptr = NULL;
@@ -455,14 +455,14 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
if (array_ptr) {
/* Store the RAW variable internally */
ZVAL_STRINGL(&raw_var, *val, val_len);
- php_register_variable_ex(var, &raw_var, array_ptr TSRMLS_CC);
+ php_register_variable_ex(var, &raw_var, array_ptr);
}
if (val_len) {
/* Register mangled variable */
if (IF_G(default_filter) != FILTER_UNSAFE_RAW) {
ZVAL_STRINGL(&new_var, *val, val_len);
- php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0 TSRMLS_CC);
+ php_zval_filter(&new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL, 0);
} else {
ZVAL_STRINGL(&new_var, *val, val_len);
}
@@ -471,7 +471,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
}
if (orig_array_ptr) {
- php_register_variable_ex(var, &new_var, orig_array_ptr TSRMLS_CC);
+ php_register_variable_ex(var, &new_var, orig_array_ptr);
}
if (retval) {
@@ -491,7 +491,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, size_t val_l
}
/* }}} */
-static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, zend_bool copy TSRMLS_DC) /* {{{ */
+static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long flags, zval *options, char *charset, zend_bool copy) /* {{{ */
{
if (Z_TYPE_P(value) == IS_ARRAY) {
zval *element;
@@ -505,19 +505,19 @@ static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long f
SEPARATE_ZVAL_NOREF(element);
if (Z_TYPE_P(element) == IS_ARRAY) {
Z_ARRVAL_P(element)->u.v.nApplyCount++;
- php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter_recursive(element, filter, flags, options, charset, copy);
Z_ARRVAL_P(element)->u.v.nApplyCount--;
} else {
- php_zval_filter(element, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(element, filter, flags, options, charset, copy);
}
} ZEND_HASH_FOREACH_END();
} else {
- php_zval_filter(value, filter, flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(value, filter, flags, options, charset, copy);
}
}
/* }}} */
-static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
+static zval *php_filter_get_storage(zend_long arg)/* {{{ */
{
zval *array_ptr = NULL;
@@ -535,7 +535,7 @@ static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
case PARSE_SERVER:
if (PG(auto_globals_jit)) {
zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
}
array_ptr = &IF_G(server_array);
@@ -543,18 +543,18 @@ static zval *php_filter_get_storage(zend_long arg TSRMLS_DC)/* {{{ */
case PARSE_ENV:
if (PG(auto_globals_jit)) {
zend_string *name = zend_string_init("_ENV", sizeof("_ENV") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
}
array_ptr = &IF_G(env_array) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
break;
case PARSE_SESSION:
/* FIXME: Implement session source */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_SESSION is not yet implemented");
+ php_error_docref(NULL, E_WARNING, "INPUT_SESSION is not yet implemented");
break;
case PARSE_REQUEST:
/* FIXME: Implement request source */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "INPUT_REQUEST is not yet implemented");
+ php_error_docref(NULL, E_WARNING, "INPUT_REQUEST is not yet implemented");
break;
}
@@ -571,11 +571,11 @@ PHP_FUNCTION(filter_has_var)
zend_string *var;
zval *array_ptr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lS", &arg, &var) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS", &arg, &var) == FAILURE) {
RETURN_FALSE;
}
- array_ptr = php_filter_get_storage(arg TSRMLS_CC);
+ array_ptr = php_filter_get_storage(arg);
if (array_ptr && HASH_OF(array_ptr) && zend_hash_exists(HASH_OF(array_ptr), var)) {
RETURN_TRUE;
@@ -585,7 +585,7 @@ PHP_FUNCTION(filter_has_var)
}
/* }}} */
-static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, const int copy, zend_long filter_flags TSRMLS_DC) /* {{{ */
+static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, const int copy, zend_long filter_flags) /* {{{ */
{
zval *options = NULL;
zval *option;
@@ -642,7 +642,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
}
return;
}
- php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter_recursive(filtered, filter, filter_flags, options, charset, copy);
return;
}
if (filter_flags & FILTER_REQUIRE_ARRAY) {
@@ -658,7 +658,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
return;
}
- php_zval_filter(filtered, filter, filter_flags, options, charset, copy TSRMLS_CC);
+ php_zval_filter(filtered, filter, filter_flags, options, charset, copy);
if (filter_flags & FILTER_FORCE_ARRAY) {
zval tmp;
ZVAL_COPY_VALUE(&tmp, filtered);
@@ -668,7 +668,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args,
}
/* }}} */
-static void php_filter_array_handler(zval *input, zval *op, zval *return_value, zend_bool add_empty TSRMLS_DC) /* {{{ */
+static void php_filter_array_handler(zval *input, zval *op, zval *return_value, zend_bool add_empty) /* {{{ */
{
zend_string *arg_key;
zval *tmp, *arg_elm;
@@ -676,22 +676,22 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value,
if (!op) {
zval_ptr_dtor(return_value);
ZVAL_DUP(return_value, input);
- php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY);
} else if (Z_TYPE_P(op) == IS_LONG) {
zval_ptr_dtor(return_value);
ZVAL_DUP(return_value, input);
- php_filter_call(return_value, Z_LVAL_P(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC);
+ php_filter_call(return_value, Z_LVAL_P(op), NULL, 0, FILTER_REQUIRE_ARRAY);
} else if (Z_TYPE_P(op) == IS_ARRAY) {
array_init(return_value);
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(op), arg_key, arg_elm) {
if (arg_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric keys are not allowed in the definition array");
+ php_error_docref(NULL, E_WARNING, "Numeric keys are not allowed in the definition array");
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
if (arg_key->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty keys are not allowed in the definition array");
+ php_error_docref(NULL, E_WARNING, "Empty keys are not allowed in the definition array");
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -703,7 +703,7 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value,
zval nval;
ZVAL_DEREF(tmp);
ZVAL_DUP(&nval, tmp);
- php_filter_call(&nval, -1, arg_elm, 0, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(&nval, -1, arg_elm, 0, FILTER_REQUIRE_SCALAR);
zend_hash_update(Z_ARRVAL_P(return_value), arg_key, &nval);
}
} ZEND_HASH_FOREACH_END();
@@ -723,7 +723,7 @@ PHP_FUNCTION(filter_input)
zval *input = NULL;
zend_string *var;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lS|lz", &fetch_from, &var, &filter, &filter_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lS|lz", &fetch_from, &var, &filter, &filter_args) == FAILURE) {
return;
}
@@ -731,7 +731,7 @@ PHP_FUNCTION(filter_input)
RETURN_FALSE;
}
- input = php_filter_get_storage(fetch_from TSRMLS_CC);
+ input = php_filter_get_storage(fetch_from);
if (!input || !HASH_OF(input) || (tmp = zend_hash_find(HASH_OF(input), var)) == NULL) {
zend_long filter_flags = 0;
@@ -765,7 +765,7 @@ PHP_FUNCTION(filter_input)
ZVAL_DUP(return_value, tmp);
- php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR);
}
/* }}} */
@@ -777,7 +777,7 @@ PHP_FUNCTION(filter_var)
zend_long filter = FILTER_DEFAULT;
zval *filter_args = NULL, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|lz", &data, &filter, &filter_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/|lz", &data, &filter, &filter_args) == FAILURE) {
return;
}
@@ -787,7 +787,7 @@ PHP_FUNCTION(filter_var)
ZVAL_DUP(return_value, data);
- php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR TSRMLS_CC);
+ php_filter_call(return_value, filter, filter_args, 1, FILTER_REQUIRE_SCALAR);
}
/* }}} */
@@ -800,7 +800,7 @@ PHP_FUNCTION(filter_input_array)
zval *array_input = NULL, *op = NULL;
zend_bool add_empty = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|zb", &fetch_from, &op, &add_empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|zb", &fetch_from, &op, &add_empty) == FAILURE) {
return;
}
@@ -808,7 +808,7 @@ PHP_FUNCTION(filter_input_array)
RETURN_FALSE;
}
- array_input = php_filter_get_storage(fetch_from TSRMLS_CC);
+ array_input = php_filter_get_storage(fetch_from);
if (!array_input || !HASH_OF(array_input)) {
zend_long filter_flags = 0;
@@ -833,7 +833,7 @@ PHP_FUNCTION(filter_input_array)
}
}
- php_filter_array_handler(array_input, op, return_value, add_empty TSRMLS_CC);
+ php_filter_array_handler(array_input, op, return_value, add_empty);
}
/* }}} */
@@ -845,7 +845,7 @@ PHP_FUNCTION(filter_var_array)
zval *array_input = NULL, *op = NULL;
zend_bool add_empty = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|zb", &array_input, &op, &add_empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &array_input, &op, &add_empty) == FAILURE) {
return;
}
@@ -853,7 +853,7 @@ PHP_FUNCTION(filter_var_array)
RETURN_FALSE;
}
- php_filter_array_handler(array_input, op, return_value, add_empty TSRMLS_CC);
+ php_filter_array_handler(array_input, op, return_value, add_empty);
}
/* }}} */
@@ -883,7 +883,7 @@ PHP_FUNCTION(filter_id)
int size = sizeof(filter_list) / sizeof(filter_list_entry);
char *filter;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filter, &filter_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filter, &filter_len) == FAILURE) {
return;
}
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 01497192f0..ecff3087c7 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -81,9 +81,9 @@
#define FORMAT_IPV4 4
#define FORMAT_IPV6 6
-static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC);
+static int _php_filter_validate_ipv6(char *str, size_t str_len);
-static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_long ctx_value;
int sign = 0, digit = 0;
const char *end = str + str_len;
@@ -135,7 +135,7 @@ static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret
}
/* }}} */
-static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
@@ -158,7 +158,7 @@ static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *re
}
/* }}} */
-static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
zend_ulong n;
@@ -225,18 +225,18 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
p++; len--;
if (allow_hex && (*p == 'x' || *p == 'X')) {
p++; len--;
- if (php_filter_parse_hex(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_hex(p, len, &ctx_value) < 0) {
error = 1;
}
} else if (allow_octal) {
- if (php_filter_parse_octal(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_octal(p, len, &ctx_value) < 0) {
error = 1;
}
} else if (len != 0) {
error = 1;
}
} else {
- if (php_filter_parse_int(p, len, &ctx_value TSRMLS_CC) < 0) {
+ if (php_filter_parse_int(p, len, &ctx_value) < 0) {
error = 1;
}
}
@@ -347,7 +347,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (decimal_set) {
if (decimal_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "decimal separator must be one char");
+ php_error_docref(NULL, E_WARNING, "decimal separator must be one char");
RETURN_VALIDATION_FAILED
} else {
dec_sep = *decimal;
@@ -440,11 +440,11 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
FETCH_LONG_OPTION(option_flags, "flags");
if (!regexp_set) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'regexp' option missing");
+ php_error_docref(NULL, E_WARNING, "'regexp' option missing");
RETURN_VALIDATION_FAILED
}
- re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options);
if (!re) {
RETURN_VALIDATION_FAILED
}
@@ -521,7 +521,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
php_url *url;
int old_len = (int)Z_STRLEN_P(value);
- php_filter_url(value, flags, option_array, charset TSRMLS_CC);
+ php_filter_url(value, flags, option_array, charset);
if (Z_TYPE_P(value) != IS_STRING || old_len != Z_STRLEN_P(value)) {
RETURN_VALIDATION_FAILED
@@ -548,7 +548,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
t = e - 1;
/* An IPv6 enclosed by square brackets is a valid hostname */
- if (*s == '[' && *t == ']' && _php_filter_validate_ipv6((s + 1), l - 2 TSRMLS_CC)) {
+ if (*s == '[' && *t == ']' && _php_filter_validate_ipv6((s + 1), l - 2)) {
php_url_free(url);
return;
}
@@ -615,7 +615,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
sregexp = zend_string_init(regexp, sizeof(regexp) - 1, 0);
- re = pcre_get_compiled_regex(sregexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(sregexp, &pcre_extra, &preg_options);
if (!re) {
zend_string_release(sregexp);
RETURN_VALIDATION_FAILED
@@ -666,7 +666,7 @@ static int _php_filter_validate_ipv4(char *str, size_t str_len, int *ip) /* {{{
}
/* }}} */
-static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC) /* {{{ */
+static int _php_filter_validate_ipv6(char *str, size_t str_len) /* {{{ */
{
int compressed = 0;
int blocks = 0;
@@ -805,7 +805,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
case FORMAT_IPV6:
{
int res = 0;
- res = _php_filter_validate_ipv6(Z_STRVAL_P(value), Z_STRLEN_P(value) TSRMLS_CC);
+ res = _php_filter_validate_ipv6(Z_STRVAL_P(value), Z_STRLEN_P(value));
if (res < 1) {
RETURN_VALIDATION_FAILED
}
@@ -870,7 +870,7 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
FETCH_STRING_OPTION(exp_separator, "separator");
if (exp_separator_set && exp_separator_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Separator must be exactly one character long");
+ php_error_docref(NULL, E_WARNING, "Separator must be exactly one character long");
RETURN_VALIDATION_FAILED;
}
@@ -910,7 +910,7 @@ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
/* The current token did not end with e.g. a "." */
RETURN_VALIDATION_FAILED
}
- if (php_filter_parse_hex(input + offset, length, &ret TSRMLS_CC) < 0) {
+ if (php_filter_parse_hex(input + offset, length, &ret) < 0) {
/* The current token is no valid hexadecimal digit */
RETURN_VALIDATION_FAILED
}
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index 851238fe45..a10b3e31fd 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -264,7 +264,7 @@ void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL)
} else {
quotes = ENT_NOQUOTES;
}
- buf = php_escape_html_entities_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), 1, quotes, SG(default_charset), 0 TSRMLS_CC);
+ buf = php_escape_html_entities_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), 1, quotes, SG(default_charset), 0);
zval_ptr_dtor(value);
ZVAL_STR(value, buf);
}
@@ -373,7 +373,7 @@ void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL)
zend_string *buf;
/* just call php_addslashes quotes */
- buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), 0 TSRMLS_CC);
+ buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), 0);
zval_ptr_dtor(value);
ZVAL_STR(value, buf);
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index a5341080b8..f57009b527 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -100,16 +100,16 @@ static int ftp_getresp(ftpbuf_t *ftp);
static int ftp_type(ftpbuf_t *ftp, ftptype_t type);
/* opens up a data stream */
-static databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC);
+static databuf_t* ftp_getdata(ftpbuf_t *ftp);
/* accepts the data connection, returns updated data buffer */
-static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC);
+static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp);
/* closes the data connection, returns NULL */
static databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data);
/* generic file lister */
-static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC);
+static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path);
/* IP and port conversion box */
union ipbox {
@@ -121,7 +121,7 @@ union ipbox {
/* {{{ ftp_open
*/
ftpbuf_t*
-ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
+ftp_open(const char *host, short port, zend_long timeout_sec)
{
ftpbuf_t *ftp;
socklen_t size;
@@ -136,7 +136,7 @@ ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
ftp->fd = php_network_connect_socket_to_host(host,
(unsigned short) (port ? port : 21), SOCK_STREAM,
- 0, &tv, NULL, NULL, NULL, 0, STREAM_SOCKOP_NONE TSRMLS_CC);
+ 0, &tv, NULL, NULL, NULL, 0, STREAM_SOCKOP_NONE);
if (ftp->fd == -1) {
goto bail;
}
@@ -148,7 +148,7 @@ ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC)
size = sizeof(ftp->localaddr);
memset(&ftp->localaddr, 0, size);
if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "getsockname failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -179,8 +179,7 @@ ftp_close(ftpbuf_t *ftp)
data_close(ftp, ftp->data);
}
if (ftp->stream && ftp->closestream) {
- TSRMLS_FETCH();
- php_stream_close(ftp->stream);
+ php_stream_close(ftp->stream);
}
if (ftp->fd != -1) {
#if HAVE_OPENSSL_EXT
@@ -244,7 +243,7 @@ ftp_quit(ftpbuf_t *ftp)
/* {{{ ftp_login
*/
int
-ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
+ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
{
#if HAVE_OPENSSL_EXT
SSL_CTX *ctx = NULL;
@@ -281,7 +280,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
ctx = SSL_CTX_new(SSLv23_client_method());
if (ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL context");
+ php_error_docref(NULL, E_WARNING, "failed to create the SSL context");
return 0;
}
@@ -292,7 +291,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
ftp->ssl_handle = SSL_new(ctx);
if (ftp->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle");
+ php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
SSL_CTX_free(ctx);
return 0;
}
@@ -300,7 +299,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
SSL_set_fd(ftp->ssl_handle, ftp->fd);
if (SSL_connect(ftp->ssl_handle) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS handshake failed");
+ php_error_docref(NULL, E_WARNING, "SSL/TLS handshake failed");
SSL_shutdown(ftp->ssl_handle);
SSL_free(ftp->ssl_handle);
return 0;
@@ -649,18 +648,18 @@ ftp_alloc(ftpbuf_t *ftp, const zend_long size, zend_string **response)
/* {{{ ftp_nlist
*/
char**
-ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC)
+ftp_nlist(ftpbuf_t *ftp, const char *path)
{
- return ftp_genlist(ftp, "NLST", path TSRMLS_CC);
+ return ftp_genlist(ftp, "NLST", path);
}
/* }}} */
/* {{{ ftp_list
*/
char**
-ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC)
+ftp_list(ftpbuf_t *ftp, const char *path, int recursive)
{
- return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC);
+ return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path);
}
/* }}} */
@@ -791,7 +790,7 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
/* {{{ ftp_get
*/
int
-ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC)
+ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos)
{
databuf_t *data = NULL;
size_t rcvd;
@@ -804,7 +803,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
@@ -827,7 +826,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -883,7 +882,7 @@ bail:
/* {{{ ftp_put
*/
int
-ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC)
+ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos)
{
databuf_t *data = NULL;
zend_long size;
@@ -897,7 +896,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, z
if (!ftp_type(ftp, type)) {
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -918,7 +917,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, z
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -1364,7 +1363,7 @@ my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t *addrl
/* {{{ ftp_getdata
*/
databuf_t*
-ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
+ftp_getdata(ftpbuf_t *ftp)
{
int fd = -1;
databuf_t *data;
@@ -1389,7 +1388,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
sa = (struct sockaddr *) &ftp->localaddr;
/* bind/listen */
if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == SOCK_ERR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "socket() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1404,7 +1403,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
tv.tv_sec = ftp->timeout_sec;
tv.tv_usec = 0;
if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "php_connect_nonb() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1422,17 +1421,17 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
size = php_sockaddr_size(&addr);
if (bind(fd, (struct sockaddr*) &addr, size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "bind() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (getsockname(fd, (struct sockaddr*) &addr, &size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "getsockname() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
if (listen(fd, 5) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "listen() failed: %s (%d)", strerror(errno), errno);
goto bail;
}
@@ -1486,7 +1485,7 @@ bail:
/* {{{ data_accept
*/
databuf_t*
-data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC)
+data_accept(databuf_t *data, ftpbuf_t *ftp)
{
php_sockaddr_storage addr;
socklen_t size;
@@ -1516,7 +1515,7 @@ data_accepted:
if (ftp->use_ssl && ftp->use_ssl_for_data) {
ctx = SSL_CTX_new(SSLv23_client_method());
if (ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL context");
return 0;
}
@@ -1527,7 +1526,7 @@ data_accepted:
data->ssl_handle = SSL_new(ctx);
if (data->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL handle");
SSL_CTX_free(ctx);
return 0;
}
@@ -1540,7 +1539,7 @@ data_accepted:
}
if (SSL_connect(data->ssl_handle) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed");
+ php_error_docref(NULL, E_WARNING, "data_accept: SSL/TLS handshake failed");
SSL_shutdown(data->ssl_handle);
SSL_free(data->ssl_handle);
return 0;
@@ -1604,7 +1603,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
/* {{{ ftp_genlist
*/
char**
-ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
+ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path)
{
php_stream *tmpstream = NULL;
databuf_t *data = NULL;
@@ -1618,7 +1617,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory.");
+ php_error_docref(NULL, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory.");
return NULL;
}
@@ -1626,7 +1625,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -1646,7 +1645,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
}
/* pull data buffer into tmpfile */
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
size = 0;
@@ -1711,7 +1710,7 @@ bail:
/* {{{ ftp_nb_get
*/
int
-ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC)
+ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1724,7 +1723,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
@@ -1745,7 +1744,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
@@ -1754,7 +1753,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_read(ftp TSRMLS_CC));
+ return (ftp_nb_continue_read(ftp));
bail:
ftp->data = data_close(ftp, data);
@@ -1765,7 +1764,7 @@ bail:
/* {{{ ftp_nb_continue_read
*/
int
-ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC)
+ftp_nb_continue_read(ftpbuf_t *ftp)
{
databuf_t *data = NULL;
char *ptr;
@@ -1828,7 +1827,7 @@ bail:
/* {{{ ftp_nb_put
*/
int
-ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC)
+ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1839,7 +1838,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
if (!ftp_type(ftp, type)) {
goto bail;
}
- if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) {
+ if ((data = ftp_getdata(ftp)) == NULL) {
goto bail;
}
if (startpos > 0) {
@@ -1858,7 +1857,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) {
goto bail;
}
- if ((data = data_accept(data, ftp TSRMLS_CC)) == NULL) {
+ if ((data = data_accept(data, ftp)) == NULL) {
goto bail;
}
ftp->data = data;
@@ -1866,7 +1865,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_write(ftp TSRMLS_CC));
+ return (ftp_nb_continue_write(ftp));
bail:
ftp->data = data_close(ftp, data);
@@ -1878,7 +1877,7 @@ bail:
/* {{{ ftp_nb_continue_write
*/
int
-ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC)
+ftp_nb_continue_write(ftpbuf_t *ftp)
{
long size;
char *ptr;
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index e54eda0790..ec39695986 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -93,7 +93,7 @@ typedef struct ftpbuf
/* open a FTP connection, returns ftpbuf (NULL on error)
* port is the ftp port in network byte order, or 0 for the default
*/
-ftpbuf_t* ftp_open(const char *host, short port, zend_long timeout_sec TSRMLS_DC);
+ftpbuf_t* ftp_open(const char *host, short port, zend_long timeout_sec);
/* quits from the ftp session (it still needs to be closed)
* return true on success, false on error
@@ -107,7 +107,7 @@ void ftp_gc(ftpbuf_t *ftp);
ftpbuf_t* ftp_close(ftpbuf_t *ftp);
/* logs into the FTP server, returns true on success, false on error */
-int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC);
+int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass);
/* reinitializes the connection, returns true on success, false on error */
int ftp_reinit(ftpbuf_t *ftp);
@@ -152,14 +152,14 @@ int ftp_alloc(ftpbuf_t *ftp, const zend_long size, zend_string **response);
* or NULL on error. the return array must be freed (but don't
* free the array elements)
*/
-char** ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC);
+char** ftp_nlist(ftpbuf_t *ftp, const char *path);
/* returns a NULL-terminated array of lines returned by the ftp
* LIST command for the given path or NULL on error. the return
* array must be freed (but don't
* free the array elements)
*/
-char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC);
+char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive);
/* switches passive mode on or off
* returns true on success, false on error
@@ -169,12 +169,12 @@ int ftp_pasv(ftpbuf_t *ftp, int pasv);
/* retrieves a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC);
+int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC);
+int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos);
/* returns the size of the given file, or -1 on error */
zend_long ftp_size(ftpbuf_t *ftp, const char *path);
@@ -194,20 +194,20 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd);
/* retrieves part of a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos TSRMLS_DC);
+int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, zend_long resumepos);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos TSRMLS_DC);
+int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, zend_long startpos);
/* continues a previous nb_(f)get command
*/
-int ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC);
+int ftp_nb_continue_read(ftpbuf_t *ftp);
/* continues a previous nb_(f)put command
*/
-int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC);
+int ftp_nb_continue_write(ftpbuf_t *ftp);
#endif
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 32d8fb86e2..1c66f8e4d2 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -298,7 +298,7 @@ zend_module_entry php_ftp_module_entry = {
ZEND_GET_MODULE(php_ftp)
#endif
-static void ftp_destructor_ftpbuf(zend_resource *rsrc TSRMLS_DC)
+static void ftp_destructor_ftpbuf(zend_resource *rsrc)
{
ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr;
@@ -330,7 +330,7 @@ PHP_MINFO_FUNCTION(ftp)
#define XTYPE(xtype, mode) { \
if (mode != FTPTYPE_ASCII && mode != FTPTYPE_IMAGE) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \
+ php_error_docref(NULL, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \
RETURN_FALSE; \
} \
xtype = mode; \
@@ -347,17 +347,17 @@ PHP_FUNCTION(ftp_connect)
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
if (timeout_sec <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
/* connect */
- if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) {
+ if (!(ftp = ftp_open(host, (short)port, timeout_sec))) {
RETURN_FALSE;
}
@@ -383,17 +383,17 @@ PHP_FUNCTION(ftp_ssl_connect)
zend_long port = 0;
zend_long timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
if (timeout_sec <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
/* connect */
- if (!(ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC))) {
+ if (!(ftp = ftp_open(host, (short)port, timeout_sec))) {
RETURN_FALSE;
}
@@ -416,15 +416,15 @@ PHP_FUNCTION(ftp_login)
char *user, *pass;
size_t user_len, pass_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* log in */
- if (!ftp_login(ftp, user, pass TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_login(ftp, user, pass)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -440,14 +440,14 @@ PHP_FUNCTION(ftp_pwd)
ftpbuf_t *ftp;
const char *pwd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!(pwd = ftp_pwd(ftp))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -462,14 +462,14 @@ PHP_FUNCTION(ftp_cdup)
zval *z_ftp;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp_cdup(ftp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -486,7 +486,7 @@ PHP_FUNCTION(ftp_chdir)
char *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -494,7 +494,7 @@ PHP_FUNCTION(ftp_chdir)
/* change directories */
if (!ftp_chdir(ftp, dir)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -511,7 +511,7 @@ PHP_FUNCTION(ftp_exec)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -519,7 +519,7 @@ PHP_FUNCTION(ftp_exec)
/* execute serverside command */
if (!ftp_exec(ftp, cmd)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -536,7 +536,7 @@ PHP_FUNCTION(ftp_raw)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -557,7 +557,7 @@ PHP_FUNCTION(ftp_mkdir)
zend_string *tmp;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -565,7 +565,7 @@ PHP_FUNCTION(ftp_mkdir)
/* create directorie */
if (NULL == (tmp = ftp_mkdir(ftp, dir))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(ftp_rmdir)
char *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
@@ -590,7 +590,7 @@ PHP_FUNCTION(ftp_rmdir)
/* remove directorie */
if (!ftp_rmdir(ftp, dir)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -608,14 +608,14 @@ PHP_FUNCTION(ftp_chmod)
size_t filename_len;
zend_long mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp_chmod(ftp, mode, filename, filename_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -632,7 +632,7 @@ PHP_FUNCTION(ftp_alloc)
zend_long size, ret;
zend_string *response = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &z_ftp, &size, &zresponse) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z/", &z_ftp, &size, &zresponse) == FAILURE) {
RETURN_FALSE;
}
@@ -661,14 +661,14 @@ PHP_FUNCTION(ftp_nlist)
char **nlist, **ptr, *dir;
size_t dir_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &dir, &dir_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* get list of files */
- if (NULL == (nlist = ftp_nlist(ftp, dir TSRMLS_CC))) {
+ if (NULL == (nlist = ftp_nlist(ftp, dir))) {
RETURN_FALSE;
}
@@ -690,14 +690,14 @@ PHP_FUNCTION(ftp_rawlist)
size_t dir_len;
zend_bool recursive = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
/* get raw directory listing */
- if (NULL == (llist = ftp_list(ftp, dir, recursive TSRMLS_CC))) {
+ if (NULL == (llist = ftp_list(ftp, dir, recursive))) {
RETURN_FALSE;
}
@@ -717,14 +717,14 @@ PHP_FUNCTION(ftp_systype)
ftpbuf_t *ftp;
const char *syst;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (NULL == (syst = ftp_syst(ftp))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -744,7 +744,7 @@ PHP_FUNCTION(ftp_fget)
size_t file_len;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -767,8 +767,8 @@ PHP_FUNCTION(ftp_fget)
}
}
- if (!ftp_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_get(ftp, stream, file, xtype, resumepos)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -788,7 +788,7 @@ PHP_FUNCTION(ftp_nb_fget)
size_t file_len;
zend_long mode, resumepos=0, ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -815,8 +815,8 @@ PHP_FUNCTION(ftp_nb_fget)
ftp->direction = 0; /* recv */
ftp->closestream = 0; /* do not close */
- if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos)) == PHP_FTP_FAILED) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -832,7 +832,7 @@ PHP_FUNCTION(ftp_pasv)
ftpbuf_t *ftp;
zend_bool pasv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &z_ftp, &pasv) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &z_ftp, &pasv) == FAILURE) {
return;
}
@@ -858,7 +858,7 @@ PHP_FUNCTION(ftp_get)
size_t local_len, remote_len;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -893,14 +893,14 @@ PHP_FUNCTION(ftp_get)
}
if (outstream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local);
+ php_error_docref(NULL, E_WARNING, "Error opening %s", local);
RETURN_FALSE;
}
- if (!ftp_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) {
+ if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) {
php_stream_close(outstream);
VCWD_UNLINK(local);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -922,7 +922,7 @@ PHP_FUNCTION(ftp_nb_get)
int ret;
zend_long mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -955,7 +955,7 @@ PHP_FUNCTION(ftp_nb_get)
}
if (outstream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local);
+ php_error_docref(NULL, E_WARNING, "Error opening %s", local);
RETURN_FALSE;
}
@@ -963,11 +963,11 @@ PHP_FUNCTION(ftp_nb_get)
ftp->direction = 0; /* recv */
ftp->closestream = 1; /* do close */
- if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
+ if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos)) == PHP_FTP_FAILED) {
php_stream_close(outstream);
ftp->stream = NULL;
VCWD_UNLINK(local);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(PHP_FTP_FAILED);
}
@@ -988,21 +988,21 @@ PHP_FUNCTION(ftp_nb_continue)
ftpbuf_t *ftp;
zend_long ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
if (!ftp->nb) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no nbronous transfer to continue.");
+ php_error_docref(NULL, E_WARNING, "no nbronous transfer to continue.");
RETURN_LONG(PHP_FTP_FAILED);
}
if (ftp->direction) {
- ret=ftp_nb_continue_write(ftp TSRMLS_CC);
+ ret=ftp_nb_continue_write(ftp);
} else {
- ret=ftp_nb_continue_read(ftp TSRMLS_CC);
+ ret=ftp_nb_continue_read(ftp);
}
if (ret != PHP_FTP_MOREDATA && ftp->closestream) {
@@ -1011,7 +1011,7 @@ PHP_FUNCTION(ftp_nb_continue)
}
if (ret == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
}
RETURN_LONG(ret);
@@ -1030,7 +1030,7 @@ PHP_FUNCTION(ftp_fput)
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1056,8 +1056,8 @@ PHP_FUNCTION(ftp_fput)
}
}
- if (!ftp_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (!ftp_put(ftp, remote, stream, xtype, startpos)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1078,7 +1078,7 @@ PHP_FUNCTION(ftp_nb_fput)
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1108,8 +1108,8 @@ PHP_FUNCTION(ftp_nb_fput)
ftp->direction = 1; /* send */
ftp->closestream = 0; /* do not close */
- if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) == PHP_FTP_FAILED)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos)) == PHP_FTP_FAILED)) {
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -1130,7 +1130,7 @@ PHP_FUNCTION(ftp_put)
zend_long mode, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1159,9 +1159,9 @@ PHP_FUNCTION(ftp_put)
}
}
- if (!ftp_put(ftp, remote, instream, xtype, startpos TSRMLS_CC)) {
+ if (!ftp_put(ftp, remote, instream, xtype, startpos)) {
php_stream_close(instream);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
php_stream_close(instream);
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(ftp_nb_put)
zend_long mode, startpos=0, ret;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1216,7 +1216,7 @@ PHP_FUNCTION(ftp_nb_put)
ftp->direction = 1; /* send */
ftp->closestream = 1; /* do close */
- ret = ftp_nb_put(ftp, remote, instream, xtype, startpos TSRMLS_CC);
+ ret = ftp_nb_put(ftp, remote, instream, xtype, startpos);
if (ret != PHP_FTP_MOREDATA) {
php_stream_close(instream);
@@ -1224,7 +1224,7 @@ PHP_FUNCTION(ftp_nb_put)
}
if (ret == PHP_FTP_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
}
RETURN_LONG(ret);
@@ -1240,7 +1240,7 @@ PHP_FUNCTION(ftp_size)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1260,7 +1260,7 @@ PHP_FUNCTION(ftp_mdtm)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1280,7 +1280,7 @@ PHP_FUNCTION(ftp_rename)
char *src, *dest;
size_t src_len, dest_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) {
return;
}
@@ -1288,7 +1288,7 @@ PHP_FUNCTION(ftp_rename)
/* rename the file */
if (!ftp_rename(ftp, src, dest)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1305,7 +1305,7 @@ PHP_FUNCTION(ftp_delete)
char *file;
size_t file_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &file, &file_len) == FAILURE) {
return;
}
@@ -1313,7 +1313,7 @@ PHP_FUNCTION(ftp_delete)
/* delete the file */
if (!ftp_delete(ftp, file)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1330,7 +1330,7 @@ PHP_FUNCTION(ftp_site)
char *cmd;
size_t cmd_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) {
return;
}
@@ -1338,7 +1338,7 @@ PHP_FUNCTION(ftp_site)
/* send the site command */
if (!ftp_site(ftp, cmd)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
+ php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(ftp_close)
zval *z_ftp;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_ftp) == FAILURE) {
return;
}
@@ -1373,7 +1373,7 @@ PHP_FUNCTION(ftp_set_option)
zend_long option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &z_ftp, &option, &z_value) == FAILURE) {
return;
}
@@ -1382,12 +1382,12 @@ PHP_FUNCTION(ftp_set_option)
switch (option) {
case PHP_FTP_OPT_TIMEOUT_SEC:
if (Z_TYPE_P(z_value) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given",
+ php_error_docref(NULL, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given",
zend_zval_type_name(z_value));
RETURN_FALSE;
}
if (Z_LVAL_P(z_value) <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Timeout has to be greater than 0");
RETURN_FALSE;
}
ftp->timeout_sec = Z_LVAL_P(z_value);
@@ -1395,7 +1395,7 @@ PHP_FUNCTION(ftp_set_option)
break;
case PHP_FTP_OPT_AUTOSEEK:
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given",
+ php_error_docref(NULL, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given",
zend_zval_type_name(z_value));
RETURN_FALSE;
}
@@ -1403,7 +1403,7 @@ PHP_FUNCTION(ftp_set_option)
RETURN_TRUE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option);
+ php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
RETURN_FALSE;
break;
}
@@ -1418,7 +1418,7 @@ PHP_FUNCTION(ftp_get_option)
zend_long option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &z_ftp, &option) == FAILURE) {
return;
}
@@ -1432,7 +1432,7 @@ PHP_FUNCTION(ftp_get_option)
RETURN_BOOL(ftp->autoseek);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%pd'", option);
+ php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
RETURN_FALSE;
break;
}
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5a820860e6..def17b8df3 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -64,8 +64,8 @@ static int le_gd, le_gd_font;
#if HAVE_LIBT1
#include <t1lib.h>
static int le_ps_font, le_ps_enc;
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC);
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC);
+static void php_free_ps_font(zend_resource *rsrc);
+static void php_free_ps_enc(zend_resource *rsrc);
#endif
#include <gd.h>
@@ -135,7 +135,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS);
static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
/* End Section filters declarations */
-static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
+static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)());
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
static int _php_image_type(char data[8]);
@@ -1072,7 +1072,7 @@ PHP_INI_END()
/* {{{ php_free_gd_image
*/
-static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_image(zend_resource *rsrc)
{
gdImageDestroy((gdImagePtr) rsrc->ptr);
}
@@ -1080,7 +1080,7 @@ static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_gd_font
*/
-static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_font(zend_resource *rsrc)
{
gdFontPtr fp = (gdFontPtr) rsrc->ptr;
@@ -1097,9 +1097,8 @@ static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
*/
void php_gd_error_method(int type, const char *format, va_list args)
{
- TSRMLS_FETCH();
- php_verror(NULL, "", type, format, args TSRMLS_CC);
+ php_verror(NULL, "", type, format, args);
}
/* }}} */
#endif
@@ -1427,7 +1426,7 @@ PHP_FUNCTION(imageloadfont)
gdFontPtr font;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_name) == FAILURE) {
return;
}
@@ -1457,9 +1456,9 @@ PHP_FUNCTION(imageloadfont)
if (!n) {
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header");
+ php_error_docref(NULL, E_WARNING, "End of file while reading header");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header");
+ php_error_docref(NULL, E_WARNING, "Error while reading header");
}
php_stream_close(stream);
RETURN_FALSE;
@@ -1478,14 +1477,14 @@ PHP_FUNCTION(imageloadfont)
}
if (overflow2(font->nchars, font->h) || overflow2(font->nchars * font->h, font->w )) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
+ php_error_docref(NULL, E_WARNING, "Error reading font, invalid font header");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
if (body_size != body_size_check) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font");
+ php_error_docref(NULL, E_WARNING, "Error reading font");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
@@ -1501,16 +1500,16 @@ PHP_FUNCTION(imageloadfont)
efree(font->data);
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading body");
+ php_error_docref(NULL, E_WARNING, "End of file while reading body");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body");
+ php_error_docref(NULL, E_WARNING, "Error while reading body");
}
php_stream_close(stream);
RETURN_FALSE;
}
php_stream_close(stream);
- ind = zend_list_insert(font, le_gd_font TSRMLS_CC);
+ ind = zend_list_insert(font, le_gd_font);
/* Adding 5 to the font index so we will never have font indices
* that overlap with the old fonts (with indices 1-5). The first
@@ -1529,7 +1528,7 @@ PHP_FUNCTION(imagesetstyle)
int *stylearr;
int index = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &styles) == FAILURE) {
return;
}
@@ -1557,12 +1556,12 @@ PHP_FUNCTION(imagecreatetruecolor)
zend_long x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size, &y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -1583,7 +1582,7 @@ PHP_FUNCTION(imageistruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1602,14 +1601,14 @@ PHP_FUNCTION(imagetruecolortopalette)
zend_long ncolors;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rbl", &IM, &dither, &ncolors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rbl", &IM, &dither, &ncolors) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
if (ncolors <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero");
RETURN_FALSE;
}
gdImageTrueColorToPalette(im, dither, ncolors);
@@ -1625,7 +1624,7 @@ PHP_FUNCTION(imagepalettetotruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1647,7 +1646,7 @@ PHP_FUNCTION(imagecolormatch)
gdImagePtr im1, im2;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM1, &IM2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM1, &IM2) == FAILURE) {
return;
}
@@ -1657,19 +1656,19 @@ PHP_FUNCTION(imagecolormatch)
result = gdImageColorMatch(im1, im2);
switch (result) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 must be TrueColor" );
+ php_error_docref(NULL, E_WARNING, "Image1 must be TrueColor" );
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must be Palette" );
+ php_error_docref(NULL, E_WARNING, "Image2 must be Palette" );
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 and Image2 must be the same size" );
+ php_error_docref(NULL, E_WARNING, "Image1 and Image2 must be the same size" );
RETURN_FALSE;
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must have at least one color" );
+ php_error_docref(NULL, E_WARNING, "Image2 must have at least one color" );
RETURN_FALSE;
break;
}
@@ -1686,7 +1685,7 @@ PHP_FUNCTION(imagesetthickness)
zend_long thick;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &thick) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &thick) == FAILURE) {
return;
}
@@ -1706,7 +1705,7 @@ PHP_FUNCTION(imagefilledellipse)
zend_long cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -1727,7 +1726,7 @@ PHP_FUNCTION(imagefilledarc)
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
return;
}
@@ -1757,7 +1756,7 @@ PHP_FUNCTION(imagealphablending)
zend_bool blend;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &blend) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &blend) == FAILURE) {
return;
}
@@ -1776,7 +1775,7 @@ PHP_FUNCTION(imagesavealpha)
zend_bool save;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &save) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &save) == FAILURE) {
return;
}
@@ -1795,7 +1794,7 @@ PHP_FUNCTION(imagelayereffect)
zend_long effect;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &effect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &effect) == FAILURE) {
return;
}
@@ -1815,7 +1814,7 @@ PHP_FUNCTION(imagecolorallocatealpha)
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
RETURN_FALSE;
}
@@ -1836,7 +1835,7 @@ PHP_FUNCTION(imagecolorresolvealpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1854,7 +1853,7 @@ PHP_FUNCTION(imagecolorclosestalpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1872,7 +1871,7 @@ PHP_FUNCTION(imagecolorexactalpha)
zend_long red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1891,7 +1890,7 @@ PHP_FUNCTION(imagecopyresampled)
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -1933,14 +1932,14 @@ PHP_FUNCTION(imagegrabwindow)
tPrintWindow pPrintWindow = 0;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &lwindow_handle, &client_area) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &lwindow_handle, &client_area) == FAILURE) {
RETURN_FALSE;
}
window = (HWND) lwindow_handle;
if (!IsWindow(window)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid window handle");
+ php_error_docref(NULL, E_NOTICE, "Invalid window handle");
RETURN_FALSE;
}
@@ -1972,7 +1971,7 @@ PHP_FUNCTION(imagegrabwindow)
if ( pPrintWindow ) {
pPrintWindow(window, memDC, (UINT) client_area);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
+ php_error_docref(NULL, E_WARNING, "Windows API too old");
goto clean;
}
@@ -2073,7 +2072,7 @@ PHP_FUNCTION(imagerotate)
zend_long color;
zend_long ignoretransparent = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
RETURN_FALSE;
}
@@ -2096,7 +2095,7 @@ PHP_FUNCTION(imagesettile)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2116,7 +2115,7 @@ PHP_FUNCTION(imagesetbrush)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2136,12 +2135,12 @@ PHP_FUNCTION(imagecreate)
zend_long x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size, &y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -2240,7 +2239,7 @@ static int _php_image_type (char data[8])
/* {{{ _php_image_create_from_string
*/
-gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC)
+gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)())
{
gdImagePtr im;
gdIOCtx *io_ctx;
@@ -2253,7 +2252,7 @@ gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioct
im = (*ioctx_func_p)(io_ctx);
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn);
+ php_error_docref(NULL, E_WARNING, "Passed data is not in '%s' format", tn);
io_ctx->gd_free(io_ctx);
return NULL;
}
@@ -2273,13 +2272,13 @@ PHP_FUNCTION(imagecreatefromstring)
int imtype;
char sig[8];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &data) == FAILURE) {
return;
}
convert_to_string_ex(data);
if (Z_STRLEN_P(data) < 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string or invalid image");
+ php_error_docref(NULL, E_WARNING, "Empty string or invalid image");
RETURN_FALSE;
}
@@ -2290,41 +2289,41 @@ PHP_FUNCTION(imagecreatefromstring)
switch (imtype) {
case PHP_GDIMG_TYPE_JPG:
#ifdef HAVE_GD_JPG
- im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No JPEG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No JPEG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_PNG:
#ifdef HAVE_GD_PNG
- im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PNG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No PNG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_GIF:
- im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx);
break;
case PHP_GDIMG_TYPE_WBM:
- im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx);
break;
case PHP_GDIMG_TYPE_GD2:
- im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data is not in a recognized format");
+ php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
RETURN_FALSE;
}
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't create GD Image Stream out of Data");
+ php_error_docref(NULL, E_WARNING, "Couldn't create GD Image Stream out of Data");
RETURN_FALSE;
}
@@ -2347,15 +2346,15 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
#endif
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero width or height not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero width or height not allowed");
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
}
@@ -2380,7 +2379,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
buff = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
if (!buff) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data");
+ php_error_docref(NULL, E_WARNING,"Cannot read image data");
goto out_err;
}
@@ -2390,7 +2389,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
if (!io_ctx) {
pefree(pstr, 1);
zend_string_release(buff);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
+ php_error_docref(NULL, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
}
@@ -2443,7 +2442,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid %s file", file, tn);
+ php_error_docref(NULL, E_WARNING, "'%s' is not a valid %s file", file, tn);
out_err:
php_stream_close(stream);
RETURN_FALSE;
@@ -2557,7 +2556,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
/* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */
/* The quality parameter for gd2 stands for chunk size */
- if (zend_parse_parameters(argc TSRMLS_CC, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
return;
}
@@ -2578,7 +2577,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn);
RETURN_FALSE;
}
@@ -2587,7 +2586,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, fp);
@@ -2628,9 +2627,9 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
char buf[4096];
char *path;
- tmp = php_open_temporary_file(NULL, NULL, &path TSRMLS_CC);
+ tmp = php_open_temporary_file(NULL, NULL, &path);
if (tmp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
+ php_error_docref(NULL, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
}
@@ -2639,7 +2638,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, tmp);
@@ -2681,7 +2680,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
#endif
while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) {
- php_write(buf, b TSRMLS_CC);
+ php_write(buf, b);
}
fclose(tmp);
@@ -2771,7 +2770,7 @@ PHP_FUNCTION(imagedestroy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -2793,7 +2792,7 @@ PHP_FUNCTION(imagecolorallocate)
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2814,7 +2813,7 @@ PHP_FUNCTION(imagepalettecopy)
zval *dstim, *srcim;
gdImagePtr dst, src;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &dstim, &srcim) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &dstim, &srcim) == FAILURE) {
return;
}
@@ -2833,7 +2832,7 @@ PHP_FUNCTION(imagecolorat)
zend_long x, y;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &IM, &x, &y) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &IM, &x, &y) == FAILURE) {
return;
}
@@ -2843,14 +2842,14 @@ PHP_FUNCTION(imagecolorat)
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
}
@@ -2865,7 +2864,7 @@ PHP_FUNCTION(imagecolorclosest)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2883,7 +2882,7 @@ PHP_FUNCTION(imagecolorclosesthwb)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2902,7 +2901,7 @@ PHP_FUNCTION(imagecolordeallocate)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -2919,7 +2918,7 @@ PHP_FUNCTION(imagecolordeallocate)
gdImageColorDeallocate(im, col);
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -2933,7 +2932,7 @@ PHP_FUNCTION(imagecolorresolve)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2951,7 +2950,7 @@ PHP_FUNCTION(imagecolorexact)
zend_long red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red, &green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2970,7 +2969,7 @@ PHP_FUNCTION(imagecolorset)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &IM, &color, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll|l", &IM, &color, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -2998,7 +2997,7 @@ PHP_FUNCTION(imagecolorsforindex)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -3014,7 +3013,7 @@ PHP_FUNCTION(imagecolorsforindex)
add_assoc_long(return_value,"blue", gdImageBlue(im,col));
add_assoc_long(return_value,"alpha", gdImageAlpha(im,col));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -3029,7 +3028,7 @@ PHP_FUNCTION(imagegammacorrect)
int i;
double input, output;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdd", &IM, &input, &output) == FAILURE) {
return;
}
@@ -3071,7 +3070,7 @@ PHP_FUNCTION(imagesetpixel)
zend_long x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x, &y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3089,7 +3088,7 @@ PHP_FUNCTION(imageline)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3115,7 +3114,7 @@ PHP_FUNCTION(imagedashedline)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3133,7 +3132,7 @@ PHP_FUNCTION(imagerectangle)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3151,7 +3150,7 @@ PHP_FUNCTION(imagefilledrectangle)
zend_long x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3170,7 +3169,7 @@ PHP_FUNCTION(imagearc)
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
return;
}
@@ -3199,7 +3198,7 @@ PHP_FUNCTION(imageellipse)
zend_long cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -3218,7 +3217,7 @@ PHP_FUNCTION(imagefilltoborder)
zend_long x, y, border, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &x, &y, &border, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll", &IM, &x, &y, &border, &col) == FAILURE) {
return;
}
@@ -3236,7 +3235,7 @@ PHP_FUNCTION(imagefill)
zend_long x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x, &y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3253,7 +3252,7 @@ PHP_FUNCTION(imagecolorstotal)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3272,7 +3271,7 @@ PHP_FUNCTION(imagecolortransparent)
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &COL) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &COL) == FAILURE) {
return;
}
@@ -3295,7 +3294,7 @@ PHP_FUNCTION(imageinterlace)
zend_long INT = 0;
gdImagePtr im;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &INT) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &INT) == FAILURE) {
return;
}
@@ -3322,7 +3321,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
gdPointPtr points;
int npoints, col, nelem, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
return;
}
@@ -3333,15 +3332,15 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
nelem = zend_hash_num_elements(Z_ARRVAL_P(POINTS));
if (nelem < 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array");
+ php_error_docref(NULL, E_WARNING, "You must have at least 3 points in your array");
RETURN_FALSE;
}
if (npoints <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must give a positive number of points");
+ php_error_docref(NULL, E_WARNING, "You must give a positive number of points");
RETURN_FALSE;
}
if (nelem < npoints * 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
+ php_error_docref(NULL, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
RETURN_FALSE;
}
@@ -3385,7 +3384,7 @@ PHP_FUNCTION(imagefilledpolygon)
/* {{{ php_find_gd_font
*/
-static gdFontPtr php_find_gd_font(int size TSRMLS_DC)
+static gdFontPtr php_find_gd_font(int size)
{
gdFontPtr font;
@@ -3433,11 +3432,11 @@ static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
zend_long SIZE;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &SIZE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &SIZE) == FAILURE) {
return;
}
- font = php_find_gd_font(SIZE TSRMLS_CC);
+ font = php_find_gd_font(SIZE);
RETURN_LONG(arg ? font->h : font->w);
}
/* }}} */
@@ -3501,7 +3500,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
unsigned char *str = NULL;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllsl", &IM, &SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlllsl", &IM, &SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
return;
}
@@ -3520,7 +3519,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
x = X;
size = SIZE;
- font = php_find_gd_font(size TSRMLS_CC);
+ font = php_find_gd_font(size);
switch (mode) {
case 0:
@@ -3592,7 +3591,7 @@ PHP_FUNCTION(imagecopy)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
return;
}
@@ -3620,7 +3619,7 @@ PHP_FUNCTION(imagecopymerge)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3649,7 +3648,7 @@ PHP_FUNCTION(imagecopymergegray)
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3678,7 +3677,7 @@ PHP_FUNCTION(imagecopyresized)
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -3695,7 +3694,7 @@ PHP_FUNCTION(imagecopyresized)
dstW = DW;
if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -3711,7 +3710,7 @@ PHP_FUNCTION(imagesx)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3728,7 +3727,7 @@ PHP_FUNCTION(imagesy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3797,13 +3796,13 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
if (mode == TTFTEXT_BBOX) {
if (argc < 4 || argc > ((extended) ? 5 : 4)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
RETURN_FALSE;
}
} else {
if (argc < 8 || argc > ((extended) ? 9 : 8)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
@@ -3851,7 +3850,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
#endif /* HAVE_GD_FREETYPE */
if (error) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error);
+ php_error_docref(NULL, E_WARNING, "%s", error);
RETURN_FALSE;
}
@@ -3869,7 +3868,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
/* {{{ php_free_ps_font
*/
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_font(zend_resource *rsrc)
{
int *font = (int *)rsrc->ptr;
@@ -3880,7 +3879,7 @@ static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_ps_enc
*/
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_enc(zend_resource *rsrc)
{
char **enc = (char **)rsrc->ptr;
@@ -3898,13 +3897,13 @@ PHP_FUNCTION(imagepsloadfont)
zend_stat_t st;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
#ifdef PHP_WIN32
if (VCWD_STAT(file, &st) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font file not found (%s)", file);
+ php_error_docref(NULL, E_WARNING, "Font file not found (%s)", file);
RETURN_FALSE;
}
#endif
@@ -3912,12 +3911,12 @@ PHP_FUNCTION(imagepsloadfont)
f_ind = T1_AddFont(file);
if (f_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
RETURN_FALSE;
}
if (T1_LoadFont(f_ind)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load the font");
+ php_error_docref(NULL, E_WARNING, "Couldn't load the font");
RETURN_FALSE;
}
@@ -3936,14 +3935,14 @@ PHP_FUNCTION(imagepscopyfont)
gd_ps_font *nf_ind, *of_ind;
long fnt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &fnt) == FAILURE) {
return;
}
of_ind = zend_list_find(fnt, &type);
if (type != le_ps_font) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", fnt);
+ php_error_docref(NULL, E_WARNING, "%ld is not a Type 1 font index", fnt);
RETURN_FALSE;
}
@@ -3955,26 +3954,26 @@ PHP_FUNCTION(imagepscopyfont)
efree(nf_ind);
switch (l_ind) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "FontID %d is not loaded in memory", l_ind);
+ php_error_docref(NULL, E_WARNING, "FontID %d is not loaded in memory", l_ind);
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to copy a logical font");
+ php_error_docref(NULL, E_WARNING, "Tried to copy a logical font");
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib");
+ php_error_docref(NULL, E_WARNING, "Memory allocation fault in t1lib");
RETURN_FALSE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib");
+ php_error_docref(NULL, E_WARNING, "An unknown error occurred in t1lib");
RETURN_FALSE;
break;
}
}
nf_ind->extend = 1;
- l_ind = zend_list_insert(nf_ind, le_ps_font TSRMLS_CC);
+ l_ind = zend_list_insert(nf_ind, le_ps_font);
RETURN_LONG(l_ind);
}
*/
@@ -3987,7 +3986,7 @@ PHP_FUNCTION(imagepsfreefont)
zval *fnt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fnt) == FAILURE) {
return;
}
@@ -4005,25 +4004,25 @@ PHP_FUNCTION(imagepsencodefont)
char *enc, **enc_vector;
size_t enc_len, *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font);
if ((enc_vector = T1_LoadEncoding(enc)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load encoding vector from %s", enc);
+ php_error_docref(NULL, E_WARNING, "Couldn't load encoding vector from %s", enc);
RETURN_FALSE;
}
T1_DeleteAllSizes(*f_ind);
if (T1_ReencodeFont(*f_ind, enc_vector)) {
T1_DeleteEncoding(enc_vector);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-encode font");
+ php_error_docref(NULL, E_WARNING, "Couldn't re-encode font");
RETURN_FALSE;
}
- zend_list_insert(enc_vector, le_ps_enc TSRMLS_CC);
+ zend_list_insert(enc_vector, le_ps_enc);
RETURN_TRUE;
}
@@ -4037,7 +4036,7 @@ PHP_FUNCTION(imagepsextendfont)
double ext;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &ext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &ext) == FAILURE) {
return;
}
@@ -4046,7 +4045,7 @@ PHP_FUNCTION(imagepsextendfont)
T1_DeleteAllSizes(*f_ind);
if (ext <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
+ php_error_docref(NULL, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
RETURN_FALSE;
}
@@ -4066,7 +4065,7 @@ PHP_FUNCTION(imagepsslantfont)
double slt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &slt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &slt) == FAILURE) {
return;
}
@@ -4102,12 +4101,12 @@ PHP_FUNCTION(imagepstext)
char *str;
int str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) {
return;
}
if (aa_steps != 4 && aa_steps != 16) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Antialias steps must be 4 or 16");
+ php_error_docref(NULL, E_WARNING, "Antialias steps must be 4 or 16");
RETURN_FALSE;
}
@@ -4116,12 +4115,12 @@ PHP_FUNCTION(imagepstext)
/* Ensure that the provided colors are valid */
if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %pd out of range", _fg);
+ php_error_docref(NULL, E_WARNING, "Foreground color index %pd out of range", _fg);
RETURN_FALSE;
}
if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %pd out of range", _bg);
+ php_error_docref(NULL, E_WARNING, "Background color index %pd out of range", _bg);
RETURN_FALSE;
}
@@ -4155,7 +4154,7 @@ PHP_FUNCTION(imagepstext)
T1_AASetLevel(T1_AA_HIGH);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
+ php_error_docref(NULL, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
RETURN_FALSE;
}
@@ -4169,7 +4168,7 @@ PHP_FUNCTION(imagepstext)
if (!str_path) {
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
}
RETURN_FALSE;
}
@@ -4190,7 +4189,7 @@ PHP_FUNCTION(imagepstext)
str_img = T1_AASetString(*f_ind, str, str_len, space, T1_KERNING, size, transform);
}
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
RETURN_FALSE;
}
@@ -4239,7 +4238,7 @@ PHP_FUNCTION(imagepsbbox)
ZEND_WRONG_PARAM_COUNT();
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
return;
}
@@ -4357,23 +4356,22 @@ static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold
int dest_height = gdImageSY(im_org);
int dest_width = gdImageSX(im_org);
int x, y;
- TSRMLS_FETCH();
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
return;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
@@ -4421,7 +4419,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
zend_long ignore_warning;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
return;
}
@@ -4433,7 +4431,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Check threshold value */
if (int_threshold < 0 || int_threshold > 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'", int_threshold);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'", int_threshold);
RETURN_FALSE;
}
@@ -4446,14 +4444,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Open origin file */
org = VCWD_FOPEN(fn_org, "rb");
if (!org) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for reading", fn_org);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for reading", fn_org);
RETURN_FALSE;
}
/* Open destination file */
dest = VCWD_FOPEN(fn_dest, "wb");
if (!dest) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
RETURN_FALSE;
}
@@ -4461,7 +4459,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_GIF:
im_org = gdImageCreateFromGif(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4471,7 +4469,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
ignore_warning = INI_INT("gd.jpeg_ignore_warning");
im_org = gdImageCreateFromJpegEx(org, ignore_warning);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4481,14 +4479,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_PNG:
im_org = gdImageCreateFromPng(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
RETURN_FALSE;
}
break;
#endif /* HAVE_GD_PNG */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported");
+ php_error_docref(NULL, E_WARNING, "Format not supported");
RETURN_FALSE;
break;
}
@@ -4522,7 +4520,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_tmp = gdImageCreate (dest_width, dest_height);
if (im_tmp == NULL ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
RETURN_FALSE;
}
@@ -4534,19 +4532,19 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
RETURN_FALSE;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
@@ -4582,7 +4580,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
#define PHP_GD_SINGLE_RES \
zval *SIM; \
gdImagePtr im_src; \
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &SIM) == FAILURE) { \
+ if (zend_parse_parameters(1, "r", &SIM) == FAILURE) { \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); \
@@ -4618,7 +4616,7 @@ static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long brightness, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &SIM, &tmp, &brightness) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &SIM, &tmp, &brightness) == FAILURE) {
RETURN_FALSE;
}
@@ -4641,7 +4639,7 @@ static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long contrast, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &SIM, &tmp, &contrast) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &SIM, &tmp, &contrast) == FAILURE) {
RETURN_FALSE;
}
@@ -4665,7 +4663,7 @@ static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS)
zend_long r,g,b,tmp;
zend_long a = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &SIM, &tmp, &r, &g, &b, &a) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllll|l", &SIM, &tmp, &r, &g, &b, &a) == FAILURE) {
RETURN_FALSE;
}
@@ -4744,7 +4742,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
double weight;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rld", &SIM, &tmp, &weight) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rld", &SIM, &tmp, &weight) == FAILURE) {
RETURN_FALSE;
}
@@ -4768,7 +4766,7 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS)
zend_long tmp, blocksize;
zend_bool mode = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll|b", &IM, &tmp, &blocksize, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll|b", &IM, &tmp, &blocksize, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -4811,7 +4809,7 @@ PHP_FUNCTION(imagefilter)
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > IMAGE_FILTER_MAX_ARGS) {
WRONG_PARAM_COUNT;
- } else if (zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) {
+ } else if (zend_parse_parameters(2, "rl", &tmp, &filtertype) == FAILURE) {
return;
}
@@ -4832,7 +4830,7 @@ PHP_FUNCTION(imageconvolution)
int nelem, i, j, res;
float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
RETURN_FALSE;
}
@@ -4840,14 +4838,14 @@ PHP_FUNCTION(imageconvolution)
nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
if (nelem != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
for (i=0; i<3; i++) {
if ((var = zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i))) != NULL && Z_TYPE_P(var) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(var)) != 3 ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
@@ -4855,7 +4853,7 @@ PHP_FUNCTION(imageconvolution)
if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), j)) != NULL) {
matrix[i][j] = (float) zval_get_double(var2);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
+ php_error_docref(NULL, E_WARNING, "You must have a 3x3 matrix");
RETURN_FALSE;
}
}
@@ -4880,7 +4878,7 @@ PHP_FUNCTION(imageflip)
zend_long mode;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &mode) == FAILURE) {
return;
}
@@ -4900,7 +4898,7 @@ PHP_FUNCTION(imageflip)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown flip mode");
+ php_error_docref(NULL, E_WARNING, "Unknown flip mode");
RETURN_FALSE;
}
@@ -4917,7 +4915,7 @@ PHP_FUNCTION(imageantialias)
zend_bool alias;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &alias) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &alias) == FAILURE) {
return;
}
@@ -4939,7 +4937,7 @@ PHP_FUNCTION(imagecrop)
zval *z_rect;
zval *tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &z_rect) == FAILURE) {
return;
}
@@ -4948,28 +4946,28 @@ PHP_FUNCTION(imagecrop)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") -1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
@@ -4994,7 +4992,7 @@ PHP_FUNCTION(imagecropauto)
gdImagePtr im;
gdImagePtr im_crop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ldl", &IM, &mode, &threshold, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ldl", &IM, &mode, &threshold, &color) == FAILURE) {
return;
}
@@ -5013,14 +5011,14 @@ PHP_FUNCTION(imagecropauto)
case GD_CROP_THRESHOLD:
if (color < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode");
+ php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode");
RETURN_FALSE;
}
im_crop = gdImageCropThreshold(im, color, (float) threshold);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown crop mode");
+ php_error_docref(NULL, E_WARNING, "Unknown crop mode");
RETURN_FALSE;
}
if (im_crop == NULL) {
@@ -5042,7 +5040,7 @@ PHP_FUNCTION(imagescale)
zend_long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED;
gdInterpolationMethod method;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
return;
}
method = tmp_m;
@@ -5091,14 +5089,14 @@ PHP_FUNCTION(imageaffine)
int i, nelems;
zval *zval_affine_elem = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(src, gdImagePtr, IM, -1, "Image", le_gd);
if ((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine array must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine array must have six elements");
RETURN_FALSE;
}
@@ -5115,7 +5113,7 @@ PHP_FUNCTION(imageaffine)
affine[i] = zval_get_double(zval_affine_elem);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5125,28 +5123,28 @@ PHP_FUNCTION(imageaffine)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") - 1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
pRect = &rect;
@@ -5180,7 +5178,7 @@ PHP_FUNCTION(imageaffinematrixget)
zval *tmp;
int res = GD_FALSE, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &type, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z", &type, &options) == FAILURE) {
return;
}
@@ -5189,20 +5187,20 @@ PHP_FUNCTION(imageaffinematrixget)
case GD_AFFINE_SCALE: {
double x, y;
if (!options || Z_TYPE_P(options) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array expected as options");
+ php_error_docref(NULL, E_WARNING, "Array expected as options");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "x", sizeof("x") - 1)) != NULL) {
x = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "y", sizeof("y") - 1)) != NULL) {
y = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
@@ -5220,7 +5218,7 @@ PHP_FUNCTION(imageaffinematrixget)
double angle;
if (!options) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
+ php_error_docref(NULL, E_WARNING, "Number is expected as option");
RETURN_FALSE;
}
@@ -5237,7 +5235,7 @@ PHP_FUNCTION(imageaffinematrixget)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %li", type);
RETURN_FALSE;
}
@@ -5264,12 +5262,12 @@ PHP_FUNCTION(imageaffinematrixconcat)
zval *z_m2;
int i, nelems;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &z_m1, &z_m2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &z_m1, &z_m2) == FAILURE) {
return;
}
if (((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m1))) != 6) || (nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m2))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine arrays must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine arrays must have six elements");
RETURN_FALSE;
}
@@ -5286,7 +5284,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m1[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5302,7 +5300,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m2[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5326,7 +5324,7 @@ PHP_FUNCTION(imagesetinterpolation)
gdImagePtr im;
zend_long method = GD_BILINEAR_FIXED;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &IM, &method) == FAILURE) {
return;
}
diff --git a/ext/gd/gd_compat.c b/ext/gd/gd_compat.c
index dc6a95ae11..d6d8d0b2f9 100644
--- a/ext/gd/gd_compat.c
+++ b/ext/gd/gd_compat.c
@@ -48,14 +48,13 @@ const char * gdPngGetVersionString()
int overflow2(int a, int b)
{
- TSRMLS_FETCH();
if(a <= 0 || b <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
+ php_error_docref(NULL, E_WARNING, "gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
return 1;
}
if(a > INT_MAX / b) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
+ php_error_docref(NULL, E_WARNING, "gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
return 1;
}
return 0;
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 0b79cb6f0d..0d4a25b13c 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -29,14 +29,12 @@ static void _php_image_output_putc(struct gdIOCtx *ctx, int c) /* {{{ */
* big endian architectures:
*/
unsigned char ch = (unsigned char) c;
- TSRMLS_FETCH();
- php_write(&ch, 1 TSRMLS_CC);
+ php_write(&ch, 1);
} /* }}} */
static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */
{
- TSRMLS_FETCH();
- return php_write((void *)buf, l TSRMLS_CC);
+ return php_write((void *)buf, l);
} /* }}} */
static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */
@@ -49,20 +47,17 @@ static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */
static void _php_image_stream_putc(struct gdIOCtx *ctx, int c) /* {{{ */ {
char ch = (char) c;
php_stream * stream = (php_stream *)ctx->data;
- TSRMLS_FETCH();
php_stream_write(stream, &ch, 1);
} /* }}} */
static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */
{
php_stream * stream = (php_stream *)ctx->data;
- TSRMLS_FETCH();
return php_stream_write(stream, (void *)buf, l);
} /* }}} */
static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) /* {{{ */
{
- TSRMLS_FETCH();
if(ctx->data) {
php_stream_close((php_stream *) ctx->data);
@@ -93,7 +88,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* from imagey<type>().
*/
if (image_type == PHP_GDIMG_TYPE_XBM) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp!|ll", &imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
return;
}
} else {
@@ -103,7 +98,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* PHP_GDIMG_TYPE_WBM
* PHP_GDIMG_TYPE_WEBP
* */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/!ll", &imgind, &to_zval, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z/!ll", &imgind, &to_zval, &quality, &basefilter) == FAILURE) {
return;
}
}
@@ -125,7 +120,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
RETURN_FALSE;
}
@@ -134,7 +129,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream");
+ php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, it must a filename or a stream");
RETURN_FALSE;
}
} else {
@@ -161,7 +156,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
switch(image_type) {
case PHP_GDIMG_CONVERT_WBM:
if(q<0||q>255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
}
case PHP_GDIMG_TYPE_JPG:
(*func_p)(im, ctx, q);
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 54890bc177..59fcd3533a 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -102,10 +102,9 @@ void php_gd_error_ex(int type, const char *format, ...)
{
va_list args;
- TSRMLS_FETCH();
va_start(args, format);
- php_verror(NULL, "", type, format, args TSRMLS_CC);
+ php_verror(NULL, "", type, format, args);
va_end(args);
}
@@ -113,10 +112,9 @@ void php_gd_error(const char *format, ...)
{
va_list args;
- TSRMLS_FETCH();
va_start(args, format);
- php_verror(NULL, "", E_WARNING, format, args TSRMLS_CC);
+ php_verror(NULL, "", E_WARNING, format, args);
va_end(args);
}
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 763efcf68c..c967de6ffb 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -412,8 +412,7 @@ static void *fontFetch (char **error, void *key)
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
if (!strcmp(dir, ".")) {
- TSRMLS_FETCH();
-#if HAVE_GETCWD
+ #if HAVE_GETCWD
dir = VCWD_GETCWD(cur_dir, MAXPATHLEN);
#elif HAVE_GETWD
dir = VCWD_GETWD(cur_dir);
diff --git a/ext/gd/libgd/gdkanji.c b/ext/gd/libgd/gdkanji.c
index 37f3bd10a0..2f6110c532 100644
--- a/ext/gd/libgd/gdkanji.c
+++ b/ext/gd/libgd/gdkanji.c
@@ -74,12 +74,11 @@ error (const char *format,...)
{
va_list args;
char *tmp;
- TSRMLS_FETCH();
va_start(args, format);
vspprintf(&tmp, 0, format, args);
va_end(args);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", LIBNAME, tmp);
+ php_error_docref(NULL, E_WARNING, "%s: %s", LIBNAME, tmp);
efree(tmp);
}
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index 7510b2425d..0ae90ccf89 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -32,8 +32,8 @@
/* open_basedir and safe_mode checks */
#define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
- if (!filename || php_check_open_basedir(filename TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
+ if (!filename || php_check_open_basedir(filename)) { \
+ php_error_docref(NULL, E_WARNING, errormsg); \
RETURN_FALSE; \
}
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index 938997a4a6..4554748643 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -140,13 +140,13 @@ ZEND_GET_MODULE(php_gettext)
#define PHP_GETTEXT_DOMAIN_LENGTH_CHECK \
if (domain_len > PHP_GETTEXT_MAX_DOMAIN_LENGTH) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "domain passed too long"); \
+ php_error_docref(NULL, E_WARNING, "domain passed too long"); \
RETURN_FALSE; \
}
#define PHP_GETTEXT_LENGTH_CHECK(check_name, check_len) \
if (check_len > PHP_GETTEXT_MAX_MSGID_LENGTH) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s passed too long", check_name); \
+ php_error_docref(NULL, E_WARNING, "%s passed too long", check_name); \
RETURN_FALSE; \
}
@@ -164,7 +164,7 @@ PHP_NAMED_FUNCTION(zif_textdomain)
char *domain, *domain_name, *retval;
size_t domain_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &domain, &domain_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &domain, &domain_len) == FAILURE) {
return;
}
@@ -189,7 +189,7 @@ PHP_NAMED_FUNCTION(zif_gettext)
char *msgid, *msgstr;
size_t msgid_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &msgid, &msgid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &msgid, &msgid_len) == FAILURE) {
return;
}
@@ -207,7 +207,7 @@ PHP_NAMED_FUNCTION(zif_dgettext)
char *domain, *msgid, *msgstr;
size_t domain_len, msgid_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &msgid, &msgid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &msgid, &msgid_len) == FAILURE) {
return;
}
@@ -228,7 +228,7 @@ PHP_NAMED_FUNCTION(zif_dcgettext)
size_t domain_len, msgid_len;
zend_long category;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &domain, &domain_len, &msgid, &msgid_len, &category) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl", &domain, &domain_len, &msgid, &msgid_len, &category) == FAILURE) {
return;
}
@@ -249,7 +249,7 @@ PHP_NAMED_FUNCTION(zif_bindtextdomain)
size_t domain_len, dir_len;
char *retval, dir_name[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &dir, &dir_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &dir, &dir_len) == FAILURE) {
return;
}
@@ -283,7 +283,7 @@ PHP_NAMED_FUNCTION(zif_ngettext)
size_t msgid1_len, msgid2_len;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl", &msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
return;
}
@@ -307,7 +307,7 @@ PHP_NAMED_FUNCTION(zif_dngettext)
size_t domain_len, msgid1_len, msgid2_len;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl", &domain, &domain_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl", &domain, &domain_len,
&msgid1, &msgid1_len, &msgid2, &msgid2_len, &count) == FAILURE) {
return;
}
@@ -335,7 +335,7 @@ PHP_NAMED_FUNCTION(zif_dcngettext)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssll", &domain, &domain_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssll", &domain, &domain_len,
&msgid1, &msgid1_len, &msgid2, &msgid2_len, &count, &category) == FAILURE) {
return;
}
@@ -362,7 +362,7 @@ PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset)
char *domain, *codeset, *retval = NULL;
size_t domain_len, codeset_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &domain, &domain_len, &codeset, &codeset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &domain, &domain_len, &codeset, &codeset_len) == FAILURE) {
return;
}
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 5d1d1e689e..beb016d84f 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -246,7 +246,7 @@ typedef struct _gmp_temp {
#define GMP_MAX_BASE 62
#define IS_GMP(zval) \
- (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce TSRMLS_CC))
+ (Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce))
#define GET_GMP_OBJECT_FROM_OBJ(obj) \
((gmp_object *) ((char *) (obj) - XtOffsetOf(gmp_object, std)))
@@ -286,7 +286,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
FREE_GMP_TEMP(dep1); \
FREE_GMP_TEMP(dep2); \
@@ -302,7 +302,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
FREE_GMP_TEMP(dep); \
RETURN_FALSE; \
@@ -317,7 +317,7 @@ if (IS_GMP(zval)) { \
temp.is_used = 0; \
} else { \
mpz_init(temp.num); \
- if (convert_to_gmp(temp.num, zval, 0 TSRMLS_CC) == FAILURE) { \
+ if (convert_to_gmp(temp.num, zval, 0) == FAILURE) { \
mpz_clear(temp.num); \
RETURN_FALSE; \
} \
@@ -326,11 +326,11 @@ if (IS_GMP(zval)) { \
}
#define INIT_GMP_RETVAL(gmpnumber) \
- gmp_create(return_value, &gmpnumber TSRMLS_CC)
+ gmp_create(return_value, &gmpnumber)
static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base);
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC);
-static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC);
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base);
+static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg);
/*
* The gmp_*_op functions provide an implementation for several common types
@@ -350,10 +350,10 @@ typedef void (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, gmp_ulong);
typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr);
typedef void (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, gmp_ulong);
-static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC);
-static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC);
-static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC);
-static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC);
+static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero);
+static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero);
+static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op);
+static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op);
/* Binary operations */
#define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop, 0)
@@ -367,21 +367,21 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_una
#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
-static void gmp_free_object_storage(zend_object *obj TSRMLS_DC) /* {{{ */
+static void gmp_free_object_storage(zend_object *obj) /* {{{ */
{
gmp_object *intern = GET_GMP_OBJECT_FROM_OBJ(obj);
mpz_clear(intern->num);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
-static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */
+static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *gmpnum_target) /* {{{ */
{
gmp_object *intern = emalloc(sizeof(gmp_object)
+ sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->std, ce TSRMLS_CC);
+ zend_object_std_init(&intern->std, ce);
object_properties_init(&intern->std, ce);
mpz_init(intern->num);
@@ -392,20 +392,20 @@ static inline zend_object *gmp_create_object_ex(zend_class_entry *ce, mpz_ptr *g
}
/* }}} */
-static zend_object *gmp_create_object(zend_class_entry *ce TSRMLS_DC) /* {{{ */
+static zend_object *gmp_create_object(zend_class_entry *ce) /* {{{ */
{
mpz_ptr gmpnum_dummy;
- return gmp_create_object_ex(ce, &gmpnum_dummy TSRMLS_CC);
+ return gmp_create_object_ex(ce, &gmpnum_dummy);
}
/* }}} */
-static inline void gmp_create(zval *target, mpz_ptr *gmpnum_target TSRMLS_DC) /* {{{ */
+static inline void gmp_create(zval *target, mpz_ptr *gmpnum_target) /* {{{ */
{
- ZVAL_OBJ(target, gmp_create_object_ex(gmp_ce, gmpnum_target TSRMLS_CC));
+ ZVAL_OBJ(target, gmp_create_object_ex(gmp_ce, gmpnum_target));
}
/* }}} */
-static int gmp_cast_object(zval *readobj, zval *writeobj, int type TSRMLS_DC) /* {{{ */
+static int gmp_cast_object(zval *readobj, zval *writeobj, int type) /* {{{ */
{
mpz_ptr gmpnum;
switch (type) {
@@ -427,9 +427,9 @@ static int gmp_cast_object(zval *readobj, zval *writeobj, int type TSRMLS_DC) /*
}
/* }}} */
-static HashTable *gmp_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable *gmp_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- HashTable *ht, *props = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht, *props = zend_std_get_properties(obj);
mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(obj);
zval zv;
@@ -444,12 +444,12 @@ static HashTable *gmp_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zend_object *gmp_clone_obj(zval *obj TSRMLS_DC) /* {{{ */
+static zend_object *gmp_clone_obj(zval *obj) /* {{{ */
{
gmp_object *old_object = GET_GMP_OBJECT_FROM_ZVAL(obj);
- gmp_object *new_object = GET_GMP_OBJECT_FROM_OBJ(gmp_create_object(Z_OBJCE_P(obj) TSRMLS_CC));
+ gmp_object *new_object = GET_GMP_OBJECT_FROM_OBJ(gmp_create_object(Z_OBJCE_P(obj)));
- zend_objects_clone_members( &new_object->std, &old_object->std TSRMLS_CC);
+ zend_objects_clone_members( &new_object->std, &old_object->std);
mpz_set(new_object->num, old_object->num);
@@ -457,11 +457,11 @@ static zend_object *gmp_clone_obj(zval *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2 TSRMLS_DC) {
+static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zval *op1, zval *op2) {
zend_long shift = zval_get_long(op2);
if (shift < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shift cannot be negative");
+ php_error_docref(NULL, E_WARNING, "Shift cannot be negative");
RETVAL_FALSE;
} else {
mpz_ptr gmpnum_op, gmpnum_result;
@@ -485,10 +485,10 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
#define DO_BINARY_OP(op) DO_BINARY_UI_OP_EX(op, NULL, 0)
#define DO_UNARY_OP(op) \
- gmp_zval_unary_op(result, op1, op TSRMLS_CC); \
+ gmp_zval_unary_op(result, op1, op); \
return SUCCESS;
-static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
{
switch (opcode) {
case ZEND_ADD:
@@ -498,17 +498,17 @@ static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval
case ZEND_MUL:
DO_BINARY_UI_OP(mpz_mul);
case ZEND_POW:
- shift_operator_helper(mpz_pow_ui, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_pow_ui, result, op1, op2);
return SUCCESS;
case ZEND_DIV:
DO_BINARY_UI_OP_EX(mpz_tdiv_q, mpz_tdiv_q_ui, 1);
case ZEND_MOD:
DO_BINARY_UI_OP_EX(mpz_mod, mpz_mod_ui, 1);
case ZEND_SL:
- shift_operator_helper(mpz_mul_2exp, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_mul_2exp, result, op1, op2);
return SUCCESS;
case ZEND_SR:
- shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2 TSRMLS_CC);
+ shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2);
return SUCCESS;
case ZEND_BW_OR:
DO_BINARY_OP(mpz_ior);
@@ -525,7 +525,7 @@ static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval
}
/* }}} */
-static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
{
zval op1_copy;
int retval;
@@ -535,7 +535,7 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op
op1 = &op1_copy;
}
- retval = gmp_do_operation_ex(opcode, result, op1, op2 TSRMLS_CC);
+ retval = gmp_do_operation_ex(opcode, result, op1, op2);
if (retval == SUCCESS && op1 == &op1_copy) {
zval_dtor(op1);
@@ -545,9 +545,9 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op
}
/* }}} */
-static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+static int gmp_compare(zval *result, zval *op1, zval *op2) /* {{{ */
{
- gmp_cmp(result, op1, op2 TSRMLS_CC);
+ gmp_cmp(result, op1, op2);
if (Z_TYPE_P(result) == IS_FALSE) {
ZVAL_LONG(result, 1);
}
@@ -555,7 +555,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data) /* {{{ */
{
mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object);
smart_str buf = {0};
@@ -566,12 +566,12 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len,
PHP_VAR_SERIALIZE_INIT(serialize_data);
gmp_strval(&zv, gmpnum, 10);
- php_var_serialize(&buf, &zv, &serialize_data TSRMLS_CC);
+ php_var_serialize(&buf, &zv, &serialize_data);
zval_dtor(&zv);
ZVAL_ARR(&zv, &tmp_arr);
- tmp_arr.ht = *zend_std_get_properties(object TSRMLS_CC);
- php_var_serialize(&buf, &zv, &serialize_data TSRMLS_CC);
+ tmp_arr.ht = *zend_std_get_properties(object);
+ php_var_serialize(&buf, &zv, &serialize_data);
PHP_VAR_SERIALIZE_DESTROY(serialize_data);
*buffer = (unsigned char *) estrndup(buf.s->val, buf.s->len);
@@ -582,7 +582,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, size_t *buf_len,
}
/* }}} */
-static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data) /* {{{ */
{
mpz_ptr gmpnum;
const unsigned char *p, *max;
@@ -592,31 +592,31 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
ZVAL_UNDEF(&zv);
PHP_VAR_UNSERIALIZE_INIT(unserialize_data);
- gmp_create(object, &gmpnum TSRMLS_CC);
+ gmp_create(object, &gmpnum);
p = buf;
max = buf + buf_len;
- if (!php_var_unserialize(&zv, &p, max, &unserialize_data TSRMLS_CC)
+ if (!php_var_unserialize(&zv, &p, max, &unserialize_data)
|| Z_TYPE(zv) != IS_STRING
- || convert_to_gmp(gmpnum, &zv, 10 TSRMLS_CC) == FAILURE
+ || convert_to_gmp(gmpnum, &zv, 10) == FAILURE
) {
- zend_throw_exception(NULL, "Could not unserialize number", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Could not unserialize number", 0);
goto exit;
}
zval_dtor(&zv);
ZVAL_UNDEF(&zv);
- if (!php_var_unserialize(&zv, &p, max, &unserialize_data TSRMLS_CC)
+ if (!php_var_unserialize(&zv, &p, max, &unserialize_data)
|| Z_TYPE(zv) != IS_ARRAY
) {
- zend_throw_exception(NULL, "Could not unserialize properties", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Could not unserialize properties", 0);
goto exit;
}
if (zend_hash_num_elements(Z_ARRVAL(zv)) != 0) {
zend_hash_copy(
- zend_std_get_properties(object TSRMLS_CC), Z_ARRVAL(zv),
+ zend_std_get_properties(object), Z_ARRVAL(zv),
(copy_ctor_func_t) zval_add_ref
);
}
@@ -646,7 +646,7 @@ ZEND_MINIT_FUNCTION(gmp)
{
zend_class_entry tmp_ce;
INIT_CLASS_ENTRY(tmp_ce, "GMP", NULL);
- gmp_ce = zend_register_internal_class(&tmp_ce TSRMLS_CC);
+ gmp_ce = zend_register_internal_class(&tmp_ce);
gmp_ce->create_object = gmp_create_object;
gmp_ce->serialize = gmp_serialize;
gmp_ce->unserialize = gmp_unserialize;
@@ -709,7 +709,7 @@ ZEND_MODULE_INFO_D(gmp)
/* {{{ convert_to_gmp
* Convert zval to be gmp number */
-static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
+static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base)
{
switch (Z_TYPE_P(val)) {
case IS_LONG:
@@ -735,7 +735,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), (int) base);
if (-1 == ret) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to convert variable to GMP - string is not an integer");
return FAILURE;
}
@@ -743,7 +743,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC)
return SUCCESS;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to convert variable to GMP - wrong type");
return FAILURE;
}
@@ -781,7 +781,7 @@ static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */
}
/* }}} */
-static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {{{ */
+static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg) /* {{{ */
{
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
@@ -813,7 +813,7 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
/* {{{ gmp_zval_binary_ui_op
Execute GMP binary operation.
*/
-static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
+static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result;
int use_ui = 0;
@@ -837,7 +837,7 @@ static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *
}
if (b_is_zero) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero operand not allowed");
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
RETURN_FALSE;
@@ -860,7 +860,7 @@ static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *
/* {{{ gmp_zval_binary_ui_op2
Execute GMP binary operation which returns 2 values.
*/
-static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero TSRMLS_DC)
+static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int check_b_zero)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result1, gmpnum_result2;
int use_ui = 0;
@@ -886,15 +886,15 @@ static inline void gmp_zval_binary_ui_op2(zval *return_value, zval *a_arg, zval
}
if (b_is_zero) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero operand not allowed");
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
RETURN_FALSE;
}
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -917,11 +917,11 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
{
zval *a_arg, *b_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero);
}
/* }}} */
@@ -929,7 +929,7 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
/* {{{ gmp_zval_unary_op
*/
-static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
+static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op)
{
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
@@ -945,7 +945,7 @@ static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_
/* {{{ gmp_zval_unary_ui_op
*/
-static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op TSRMLS_DC)
+static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_unary_ui_op_t gmp_op)
{
mpz_ptr gmpnum_result;
@@ -961,11 +961,11 @@ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_o
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
- gmp_zval_unary_ui_op(return_value, a_arg, gmp_op TSRMLS_CC);
+ gmp_zval_unary_ui_op(return_value, a_arg, gmp_op);
}
/* }}} */
@@ -975,11 +975,11 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
- gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC);
+ gmp_zval_unary_op(return_value, a_arg, gmp_op);
}
/* }}} */
@@ -991,7 +991,7 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1009,7 +1009,7 @@ static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
@@ -1031,27 +1031,27 @@ ZEND_FUNCTION(gmp_init)
mpz_ptr gmpnumber;
zend_long base = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &number_arg, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &number_arg, &base) == FAILURE) {
return;
}
if (base && (base < 2 || base > GMP_MAX_BASE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE);
+ php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, GMP_MAX_BASE);
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnumber);
- if (convert_to_gmp(gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) {
+ if (convert_to_gmp(gmpnumber, number_arg, base) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-int gmp_import_export_validate(zend_long size, zend_long options, int *order, int *endian TSRMLS_DC)
+int gmp_import_export_validate(zend_long size, zend_long options, int *order, int *endian)
{
if (size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Word size must be positive, %pd given", size);
return FAILURE;
}
@@ -1065,7 +1065,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
*order = 1;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid options: Conflicting word orders");
return FAILURE;
}
@@ -1082,7 +1082,7 @@ int gmp_import_export_validate(zend_long size, zend_long options, int *order, in
*endian = 0;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid options: Conflicting word endianness");
return FAILURE;
}
@@ -1101,16 +1101,16 @@ ZEND_FUNCTION(gmp_import)
int order, endian;
mpz_ptr gmpnumber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &size, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &data, &data_len, &size, &options) == FAILURE) {
return;
}
- if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ if (gmp_import_export_validate(size, options, &order, &endian) == FAILURE) {
RETURN_FALSE;
}
if ((data_len % size) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Input length must be a multiple of word size");
RETURN_FALSE;
}
@@ -1132,11 +1132,11 @@ ZEND_FUNCTION(gmp_export)
mpz_ptr gmpnumber;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
return;
}
- if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
+ if (gmp_import_export_validate(size, options, &order, &endian) == FAILURE) {
RETURN_FALSE;
}
@@ -1166,7 +1166,7 @@ ZEND_FUNCTION(gmp_intval)
{
zval *gmpnumber_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &gmpnumber_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &gmpnumber_arg) == FAILURE){
return;
}
@@ -1187,14 +1187,14 @@ ZEND_FUNCTION(gmp_strval)
mpz_ptr gmpnum;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &gmpnumber_arg, &base) == FAILURE) {
return;
}
/* Although the maximum base in general in GMP is 62, mpz_get_str()
* is explicitly limited to -36 when dealing with negative bases. */
if ((base < 2 && base > -2) || base > GMP_MAX_BASE || base < -36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
+ php_error_docref(NULL, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d or -2 and -36)", base, GMP_MAX_BASE);
RETURN_FALSE;
}
@@ -1237,22 +1237,22 @@ ZEND_FUNCTION(gmp_div_qr)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t) mpz_tdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t) mpz_tdiv_qr_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t) mpz_cdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t) mpz_cdiv_qr_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t) mpz_fdiv_qr_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op2(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t) mpz_fdiv_qr_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
}
@@ -1265,22 +1265,22 @@ ZEND_FUNCTION(gmp_div_r)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t) mpz_tdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t) mpz_tdiv_r_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t) mpz_cdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t) mpz_cdiv_r_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t) mpz_fdiv_r_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t) mpz_fdiv_r_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
}
@@ -1293,22 +1293,22 @@ ZEND_FUNCTION(gmp_div_q)
zval *a_arg, *b_arg;
zend_long round = GMP_ROUND_ZERO;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|l", &a_arg, &b_arg, &round) == FAILURE) {
return;
}
switch (round) {
case GMP_ROUND_ZERO:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t) mpz_tdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t) mpz_tdiv_q_ui, 1);
break;
case GMP_ROUND_PLUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t) mpz_cdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t) mpz_cdiv_q_ui, 1);
break;
case GMP_ROUND_MINUSINF:
- gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t) mpz_fdiv_q_ui, 1 TSRMLS_CC);
+ gmp_zval_binary_ui_op(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t) mpz_fdiv_q_ui, 1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
+ php_error_docref(NULL, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
@@ -1353,24 +1353,24 @@ ZEND_FUNCTION(gmp_fact)
{
zval *a_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
if (IS_GMP(a_arg)) {
mpz_ptr gmpnum_tmp = GET_GMP_FROM_ZVAL(a_arg);
if (mpz_sgn(gmpnum_tmp) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
RETURN_FALSE;
}
} else {
if (zval_get_long(a_arg) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
RETURN_FALSE;
}
}
- gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui TSRMLS_CC);
+ gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui);
}
/* }}} */
@@ -1383,12 +1383,12 @@ ZEND_FUNCTION(gmp_pow)
gmp_temp_t temp_base;
zend_long exp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &base_arg, &exp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &base_arg, &exp) == FAILURE) {
return;
}
if (exp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative exponent not supported");
+ php_error_docref(NULL, E_WARNING, "Negative exponent not supported");
RETURN_FALSE;
}
@@ -1412,7 +1412,7 @@ ZEND_FUNCTION(gmp_powm)
int use_ui = 0;
gmp_temp_t temp_base, temp_exp, temp_mod;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz", &base_arg, &exp_arg, &mod_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz", &base_arg, &exp_arg, &mod_arg) == FAILURE){
return;
}
@@ -1424,7 +1424,7 @@ ZEND_FUNCTION(gmp_powm)
} else {
FETCH_GMP_ZVAL_DEP(gmpnum_exp, exp_arg, temp_exp, temp_base);
if (mpz_sgn(gmpnum_exp) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter cannot be less than 0");
+ php_error_docref(NULL, E_WARNING, "Second parameter cannot be less than 0");
FREE_GMP_TEMP(temp_base);
FREE_GMP_TEMP(temp_exp);
RETURN_FALSE;
@@ -1433,7 +1433,7 @@ ZEND_FUNCTION(gmp_powm)
FETCH_GMP_ZVAL_DEP_DEP(gmpnum_mod, mod_arg, temp_mod, temp_exp, temp_base);
if (!mpz_cmp_ui(gmpnum_mod, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modulus may not be zero");
+ php_error_docref(NULL, E_WARNING, "Modulus may not be zero");
FREE_GMP_TEMP(temp_base);
FREE_GMP_TEMP(temp_exp);
FREE_GMP_TEMP(temp_mod);
@@ -1461,14 +1461,14 @@ ZEND_FUNCTION(gmp_sqrt)
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
@@ -1488,20 +1488,20 @@ ZEND_FUNCTION(gmp_sqrtrem)
gmp_temp_t temp_a;
zval result1, result2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -1521,19 +1521,19 @@ ZEND_FUNCTION(gmp_root)
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &nth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &nth) == FAILURE) {
return;
}
if (nth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The root must be positive");
+ php_error_docref(NULL, E_WARNING, "The root must be positive");
RETURN_FALSE;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (nth % 2 == 0 && mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't take even root of negative number");
+ php_error_docref(NULL, E_WARNING, "Can't take even root of negative number");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
@@ -1554,25 +1554,25 @@ ZEND_FUNCTION(gmp_rootrem)
gmp_temp_t temp_a;
zval result1, result2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &nth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &nth) == FAILURE) {
return;
}
if (nth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The root must be positive");
+ php_error_docref(NULL, E_WARNING, "The root must be positive");
RETURN_FALSE;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (nth % 2 == 0 && mpz_sgn(gmpnum_a) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't take even root of negative number");
+ php_error_docref(NULL, E_WARNING, "Can't take even root of negative number");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
- gmp_create(&result1, &gmpnum_result1 TSRMLS_CC);
- gmp_create(&result2, &gmpnum_result2 TSRMLS_CC);
+ gmp_create(&result1, &gmpnum_result1);
+ gmp_create(&result2, &gmpnum_result2);
array_init(return_value);
add_next_index_zval(return_value, &result1);
@@ -1592,7 +1592,7 @@ ZEND_FUNCTION(gmp_perfect_square)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1612,7 +1612,7 @@ ZEND_FUNCTION(gmp_prob_prime)
zend_long reps = 10;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &gmpnumber_arg, &reps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &gmpnumber_arg, &reps) == FAILURE) {
return;
}
@@ -1640,16 +1640,16 @@ ZEND_FUNCTION(gmp_gcdext)
gmp_temp_t temp_a, temp_b;
zval result_g, result_s, result_t;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
FETCH_GMP_ZVAL_DEP(gmpnum_b, b_arg, temp_b, temp_a);
- gmp_create(&result_g, &gmpnum_g TSRMLS_CC);
- gmp_create(&result_s, &gmpnum_s TSRMLS_CC);
- gmp_create(&result_t, &gmpnum_t TSRMLS_CC);
+ gmp_create(&result_g, &gmpnum_g);
+ gmp_create(&result_s, &gmpnum_s);
+ gmp_create(&result_t, &gmpnum_t);
array_init(return_value);
add_assoc_zval(return_value, "g", &result_g);
@@ -1671,7 +1671,7 @@ ZEND_FUNCTION(gmp_invert)
gmp_temp_t temp_a, temp_b;
int res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
@@ -1711,11 +1711,11 @@ ZEND_FUNCTION(gmp_cmp)
{
zval *a_arg, *b_arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
return;
}
- gmp_cmp(return_value, a_arg, b_arg TSRMLS_CC);
+ gmp_cmp(return_value, a_arg, b_arg);
}
/* }}} */
@@ -1728,7 +1728,7 @@ ZEND_FUNCTION(gmp_sign)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &a_arg) == FAILURE){
return;
}
@@ -1739,7 +1739,7 @@ ZEND_FUNCTION(gmp_sign)
}
/* }}} */
-static void gmp_init_random(TSRMLS_D)
+static void gmp_init_random(void)
{
if (!GMPG(rand_initialized)) {
/* Initialize */
@@ -1758,12 +1758,12 @@ ZEND_FUNCTION(gmp_random)
zend_long limiter = 20;
mpz_ptr gmpnum_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &limiter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &limiter) == FAILURE) {
return;
}
INIT_GMP_RETVAL(gmpnum_result);
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
#ifdef GMP_LIMB_BITS
mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS);
@@ -1781,11 +1781,11 @@ ZEND_FUNCTION(gmp_random_seed)
mpz_ptr gmpnum_seed;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &seed) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &seed) == FAILURE) {
return;
}
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
if (Z_TYPE_P(seed) == IS_LONG && Z_LVAL_P(seed) >= 0) {
gmp_randseed_ui(GMPG(rand_state), Z_LVAL_P(seed));
@@ -1807,17 +1807,17 @@ ZEND_FUNCTION(gmp_random_bits)
zend_long bits;
mpz_ptr gmpnum_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bits) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &bits) == FAILURE) {
return;
}
if (bits <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The number of bits must be positive");
+ php_error_docref(NULL, E_WARNING, "The number of bits must be positive");
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnum_result);
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
mpz_urandomb(gmpnum_result, GMPG(rand_state), bits);
}
@@ -1831,18 +1831,18 @@ ZEND_FUNCTION(gmp_random_range)
mpz_ptr gmpnum_min, gmpnum_max, gmpnum_result;
gmp_temp_t temp_a, temp_b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &min_arg, &max_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &min_arg, &max_arg) == FAILURE) {
return;
}
- gmp_init_random(TSRMLS_C);
+ gmp_init_random();
FETCH_GMP_ZVAL(gmpnum_max, max_arg, temp_a);
if (Z_TYPE_P(min_arg) == IS_LONG && Z_LVAL_P(min_arg) >= 0) {
if (mpz_cmp_ui(gmpnum_max, Z_LVAL_P(min_arg)) <= 0) {
FREE_GMP_TEMP(temp_a);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ php_error_docref(NULL, E_WARNING, "The minimum value must be less than the maximum value");
RETURN_FALSE;
}
@@ -1868,7 +1868,7 @@ ZEND_FUNCTION(gmp_random_range)
if (mpz_cmp(gmpnum_max, gmpnum_min) <= 0) {
FREE_GMP_TEMP(temp_b);
FREE_GMP_TEMP(temp_a);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ php_error_docref(NULL, E_WARNING, "The minimum value must be less than the maximum value");
RETURN_FALSE;
}
@@ -1934,12 +1934,12 @@ ZEND_FUNCTION(gmp_setbit)
zend_bool set = 1;
mpz_ptr gmpnum_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -1961,12 +1961,12 @@ ZEND_FUNCTION(gmp_clrbit)
zend_long index;
mpz_ptr gmpnum_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &a_arg, gmp_ce, &index) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &a_arg, gmp_ce, &index) == FAILURE){
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -1984,12 +1984,12 @@ ZEND_FUNCTION(gmp_testbit)
mpz_ptr gmpnum_a;
gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &index) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &index) == FAILURE){
return;
}
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -2024,12 +2024,12 @@ ZEND_FUNCTION(gmp_scan0)
gmp_temp_t temp_a;
zend_long start;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &start) == FAILURE){
return;
}
if (start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Starting index must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -2049,12 +2049,12 @@ ZEND_FUNCTION(gmp_scan1)
gmp_temp_t temp_a;
zend_long start;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &start) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl", &a_arg, &start) == FAILURE){
return;
}
if (start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Starting index must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Starting index must be greater than or equal to zero");
RETURN_FALSE;
}
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 406f074da3..09dea0dda3 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -126,13 +126,13 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &algo, &algo_len, &data, &data_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &algo, &algo_len, &data, &data_len, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (isfilename) {
@@ -243,14 +243,14 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
void *context;
php_stream *stream = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|b", &algo, &algo_len, &data, &data_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|b", &algo, &algo_len, &data, &data_len,
&key, &key_len, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (isfilename) {
@@ -336,20 +336,20 @@ PHP_FUNCTION(hash_init)
const php_hash_ops *ops;
php_hash_data *hash;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|ls", &algo, &algo_len, &options, &key, &key_len) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (options & PHP_HASH_HMAC &&
key_len <= 0) {
/* Note: a zero length key is no key at all */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "HMAC requested without a key");
+ php_error_docref(NULL, E_WARNING, "HMAC requested without a key");
RETURN_FALSE;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION(hash_update)
char *data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &zhash, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zhash, &data, &data_len) == FAILURE) {
return;
}
@@ -420,7 +420,7 @@ PHP_FUNCTION(hash_update_stream)
php_stream *stream = NULL;
zend_long length = -1, didread = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &zhash, &zstream, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &zhash, &zstream, &length) == FAILURE) {
return;
}
@@ -459,7 +459,7 @@ PHP_FUNCTION(hash_update_file)
char *filename, buf[1024];
size_t filename_len, n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
@@ -491,7 +491,7 @@ PHP_FUNCTION(hash_final)
zend_string *digest;
int digest_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &zhash, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &zhash, &raw_output) == FAILURE) {
return;
}
@@ -554,7 +554,7 @@ PHP_FUNCTION(hash_copy)
void *context;
int res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zhash) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zhash) == FAILURE) {
return;
}
@@ -609,28 +609,28 @@ PHP_FUNCTION(hash_pbkdf2)
const php_hash_ops *ops;
void *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|lb", &algo, &algo_len, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl|lb", &algo, &algo_len, &pass, &pass_len, &salt, &salt_len, &iterations, &length, &raw_output) == FAILURE) {
return;
}
ops = php_hash_fetch_ops(algo, algo_len);
if (!ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown hashing algorithm: %s", algo);
+ php_error_docref(NULL, E_WARNING, "Unknown hashing algorithm: %s", algo);
RETURN_FALSE;
}
if (iterations <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
+ php_error_docref(NULL, E_WARNING, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
RETURN_FALSE;
}
if (length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
RETURN_FALSE;
}
if (salt_len > INT_MAX - 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
+ php_error_docref(NULL, E_WARNING, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
RETURN_FALSE;
}
@@ -729,18 +729,18 @@ PHP_FUNCTION(hash_equals)
char *known_str, *user_str;
int result = 0, j;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &known_zval, &user_zval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &known_zval, &user_zval) == FAILURE) {
return;
}
/* We only allow comparing string to prevent unexpected results. */
if (Z_TYPE_P(known_zval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
+ php_error_docref(NULL, E_WARNING, "Expected known_string to be a string, %s given", zend_zval_type_name(known_zval));
RETURN_FALSE;
}
if (Z_TYPE_P(user_zval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
+ php_error_docref(NULL, E_WARNING, "Expected user_string to be a string, %s given", zend_zval_type_name(user_zval));
RETURN_FALSE;
}
@@ -762,7 +762,7 @@ PHP_FUNCTION(hash_equals)
/* Module Housekeeping */
-static void php_hash_dtor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_hash_dtor(zend_resource *rsrc) /* {{{ */
{
php_hash_data *hash = (php_hash_data*)rsrc->ptr;
@@ -820,9 +820,9 @@ static void mhash_init(INIT_FUNC_ARGS)
}
len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name, strlen(algorithm.mhash_name));
- zend_register_long_constant(buf, len, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
+ zend_register_long_constant(buf, len, algorithm.value, CONST_CS | CONST_PERSISTENT, module_number);
}
- zend_register_internal_module(&mhash_module_entry TSRMLS_CC);
+ zend_register_internal_module(&mhash_module_entry);
}
/* {{{ proto string mhash(int hash, string data [, string key])
@@ -832,7 +832,7 @@ PHP_FUNCTION(mhash)
zval *z_algorithm;
zend_long algorithm;
- if (zend_parse_parameters(1 TSRMLS_CC, "z", &z_algorithm) == FAILURE) {
+ if (zend_parse_parameters(1, "z", &z_algorithm) == FAILURE) {
return;
}
@@ -864,7 +864,7 @@ PHP_FUNCTION(mhash_get_hash_name)
{
zend_long algorithm;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &algorithm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
return;
}
@@ -895,7 +895,7 @@ PHP_FUNCTION(mhash_get_block_size)
{
zend_long algorithm;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &algorithm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &algorithm) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -924,13 +924,13 @@ PHP_FUNCTION(mhash_keygen_s2k)
size_t password_len, salt_len;
char padded_salt[SALT_SIZE];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lssl", &algorithm, &password, &password_len, &salt, &salt_len, &l_bytes) == FAILURE) {
return;
}
bytes = (int)l_bytes;
if (bytes <= 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "the byte parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "the byte parameter must be greater than 0");
RETURN_FALSE;
}
diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c
index 98891f3b77..ddef755cb4 100644
--- a/ext/hash/hash_md.c
+++ b/ext/hash/hash_md.c
@@ -112,7 +112,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
PHP_MD5_CTX context;
unsigned char digest[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
@@ -144,7 +144,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c
index 003f05a774..19cedaf19e 100644
--- a/ext/hash/hash_sha.c
+++ b/ext/hash/hash_sha.c
@@ -95,7 +95,7 @@ PHP_FUNCTION(sha1)
PHP_SHA1_CTX context;
unsigned char digest[20];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
@@ -128,7 +128,7 @@ PHP_FUNCTION(sha1_file)
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index c8dcc15e99..16c5eac578 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -200,7 +200,7 @@ typedef enum _php_iconv_enc_scheme_t {
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC);
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset);
static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_t nbytes, const char *enc);
@@ -212,11 +212,11 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode);
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D);
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D);
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void);
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void);
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC);
-static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags TSRMLS_DC);
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len);
+static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags);
static int php_iconv_output_handler(void **nothing, php_output_context *output_context);
/* }}} */
@@ -233,9 +233,9 @@ static PHP_INI_MH(OnUpdateInputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -246,9 +246,9 @@ static PHP_INI_MH(OnUpdateOutputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -259,9 +259,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -309,12 +309,12 @@ PHP_MINIT_FUNCTION(miconv)
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_STRICT", PHP_ICONV_MIME_DECODE_STRICT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_CONTINUE_ON_ERROR", PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR, CONST_CS | CONST_PERSISTENT);
- if (php_iconv_stream_filter_register_factory(TSRMLS_C) != PHP_ICONV_ERR_SUCCESS) {
+ if (php_iconv_stream_filter_register_factory() != PHP_ICONV_ERR_SUCCESS) {
return FAILURE;
}
- php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict);
return SUCCESS;
}
@@ -323,7 +323,7 @@ PHP_MINIT_FUNCTION(miconv)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(miconv)
{
- php_iconv_stream_filter_unregister_factory(TSRMLS_C);
+ php_iconv_stream_filter_unregister_factory();
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -334,8 +334,8 @@ PHP_MINFO_FUNCTION(miconv)
{
zval *iconv_impl, *iconv_ver;
- iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1 TSRMLS_CC);
- iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1 TSRMLS_CC);
+ iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1);
+ iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1);
php_info_print_table_start();
php_info_print_table_row(2, "iconv support", "enabled");
@@ -347,7 +347,7 @@ PHP_MINFO_FUNCTION(miconv)
}
/* }}} */
-static char *get_internal_encoding(TSRMLS_D) {
+static char *get_internal_encoding(void) {
if (ICONVG(internal_encoding) && ICONVG(internal_encoding)[0]) {
return ICONVG(internal_encoding);
} else if (PG(internal_encoding) && PG(internal_encoding)[0]) {
@@ -358,7 +358,7 @@ static char *get_internal_encoding(TSRMLS_D) {
return "";
}
-static char *get_input_encoding(TSRMLS_D) {
+static char *get_input_encoding(void) {
if (ICONVG(input_encoding) && ICONVG(input_encoding)[0]) {
return ICONVG(input_encoding);
} else if (PG(input_encoding) && PG(input_encoding)[0]) {
@@ -369,7 +369,7 @@ static char *get_input_encoding(TSRMLS_D) {
return "";
}
-static char *get_output_encoding(TSRMLS_D) {
+static char *get_output_encoding(void) {
if (ICONVG(output_encoding) && ICONVG(output_encoding)[0]) {
return ICONVG(output_encoding);
} else if (PG(output_encoding) && PG(output_encoding)[0]) {
@@ -381,20 +381,20 @@ static char *get_output_encoding(TSRMLS_D) {
}
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C)) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)) {
+ if (php_output_get_level()) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))) {
return FAILURE;
}
}
return SUCCESS;
}
-static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
- return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags TSRMLS_CC);
+ return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags);
}
static int php_iconv_output_handler(void **nothing, php_output_context *output_context)
@@ -404,7 +404,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
PHP_OUTPUT_TSRMLS(output_context);
if (output_context->op & PHP_OUTPUT_HANDLER_START) {
- output_status = php_output_get_status(TSRMLS_C);
+ output_status = php_output_get_status();
if (output_status & PHP_OUTPUT_SENT) {
return FAILURE;
}
@@ -422,16 +422,16 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
size_t len;
- char *p = strstr(get_output_encoding(TSRMLS_C), "//");
+ char *p = strstr(get_output_encoding(), "//");
if (p) {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding()), get_output_encoding());
} else {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding());
}
if (content_type && SUCCESS == sapi_add_header(content_type, (uint)len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -439,7 +439,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (output_context->in.used) {
zend_string *out;
output_context->out.free = 1;
- _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+ _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(), get_internal_encoding()), get_output_encoding(), get_internal_encoding());
if (out) {
output_context->out.data = estrndup(out->val, out->len);
output_context->out.used = out->len;
@@ -1973,41 +1973,41 @@ out:
/* }}} */
/* {{{ php_iconv_show_error() */
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC)
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset)
{
switch (err) {
case PHP_ICONV_ERR_SUCCESS:
break;
case PHP_ICONV_ERR_CONVERTER:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot open converter");
+ php_error_docref(NULL, E_NOTICE, "Cannot open converter");
break;
case PHP_ICONV_ERR_WRONG_CHARSET:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
+ php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
in_charset, out_charset);
break;
case PHP_ICONV_ERR_ILLEGAL_CHAR:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an incomplete multibyte character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an incomplete multibyte character in input string");
break;
case PHP_ICONV_ERR_ILLEGAL_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an illegal character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an illegal character in input string");
break;
case PHP_ICONV_ERR_TOO_BIG:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer length exceeded");
+ php_error_docref(NULL, E_WARNING, "Buffer length exceeded");
break;
case PHP_ICONV_ERR_MALFORMED:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Malformed string");
+ php_error_docref(NULL, E_WARNING, "Malformed string");
break;
default:
/* other error */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown error (%d)", errno);
+ php_error_docref(NULL, E_NOTICE, "Unknown error (%d)", errno);
break;
}
}
@@ -2017,7 +2017,7 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
Returns the character count of str */
PHP_FUNCTION(iconv_strlen)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
@@ -2025,18 +2025,18 @@ PHP_FUNCTION(iconv_strlen)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s",
&str, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strlen(&retval, str->val, str->len, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
RETVAL_LONG(retval);
} else {
@@ -2049,7 +2049,7 @@ PHP_FUNCTION(iconv_strlen)
Returns specified part of a string */
PHP_FUNCTION(iconv_substr)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
zend_long offset, length = 0;
@@ -2058,14 +2058,14 @@ PHP_FUNCTION(iconv_substr)
smart_str retval = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|ls",
&str, &offset, &length,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2074,7 +2074,7 @@ PHP_FUNCTION(iconv_substr)
}
err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s != NULL) {
RETURN_STR(retval.s);
@@ -2088,7 +2088,7 @@ PHP_FUNCTION(iconv_substr)
Finds position of first occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2098,19 +2098,19 @@ PHP_FUNCTION(iconv_strpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ls",
&haystk, &ndl,
&offset, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string.");
RETURN_FALSE;
}
@@ -2120,7 +2120,7 @@ PHP_FUNCTION(iconv_strpos)
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
offset, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2134,7 +2134,7 @@ PHP_FUNCTION(iconv_strpos)
Finds position of last occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strrpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2143,7 +2143,7 @@ PHP_FUNCTION(iconv_strrpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|s",
&haystk, &ndl,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
@@ -2154,13 +2154,13 @@ PHP_FUNCTION(iconv_strrpos)
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
-1, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2181,13 +2181,13 @@ PHP_FUNCTION(iconv_mime_encode)
smart_str retval = {0};
php_iconv_err_t err;
- const char *in_charset = get_internal_encoding(TSRMLS_C);
+ const char *in_charset = get_internal_encoding();
const char *out_charset = in_charset;
zend_long line_len = 76;
const char *lfchars = "\r\n";
php_iconv_enc_scheme_t scheme_id = PHP_ICONV_ENC_SCHEME_BASE64;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|a",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|a",
&field_name, &field_value,
&pref) == FAILURE) {
@@ -2213,7 +2213,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "input-charset", sizeof("input-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2225,7 +2225,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "output-charset", sizeof("output-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2263,7 +2263,7 @@ PHP_FUNCTION(iconv_mime_encode)
err = _php_iconv_mime_encode(&retval, field_name->val, field_name->len,
field_value->val, field_value->len, line_len, lfchars, scheme_id,
out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2287,7 +2287,7 @@ PHP_FUNCTION(iconv_mime_encode)
PHP_FUNCTION(iconv_mime_decode)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
@@ -2295,19 +2295,19 @@ PHP_FUNCTION(iconv_mime_decode)
php_iconv_err_t err;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, (int)mode);
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2327,7 +2327,7 @@ PHP_FUNCTION(iconv_mime_decode)
PHP_FUNCTION(iconv_mime_decode_headers)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
char *enc_str_tmp;
@@ -2335,14 +2335,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2413,7 +2413,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
}
if (err != PHP_ICONV_ERR_SUCCESS) {
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
zval_dtor(return_value);
RETVAL_FALSE;
}
@@ -2430,17 +2430,17 @@ PHP_NAMED_FUNCTION(php_if_iconv)
php_iconv_err_t err;
zend_string *out_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssS",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssS",
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer) == FAILURE)
return;
if (in_charset_len >= ICONV_CSNMAXLEN || out_charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = php_iconv_string(in_buffer->val, (size_t)in_buffer->len, &out_buffer, out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
RETVAL_STR(out_buffer);
} else {
@@ -2461,11 +2461,11 @@ PHP_FUNCTION(iconv_set_encoding)
size_t type_len, retval;
zend_string *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &type, &type_len, &charset) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &type, &type_len, &charset) == FAILURE)
return;
if (charset->len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2497,20 +2497,20 @@ PHP_FUNCTION(iconv_get_encoding)
char *type = "all";
size_t type_len = sizeof("all")-1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &type, &type_len) == FAILURE)
return;
if (!strcasecmp("all", type)) {
array_init(return_value);
- add_assoc_string(return_value, "input_encoding", get_input_encoding(TSRMLS_C));
- add_assoc_string(return_value, "output_encoding", get_output_encoding(TSRMLS_C));
- add_assoc_string(return_value, "internal_encoding", get_internal_encoding(TSRMLS_C));
+ add_assoc_string(return_value, "input_encoding", get_input_encoding());
+ add_assoc_string(return_value, "output_encoding", get_output_encoding());
+ add_assoc_string(return_value, "internal_encoding", get_internal_encoding());
} else if (!strcasecmp("input_encoding", type)) {
- RETVAL_STRING(get_input_encoding(TSRMLS_C));
+ RETVAL_STRING(get_input_encoding());
} else if (!strcasecmp("output_encoding", type)) {
- RETVAL_STRING(get_output_encoding(TSRMLS_C));
+ RETVAL_STRING(get_output_encoding());
} else if (!strcasecmp("internal_encoding", type)) {
- RETVAL_STRING(get_internal_encoding(TSRMLS_C));
+ RETVAL_STRING(get_internal_encoding());
} else {
RETURN_FALSE;
}
@@ -2577,7 +2577,7 @@ static int php_iconv_stream_filter_append_bucket(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
const char *ps, size_t buf_len, size_t *consumed,
- int persistent TSRMLS_DC)
+ int persistent)
{
php_stream_bucket *new_bucket;
char *out_buf = NULL;
@@ -2610,14 +2610,14 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > 0) {
if (self->stub_len >= sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
self->stub[self->stub_len++] = *(ps++);
@@ -2639,11 +2639,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2652,11 +2652,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2667,12 +2667,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2689,13 +2689,13 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
memcpy(self->stub, ps, icnt);
@@ -2703,7 +2703,7 @@ static int php_iconv_stream_filter_append_bucket(
ps += icnt;
icnt = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
goto out_failure;
}
break;
@@ -2716,11 +2716,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2729,11 +2729,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2744,12 +2744,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2762,10 +2762,10 @@ static int php_iconv_stream_filter_append_bucket(
}
if (out_buf_size > ocnt) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
} else {
pefree(out_buf, persistent);
}
@@ -2784,7 +2784,7 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
- size_t *bytes_consumed, int flags TSRMLS_DC)
+ size_t *bytes_consumed, int flags)
{
php_stream_bucket *bucket = NULL;
size_t consumed = 0;
@@ -2793,21 +2793,21 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags != PSFS_FLAG_NORMAL) {
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, NULL, 0, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
}
@@ -2820,14 +2820,14 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
out_failure:
if (bucket != NULL) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
return PSFS_ERR_FATAL;
}
/* }}} */
/* {{{ php_iconv_stream_filter_cleanup */
-static void php_iconv_stream_filter_cleanup(php_stream_filter *filter TSRMLS_DC)
+static void php_iconv_stream_filter_cleanup(php_stream_filter *filter)
{
php_iconv_stream_filter_dtor((php_iconv_stream_filter *)Z_PTR(filter->abstract));
pefree(Z_PTR(filter->abstract), ((php_iconv_stream_filter *)Z_PTR(filter->abstract))->persistent);
@@ -2841,7 +2841,7 @@ static php_stream_filter_ops php_iconv_stream_filter_ops = {
};
/* {{{ php_iconv_stream_filter_create */
-static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent TSRMLS_DC)
+static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent)
{
php_stream_filter *retval = NULL;
php_iconv_stream_filter *inst;
@@ -2886,7 +2886,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
/* }}} */
/* {{{ php_iconv_stream_register_factory */
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void)
{
static php_stream_filter_factory filter_factory = {
php_iconv_stream_filter_factory_create
@@ -2894,7 +2894,7 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
if (FAILURE == php_stream_filter_register_factory(
php_iconv_stream_filter_ops.label,
- &filter_factory TSRMLS_CC)) {
+ &filter_factory)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;
@@ -2902,10 +2902,10 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
/* }}} */
/* {{{ php_iconv_stream_unregister_factory */
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void)
{
if (FAILURE == php_stream_filter_unregister_factory(
- php_iconv_stream_filter_ops.label TSRMLS_CC)) {
+ php_iconv_stream_filter_ops.label)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index 8dc56c5223..2c358375cf 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -74,10 +74,10 @@ MAILSTREAM DEFAULTPROTO;
# define PHP_IMAP_EXPORT
#endif
-static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC);
-static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC);
-static zend_string* _php_imap_parse_address(ADDRESS *addresslist, zval *paddress TSRMLS_DC);
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC);
+static void _php_make_header_object(zval *myzvalue, ENVELOPE *en);
+static void _php_imap_add_body(zval *arg, BODY *body);
+static zend_string* _php_imap_parse_address(ADDRESS *addresslist, zval *paddress);
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist);
/* the gets we use */
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md);
@@ -592,13 +592,13 @@ static int le_imap;
#define PHP_IMAP_CHECK_MSGNO(msgindex) \
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); \
+ php_error_docref(NULL, E_WARNING, "Bad message number"); \
RETURN_FALSE; \
} \
/* {{{ mail_close_it
*/
-static void mail_close_it(zend_resource *rsrc TSRMLS_DC)
+static void mail_close_it(zend_resource *rsrc)
{
pils *imap_le_struct = (pils *)rsrc->ptr;
@@ -622,7 +622,7 @@ static void mail_close_it(zend_resource *rsrc TSRMLS_DC)
/* {{{ add_assoc_object
*/
-static zval *add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
+static zval *add_assoc_object(zval *arg, char *key, zval *tmp)
{
HashTable *symtable;
@@ -637,7 +637,7 @@ static zval *add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
/* {{{ add_next_index_object
*/
-static inline zval *add_next_index_object(zval *arg, zval *tmp TSRMLS_DC)
+static inline zval *add_next_index_object(zval *arg, zval *tmp)
{
HashTable *symtable;
@@ -760,7 +760,6 @@ void mail_free_messagelist(MESSAGELIST **msglist, MESSAGELIST **tail)
void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
{
zval t_map, *return_value;
- TSRMLS_FETCH();
return_value = *IMAPG(quota_return);
@@ -788,7 +787,6 @@ void mail_getquota(MAILSTREAM *stream, char *qroot, QUOTALIST *qlist)
*/
void mail_getacl(MAILSTREAM *stream, char *mailbox, ACLLIST *alist)
{
- TSRMLS_FETCH();
/* walk through the ACLLIST */
for(; alist; alist = alist->next) {
@@ -1079,7 +1077,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
ecur = IMAPG(imap_errorstack);
while (ecur != NIL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
+ php_error_docref(NULL, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
ecur = ecur->next;
}
}
@@ -1091,7 +1089,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
acur = IMAPG(imap_alertstack);
while (acur != NIL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", acur->LTEXT);
+ php_error_docref(NULL, E_NOTICE, "%s", acur->LTEXT);
acur = acur->next;
}
}
@@ -1152,7 +1150,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zval *params = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
+ if (zend_parse_parameters(argc, "pss|lla", &mailbox, &mailbox_len, &user, &user_len,
&passwd, &passwd_len, &flags, &retries, &params) == FAILURE) {
return;
}
@@ -1193,7 +1191,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
mail_parameters(NIL, DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_P(z_auth_method));
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
}
}
}
@@ -1201,7 +1199,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
break;
case IS_LONG:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
break;
}
}
@@ -1218,7 +1216,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
/* local filename, need to perform open_basedir check */
- if (mailbox[0] != '{' && php_check_open_basedir(mailbox TSRMLS_CC)) {
+ if (mailbox[0] != '{' && php_check_open_basedir(mailbox)) {
RETURN_FALSE;
}
@@ -1228,7 +1226,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifdef SET_MAXLOGINTRIALS
if (argc >= 5) {
if (retries < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING ,"Retries must be greater or equal to 0");
+ php_error_docref(NULL, E_WARNING ,"Retries must be greater or equal to 0");
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries);
}
@@ -1238,7 +1236,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
imap_stream = mail_open(NIL, mailbox, flags);
if (imap_stream == NIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't open stream %s", mailbox);
+ php_error_docref(NULL, E_WARNING, "Couldn't open stream %s", mailbox);
efree(IMAPG(imap_user)); IMAPG(imap_user) = 0;
efree(IMAPG(imap_password)); IMAPG(imap_password) = 0;
RETURN_FALSE;
@@ -1272,7 +1270,7 @@ PHP_FUNCTION(imap_reopen)
long flags=NIL;
long cl_flags=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ll", &streamind, &mailbox, &mailbox_len, &options, &retries) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ll", &streamind, &mailbox, &mailbox_len, &options, &retries) == FAILURE) {
return;
}
@@ -1292,14 +1290,14 @@ PHP_FUNCTION(imap_reopen)
}
#endif
/* local filename, need to perform open_basedir check */
- if (mailbox[0] != '{' && php_check_open_basedir(mailbox TSRMLS_CC)) {
+ if (mailbox[0] != '{' && php_check_open_basedir(mailbox)) {
RETURN_FALSE;
}
imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags);
if (imap_le_struct->imap_stream == NIL) {
zend_list_delete(Z_RES_P(streamind));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream");
+ php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1322,7 +1320,7 @@ PHP_FUNCTION(imap_append)
long start_offset = 0; /* Start offset (not used) */
int global = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|ss", &streamind, &folder, &folder_len, &message, &message_len, &flags, &flags_len, &internal_date, &internal_date_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|ss", &streamind, &folder, &folder_len, &message, &message_len, &flags, &flags_len, &internal_date, &internal_date_len) == FAILURE) {
return;
}
@@ -1330,17 +1328,17 @@ PHP_FUNCTION(imap_append)
if (internal_date) {
/* Make sure the given internal_date string matches the RFC specifiedformat */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC))== NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex))== NULL) {
zend_string_free(regex);
RETURN_FALSE;
}
zend_string_free(regex);
php_pcre_match_impl(pce, internal_date, internal_date_len, return_value, subpats, global,
- 0, regex_flags, start_offset TSRMLS_CC);
+ 0, regex_flags, start_offset);
if (!Z_LVAL_P(return_value)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "internal date not correctly formatted");
+ php_error_docref(NULL, E_WARNING, "internal date not correctly formatted");
internal_date = NULL;
}
}
@@ -1364,7 +1362,7 @@ PHP_FUNCTION(imap_num_msg)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1381,7 +1379,7 @@ PHP_FUNCTION(imap_ping)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1398,7 +1396,7 @@ PHP_FUNCTION(imap_num_recent)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1418,7 +1416,7 @@ PHP_FUNCTION(imap_get_quota)
int qroot_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &qroot, &qroot_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &qroot, &qroot_len) == FAILURE) {
return;
}
@@ -1430,7 +1428,7 @@ PHP_FUNCTION(imap_get_quota)
/* set the callback for the GET_QUOTA function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
if (!imap_getquota(imap_le_struct->imap_stream, qroot)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquota failed");
+ php_error_docref(NULL, E_WARNING, "c-client imap_getquota failed");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1446,7 +1444,7 @@ PHP_FUNCTION(imap_get_quotaroot)
int mbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &mbox, &mbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &mbox, &mbox_len) == FAILURE) {
return;
}
@@ -1458,7 +1456,7 @@ PHP_FUNCTION(imap_get_quotaroot)
/* set the callback for the GET_QUOTAROOT function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
if (!imap_getquotaroot(imap_le_struct->imap_stream, mbox)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "c-client imap_getquotaroot failed");
+ php_error_docref(NULL, E_WARNING, "c-client imap_getquotaroot failed");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1476,7 +1474,7 @@ PHP_FUNCTION(imap_set_quota)
pils *imap_le_struct;
STRINGLIST limits;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &streamind, &qroot, &qroot_len, &mailbox_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &streamind, &qroot, &qroot_len, &mailbox_size) == FAILURE) {
return;
}
@@ -1499,7 +1497,7 @@ PHP_FUNCTION(imap_setacl)
int mailbox_len, id_len, rights_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &streamind, &mailbox, &mailbox_len, &id, &id_len, &rights, &rights_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &streamind, &mailbox, &mailbox_len, &id, &id_len, &rights, &rights_len) == FAILURE) {
return;
}
@@ -1518,7 +1516,7 @@ PHP_FUNCTION(imap_getacl)
int mailbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &mailbox, &mailbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &mailbox, &mailbox_len) == FAILURE) {
return;
}
@@ -1549,7 +1547,7 @@ PHP_FUNCTION(imap_expunge)
zval *streamind;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1569,12 +1567,12 @@ PHP_FUNCTION(imap_gc)
pils *imap_le_struct;
long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the flags parameter");
RETURN_FALSE;
}
@@ -1595,7 +1593,7 @@ PHP_FUNCTION(imap_close)
long options = 0, flags = NIL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &streamind, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &streamind, &options) == FAILURE) {
return;
}
@@ -1606,7 +1604,7 @@ PHP_FUNCTION(imap_close)
/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
if (flags && ((flags & ~PHP_EXPUNGE) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the flags parameter");
RETURN_FALSE;
}
@@ -1635,7 +1633,7 @@ PHP_FUNCTION(imap_headers)
unsigned int msgno;
char tmp[MAILTMPLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1685,12 +1683,12 @@ PHP_FUNCTION(imap_body)
char *body;
unsigned long body_len = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -1705,7 +1703,7 @@ PHP_FUNCTION(imap_body)
msgindex = msgno;
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -1728,7 +1726,7 @@ PHP_FUNCTION(imap_mail_copy)
int seq_len, folder_len, argc = ZEND_NUM_ARGS();
pils *imap_le_struct;
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
return;
}
@@ -1753,7 +1751,7 @@ PHP_FUNCTION(imap_mail_move)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &seq, &seq_len, &folder, &folder_len, &options) == FAILURE) {
return;
}
@@ -1776,7 +1774,7 @@ PHP_FUNCTION(imap_createmailbox)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -1799,7 +1797,7 @@ PHP_FUNCTION(imap_renamemailbox)
int old_mailbox_len, new_mailbox_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &old_mailbox, &old_mailbox_len, &new_mailbox, &new_mailbox_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &old_mailbox, &old_mailbox_len, &new_mailbox, &new_mailbox_len) == FAILURE) {
return;
}
@@ -1822,7 +1820,7 @@ PHP_FUNCTION(imap_deletemailbox)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -1846,7 +1844,7 @@ PHP_FUNCTION(imap_list)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -1885,7 +1883,7 @@ PHP_FUNCTION(imap_list_full)
FOBJECTLIST *cur=NIL;
char *delim=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -1914,7 +1912,7 @@ PHP_FUNCTION(imap_list_full)
#else
add_property_string(&mboxob, "delimiter", cur->delimiter);
#endif
- add_next_index_object(return_value, &mboxob TSRMLS_CC);
+ add_next_index_object(return_value, &mboxob);
cur=cur->next;
}
mail_free_foblist(&IMAPG(imap_folder_objects), &IMAPG(imap_folder_objects_tail));
@@ -1933,7 +1931,7 @@ PHP_FUNCTION(imap_listscan)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &streamind, &ref, &ref_len, &pat, &pat_len, &content, &content_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &streamind, &ref, &ref_len, &pat, &pat_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1965,7 +1963,7 @@ PHP_FUNCTION(imap_check)
pils *imap_le_struct;
char date[100];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -1998,7 +1996,7 @@ PHP_FUNCTION(imap_delete)
long flags = 0;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
@@ -2020,7 +2018,7 @@ PHP_FUNCTION(imap_undelete)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz|l", &streamind, &sequence, &flags) == FAILURE) {
return;
}
@@ -2046,7 +2044,7 @@ PHP_FUNCTION(imap_headerinfo)
ENVELOPE *en;
char dummy[2000], fulladdress[MAILTMPLEN + 1];
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|lls", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|lls", &streamind, &msgno, &fromlength, &subjectlength, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2054,7 +2052,7 @@ PHP_FUNCTION(imap_headerinfo)
if (argc >= 3) {
if (fromlength < 0 || fromlength > MAILTMPLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
+ php_error_docref(NULL, E_WARNING, "From length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2062,7 +2060,7 @@ PHP_FUNCTION(imap_headerinfo)
}
if (argc >= 4) {
if (subjectlength < 0 || subjectlength > MAILTMPLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
+ php_error_docref(NULL, E_WARNING, "Subject length has to be between 0 and %d", MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2081,7 +2079,7 @@ PHP_FUNCTION(imap_headerinfo)
/* call a function to parse all the text, so that we can use the
same function to parse text from other sources */
- _php_make_header_object(return_value, en TSRMLS_CC);
+ _php_make_header_object(return_value, en);
/* now run through properties that are only going to be returned
from a server, not text headers */
@@ -2124,7 +2122,7 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
ENVELOPE *en;
int headers_len, defaulthost_len = 0, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|s", &headers, &headers_len, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|s", &headers, &headers_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2136,7 +2134,7 @@ PHP_FUNCTION(imap_rfc822_parse_headers)
/* call a function to parse all the text, so that we can use the
same function no matter where the headers are from */
- _php_make_header_object(return_value, en TSRMLS_CC);
+ _php_make_header_object(return_value, en);
mail_free_envelope(&en);
}
/* }}} */
@@ -2152,7 +2150,7 @@ PHP_FUNCTION(imap_lsub)
pils *imap_le_struct;
STRINGLIST *cur=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -2190,7 +2188,7 @@ PHP_FUNCTION(imap_lsub_full)
FOBJECTLIST *cur=NIL;
char *delim=NIL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &streamind, &ref, &ref_len, &pat, &pat_len) == FAILURE) {
return;
}
@@ -2219,7 +2217,7 @@ PHP_FUNCTION(imap_lsub_full)
#else
add_property_string(&mboxob, "delimiter", cur->delimiter);
#endif
- add_next_index_object(return_value, &mboxob TSRMLS_CC);
+ add_next_index_object(return_value, &mboxob);
cur=cur->next;
}
mail_free_foblist (&IMAPG(imap_sfolder_objects), &IMAPG(imap_sfolder_objects_tail));
@@ -2237,7 +2235,7 @@ PHP_FUNCTION(imap_subscribe)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -2260,7 +2258,7 @@ PHP_FUNCTION(imap_unsubscribe)
int folder_len;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &streamind, &folder, &folder_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &streamind, &folder, &folder_len) == FAILURE) {
return;
}
@@ -2284,12 +2282,12 @@ PHP_FUNCTION(imap_fetchstructure)
BODY *body;
int msgindex, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~FT_UID) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2314,11 +2312,11 @@ PHP_FUNCTION(imap_fetchstructure)
mail_fetchstructure_full(imap_le_struct->imap_stream, msgno, &body , (argc == 3 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available");
+ php_error_docref(NULL, E_WARNING, "No body information available");
RETURN_FALSE;
}
- _php_imap_add_body(return_value, body TSRMLS_CC);
+ _php_imap_add_body(return_value, body);
}
/* }}} */
@@ -2334,12 +2332,12 @@ PHP_FUNCTION(imap_fetchbody)
unsigned long len;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2353,7 +2351,7 @@ PHP_FUNCTION(imap_fetchbody)
body = mail_fetchbody_full(imap_le_struct->imap_stream, msgno, sec, &len, (argc == 4 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body information available");
+ php_error_docref(NULL, E_WARNING, "No body information available");
RETURN_FALSE;
}
RETVAL_STRINGL(body, len);
@@ -2374,12 +2372,12 @@ PHP_FUNCTION(imap_fetchmime)
unsigned long len;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rls|l", &streamind, &msgno, &sec, &sec_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -2393,7 +2391,7 @@ PHP_FUNCTION(imap_fetchmime)
body = mail_fetch_mime(imap_le_struct->imap_stream, msgno, sec, &len, (argc == 4 ? flags : NIL));
if (!body) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No body MIME information available");
+ php_error_docref(NULL, E_WARNING, "No body MIME information available");
RETURN_FALSE;
}
RETVAL_STRINGL(body, len);
@@ -2412,7 +2410,7 @@ PHP_FUNCTION(imap_savebody)
int section_len = 0, close_stream = 1;
long msgno, flags = 0;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
RETURN_FALSE;
}
@@ -2462,7 +2460,7 @@ PHP_FUNCTION(imap_base64)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2485,7 +2483,7 @@ PHP_FUNCTION(imap_qprint)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2508,7 +2506,7 @@ PHP_FUNCTION(imap_8bit)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2531,7 +2529,7 @@ PHP_FUNCTION(imap_binary)
int text_len;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &text_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &text, &text_len) == FAILURE) {
return;
}
@@ -2555,7 +2553,7 @@ PHP_FUNCTION(imap_mailboxmsginfo)
char date[100];
unsigned int msgno, unreadmsg, deletedmsg, msize;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &streamind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &streamind) == FAILURE) {
return;
}
@@ -2602,7 +2600,7 @@ PHP_FUNCTION(imap_rfc822_write_address)
ADDRESS *addr;
zend_string *string;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &mailbox, &mailbox_len, &host, &host_len, &personal, &personal_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &mailbox, &mailbox_len, &host, &host_len, &personal, &personal_len) == FAILURE) {
return;
}
@@ -2624,7 +2622,7 @@ PHP_FUNCTION(imap_rfc822_write_address)
addr->error=NIL;
addr->adl=NIL;
- string = _php_rfc822_write_address(addr TSRMLS_CC);
+ string = _php_rfc822_write_address(addr);
if (string) {
RETVAL_STR(string);
} else {
@@ -2643,7 +2641,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
ADDRESS *addresstmp;
ENVELOPE *env;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &str, &str_len, &defaulthost, &defaulthost_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &str, &str_len, &defaulthost, &defaulthost_len) == FAILURE) {
return;
}
@@ -2672,7 +2670,7 @@ PHP_FUNCTION(imap_rfc822_parse_adrlist)
if (addresstmp->adl) {
add_property_string(&tovals, "adl", addresstmp->adl);
}
- add_next_index_object(return_value, &tovals TSRMLS_CC);
+ add_next_index_object(return_value, &tovals);
} while ((addresstmp = addresstmp->next));
mail_free_envelope(&env);
@@ -2687,7 +2685,7 @@ PHP_FUNCTION(imap_utf8)
int str_len;
SIZEDTEXT src, dest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -2751,7 +2749,7 @@ PHP_FUNCTION(imap_utf7_decode)
ST_DECODE3
} state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -2765,12 +2763,12 @@ PHP_FUNCTION(imap_utf7_decode)
if (state == ST_NORMAL) {
/* process printable character */
if (SPECIAL(*inp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified UTF-7 character: `%c'", *inp);
+ php_error_docref(NULL, E_WARNING, "Invalid modified UTF-7 character: `%c'", *inp);
RETURN_FALSE;
} else if (*inp != '&') {
outlen++;
} else if (inp + 1 == endp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string");
+ php_error_docref(NULL, E_WARNING, "Unexpected end of string");
RETURN_FALSE;
} else if (inp[1] != '-') {
state = ST_DECODE0;
@@ -2781,12 +2779,12 @@ PHP_FUNCTION(imap_utf7_decode)
} else if (*inp == '-') {
/* return to NORMAL mode */
if (state == ST_DECODE1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stray modified base64 character: `%c'", *--inp);
+ php_error_docref(NULL, E_WARNING, "Stray modified base64 character: `%c'", *--inp);
RETURN_FALSE;
}
state = ST_NORMAL;
} else if (!B64CHAR(*inp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid modified base64 character: `%c'", *inp);
+ php_error_docref(NULL, E_WARNING, "Invalid modified base64 character: `%c'", *inp);
RETURN_FALSE;
} else {
switch (state) {
@@ -2807,7 +2805,7 @@ PHP_FUNCTION(imap_utf7_decode)
/* enforce end state */
if (state != ST_NORMAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected end of string");
+ php_error_docref(NULL, E_WARNING, "Unexpected end of string");
RETURN_FALSE;
}
@@ -2864,7 +2862,7 @@ PHP_FUNCTION(imap_utf7_decode)
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
+ php_error_docref(NULL, E_WARNING, "outp - out [%ld] != outlen [%d]", outp - out, outlen);
}
#endif
@@ -2890,7 +2888,7 @@ PHP_FUNCTION(imap_utf7_encode)
ST_ENCODE2
} state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -2995,7 +2993,7 @@ static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int in_len;
unsigned char *out;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &in, &in_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &in, &in_len) == FAILURE) {
return;
}
@@ -3044,7 +3042,7 @@ PHP_FUNCTION(imap_setflag_full)
long flags = 0;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) == FAILURE) {
return;
}
@@ -3066,7 +3064,7 @@ PHP_FUNCTION(imap_clearflag_full)
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) ==FAILURE) {
+ if (zend_parse_parameters(argc, "rss|l", &streamind, &sequence, &sequence_len, &flag, &flag_len, &flags) ==FAILURE) {
return;
}
@@ -3092,19 +3090,19 @@ PHP_FUNCTION(imap_sort)
SEARCHPGM *spg=NIL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rll|lss", &streamind, &pgm, &rev, &flags, &criteria, &criteria_len, &charset, &charset_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rll|lss", &streamind, &pgm, &rev, &flags, &criteria, &criteria_len, &charset, &charset_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
if (pgm > SORTSIZE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized sort criteria");
+ php_error_docref(NULL, E_WARNING, "Unrecognized sort criteria");
RETURN_FALSE;
}
if (argc >= 4) {
if (flags < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search options parameter has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Search options parameter has to be greater than or equal to 0");
RETURN_FALSE;
}
}
@@ -3146,12 +3144,12 @@ PHP_FUNCTION(imap_fetchheader)
pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &streamind, &msgno, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -3181,7 +3179,7 @@ PHP_FUNCTION(imap_uid)
pils *imap_le_struct;
int msgindex;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &msgno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) {
return;
}
@@ -3189,7 +3187,7 @@ PHP_FUNCTION(imap_uid)
msgindex = msgno;
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -3205,7 +3203,7 @@ PHP_FUNCTION(imap_msgno)
long msgno;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &streamind, &msgno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &streamind, &msgno) == FAILURE) {
return;
}
@@ -3225,7 +3223,7 @@ PHP_FUNCTION(imap_status)
long flags;
pils *imap_le_struct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &streamind, &mbx, &mbx_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &streamind, &mbx, &mbx_len, &flags) == FAILURE) {
return;
}
@@ -3269,14 +3267,14 @@ PHP_FUNCTION(imap_bodystruct)
PARAMETER *par, *dpar;
BODY *body;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls", &streamind, &msg, &section, &section_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls", &streamind, &msg, &section, &section_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
if (!msg || msg < 1 || (unsigned) msg > imap_le_struct->imap_stream->nmsgs) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
+ php_error_docref(NULL, E_WARNING, "Bad message number");
RETURN_FALSE;
}
@@ -3336,9 +3334,9 @@ PHP_FUNCTION(imap_bodystruct)
object_init(&dparam);
add_property_string(&dparam, "attribute", dpar->attribute);
add_property_string(&dparam, "value", dpar->value);
- add_next_index_object(&dparametres, &dparam TSRMLS_CC);
+ add_next_index_object(&dparametres, &dparam);
} while ((dpar = dpar->next));
- add_assoc_object(return_value, "dparameters", &dparametres TSRMLS_CC);
+ add_assoc_object(return_value, "dparameters", &dparametres);
} else {
add_property_long(return_value, "ifdparameters", 0);
}
@@ -3357,13 +3355,13 @@ PHP_FUNCTION(imap_bodystruct)
add_property_string(&param, "value", par->value);
}
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ add_next_index_object(&parametres, &param);
} while ((par = par->next));
} else {
object_init(&parametres);
add_property_long(return_value, "ifparameters", 0);
}
- add_assoc_object(return_value, "parameters", &parametres TSRMLS_CC);
+ add_assoc_object(return_value, "parameters", &parametres);
}
/* }}} */
@@ -3381,12 +3379,12 @@ PHP_FUNCTION(imap_fetch_overview)
long status, flags = 0L;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &streamind, &sequence, &sequence_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &streamind, &sequence, &sequence_len, &flags) == FAILURE) {
return;
}
if (flags && ((flags & ~FT_UID) != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the options parameter");
+ php_error_docref(NULL, E_WARNING, "invalid value for the options parameter");
RETURN_FALSE;
}
@@ -3412,14 +3410,14 @@ PHP_FUNCTION(imap_fetch_overview)
}
if (env->from) {
env->from->next=NULL;
- address =_php_rfc822_write_address(env->from TSRMLS_CC);
+ address =_php_rfc822_write_address(env->from);
if (address) {
add_property_str(&myoverview, "from", address);
}
}
if (env->to) {
env->to->next = NULL;
- address = _php_rfc822_write_address(env->to TSRMLS_CC);
+ address = _php_rfc822_write_address(env->to);
if (address) {
add_property_str(&myoverview, "to", address);
}
@@ -3446,7 +3444,7 @@ PHP_FUNCTION(imap_fetch_overview)
add_property_long(&myoverview, "seen", elt->seen);
add_property_long(&myoverview, "draft", elt->draft);
add_property_long(&myoverview, "udate", mail_longdate(elt));
- add_next_index_object(return_value, &myoverview TSRMLS_CC);
+ add_next_index_object(return_value, &myoverview);
}
}
}
@@ -3469,7 +3467,7 @@ PHP_FUNCTION(imap_mail_compose)
int toppart = 0;
int first;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &envelope, &body) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &envelope, &body) == FAILURE) {
return;
}
@@ -3545,7 +3543,7 @@ PHP_FUNCTION(imap_mail_compose)
first = 0;
if (Z_TYPE_P(data) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
RETURN_FALSE;
}
@@ -3745,12 +3743,12 @@ PHP_FUNCTION(imap_mail_compose)
} ZEND_HASH_FOREACH_END();
if (first) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "body parameter must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "body parameter must be a non-empty array");
RETURN_FALSE;
}
if (bod && bod->type == TYPEMULTIPART && (!bod->nested.part || !bod->nested.part->next)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot generate multipart e-mail without components.");
+ php_error_docref(NULL, E_WARNING, "cannot generate multipart e-mail without components.");
RETVAL_FALSE;
goto done;
}
@@ -3809,7 +3807,7 @@ PHP_FUNCTION(imap_mail_compose)
if (!cookie) {
cookie = "-";
} else if (strlen(cookie) > (SENDBUFLEN - 2 - 2 - 2)) { /* validate cookie length -- + CRLF * 2 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The boundary should be no longer than 4kb");
+ php_error_docref(NULL, E_WARNING, "The boundary should be no longer than 4kb");
RETVAL_FALSE;
goto done;
}
@@ -3861,7 +3859,7 @@ done:
/* {{{ _php_imap_mail
*/
-int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath TSRMLS_DC)
+int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *cc, char *bcc, char* rpath)
{
#ifdef PHP_WIN32
int tsm_err;
@@ -3981,12 +3979,12 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
strlcat(bufferHeader, headers, bufferLen + 1);
}
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
if (tsm_errmsg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
+ php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err));
+ php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err));
}
PHP_IMAP_CLEAN;
return 0;
@@ -4014,7 +4012,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
return 1;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program");
+ php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program");
return 0;
}
#endif
@@ -4029,31 +4027,31 @@ PHP_FUNCTION(imap_mail)
char *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *cc=NULL, *bcc=NULL, *rpath=NULL;
int to_len, message_len, headers_len, subject_len, cc_len, bcc_len, rpath_len, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "sss|ssss", &to, &to_len, &subject, &subject_len, &message, &message_len,
+ if (zend_parse_parameters(argc, "sss|ssss", &to, &to_len, &subject, &subject_len, &message, &message_len,
&headers, &headers_len, &cc, &cc_len, &bcc, &bcc_len, &rpath, &rpath_len) == FAILURE) {
return;
}
/* To: */
if (!to_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No to field in mail command");
+ php_error_docref(NULL, E_WARNING, "No to field in mail command");
RETURN_FALSE;
}
/* Subject: */
if (!subject_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No subject field in mail command");
+ php_error_docref(NULL, E_WARNING, "No subject field in mail command");
RETURN_FALSE;
}
/* message body */
if (!message_len) {
/* this is not really an error, so it is allowed. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message string in mail command");
+ php_error_docref(NULL, E_WARNING, "No message string in mail command");
message = NULL;
}
- if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath TSRMLS_CC)) {
+ if (_php_imap_mail(to, subject, message, headers, cc, bcc, rpath)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -4075,7 +4073,7 @@ PHP_FUNCTION(imap_search)
int argc = ZEND_NUM_ARGS();
SEARCHPGM *pgm = NIL;
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|ls", &streamind, &criteria, &criteria_len, &flags, &charset, &charset_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|ls", &streamind, &criteria, &criteria_len, &flags, &charset, &charset_len) == FAILURE) {
return;
}
@@ -4199,7 +4197,7 @@ PHP_FUNCTION(imap_mime_header_decode)
long charset_token, encoding_token, end_token, end, offset=0, i;
unsigned long newlength;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -4300,7 +4298,7 @@ static long _php_rfc822_soutr (void *stream, char *string)
/* {{{ _php_rfc822_write_address
*/
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist)
{
char address[MAILTMPLEN];
smart_str ret = {0};
@@ -4380,12 +4378,12 @@ static int _php_imap_address_size (ADDRESS *addresslist)
/* {{{ _php_rfc822_write_address
*/
-static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
+static zend_string* _php_rfc822_write_address(ADDRESS *addresslist)
{
char address[SENDBUFLEN];
if (_php_imap_address_size(addresslist) >= SENDBUFLEN) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Address buffer overflow");
+ php_error_docref(NULL, E_ERROR, "Address buffer overflow");
return NULL;
}
address[0] = 0;
@@ -4396,7 +4394,7 @@ static zend_string* _php_rfc822_write_address(ADDRESS *addresslist TSRMLS_DC)
#endif
/* {{{ _php_imap_parse_address
*/
-static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddress TSRMLS_DC)
+static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddress)
{
zend_string *fulladdress;
ADDRESS *addresstmp;
@@ -4404,7 +4402,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
addresstmp = addresslist;
- fulladdress = _php_rfc822_write_address(addresstmp TSRMLS_CC);
+ fulladdress = _php_rfc822_write_address(addresstmp);
addresstmp = addresslist;
do {
@@ -4413,7 +4411,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
if (addresstmp->adl) add_property_string(&tmpvals, "adl", addresstmp->adl);
if (addresstmp->mailbox) add_property_string(&tmpvals, "mailbox", addresstmp->mailbox);
if (addresstmp->host) add_property_string(&tmpvals, "host", addresstmp->host);
- add_next_index_object(paddress, &tmpvals TSRMLS_CC);
+ add_next_index_object(paddress, &tmpvals);
} while ((addresstmp = addresstmp->next));
return fulladdress;
}
@@ -4421,7 +4419,7 @@ static zend_string* _php_imap_parse_address (ADDRESS *addresslist, zval *paddres
/* {{{ _php_make_header_object
*/
-static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
+static void _php_make_header_object(zval *myzvalue, ENVELOPE *en)
{
zval paddress;
zend_string *fulladdress=NULL;
@@ -4441,72 +4439,72 @@ static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC)
if (en->to) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->to, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->to, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "toaddress", fulladdress);
}
- add_assoc_object(myzvalue, "to", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "to", &paddress);
}
if (en->from) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->from, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->from, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "fromaddress", fulladdress);
}
- add_assoc_object(myzvalue, "from", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "from", &paddress);
}
if (en->cc) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->cc, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->cc, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "ccaddress", fulladdress);
}
- add_assoc_object(myzvalue, "cc", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "cc", &paddress);
}
if (en->bcc) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->bcc, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->bcc, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "bccaddress", fulladdress);
}
- add_assoc_object(myzvalue, "bcc", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "bcc", &paddress);
}
if (en->reply_to) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->reply_to, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->reply_to, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "reply_toaddress", fulladdress);
}
- add_assoc_object(myzvalue, "reply_to", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "reply_to", &paddress);
}
if (en->sender) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->sender, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->sender, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "senderaddress", fulladdress);
}
- add_assoc_object(myzvalue, "sender", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "sender", &paddress);
}
if (en->return_path) {
array_init(&paddress);
- fulladdress = _php_imap_parse_address(en->return_path, &paddress TSRMLS_CC);
+ fulladdress = _php_imap_parse_address(en->return_path, &paddress);
if (fulladdress) {
add_property_str(myzvalue, "return_pathaddress", fulladdress);
}
- add_assoc_object(myzvalue, "return_path", &paddress TSRMLS_CC);
+ add_assoc_object(myzvalue, "return_path", &paddress);
}
}
/* }}} */
/* {{{ _php_imap_add_body
*/
-void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
+void _php_imap_add_body(zval *arg, BODY *body)
{
zval parametres, param, dparametres, dparam;
PARAMETER *par, *dpar;
@@ -4565,9 +4563,9 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
object_init(&dparam);
add_property_string(&dparam, "attribute", dpar->attribute);
add_property_string(&dparam, "value", dpar->value);
- add_next_index_object(&dparametres, &dparam TSRMLS_CC);
+ add_next_index_object(&dparametres, &dparam);
} while ((dpar = dpar->next));
- add_assoc_object(arg, "dparameters", &dparametres TSRMLS_CC);
+ add_assoc_object(arg, "dparameters", &dparametres);
} else {
add_property_long(arg, "ifdparameters", 0);
}
@@ -4586,23 +4584,23 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
add_property_string(&param, "value", par->value);
}
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ add_next_index_object(&parametres, &param);
} while ((par = par->next));
} else {
object_init(&parametres);
add_property_long(arg, "ifparameters", 0);
}
- add_assoc_object(arg, "parameters", &parametres TSRMLS_CC);
+ add_assoc_object(arg, "parameters", &parametres);
/* multipart message ? */
if (body->type == TYPEMULTIPART) {
array_init(&parametres);
for (part = body->CONTENT_PART; part; part = part->next) {
object_init(&param);
- _php_imap_add_body(&param, &part->body TSRMLS_CC);
- add_next_index_object(&parametres, &param TSRMLS_CC);
+ _php_imap_add_body(&param, &part->body);
+ add_next_index_object(&parametres, &param);
}
- add_assoc_object(arg, "parts", &parametres TSRMLS_CC);
+ add_assoc_object(arg, "parts", &parametres);
}
/* encapsulated message ? */
@@ -4610,9 +4608,9 @@ void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC)
body = body->CONTENT_MSG_BODY;
array_init(&parametres);
object_init(&param);
- _php_imap_add_body(&param, body TSRMLS_CC);
- add_next_index_object(&parametres, &param TSRMLS_CC);
- add_assoc_object(arg, "parts", &parametres TSRMLS_CC);
+ _php_imap_add_body(&param, body);
+ add_next_index_object(&parametres, &param);
+ add_assoc_object(arg, "parts", &parametres);
}
}
/* }}} */
@@ -4676,7 +4674,7 @@ PHP_FUNCTION(imap_thread)
int argc = ZEND_NUM_ARGS();
SEARCHPGM *pgm = NIL;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &streamind, &flags) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &streamind, &flags) == FAILURE) {
return;
}
@@ -4689,7 +4687,7 @@ PHP_FUNCTION(imap_thread)
}
if(top == NIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function returned an empty tree");
+ php_error_docref(NULL, E_WARNING, "Function returned an empty tree");
RETURN_FALSE;
}
@@ -4709,7 +4707,7 @@ PHP_FUNCTION(imap_timeout)
long ttype, timeout=-1;
int timeout_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &ttype, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &ttype, &timeout) == FAILURE) {
RETURN_FALSE;
}
@@ -4764,7 +4762,6 @@ PHP_FUNCTION(imap_timeout)
#define GETS_FETCH_SIZE 8196LU
static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DATA *md) /* {{{ */
{
- TSRMLS_FETCH();
/* write to the gets stream if it is set,
otherwise forward to c-clients gets */
@@ -4783,10 +4780,10 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
}
if (!f(stream, read, buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
+ php_error_docref(NULL, E_WARNING, "Failed to read from socket");
break;
} else if (read != php_stream_write(IMAPG(gets_stream), buf, read)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write to stream");
+ php_error_docref(NULL, E_WARNING, "Failed to write to stream");
break;
}
}
@@ -4797,7 +4794,7 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
if (f(stream, size, buf)) {
buf[size] = '\0';
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to read from socket");
+ php_error_docref(NULL, E_WARNING, "Failed to read from socket");
free(buf);
buf = NULL;
}
@@ -4811,7 +4808,6 @@ static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, GETS_DA
PHP_IMAP_EXPORT void mm_searched(MAILSTREAM *stream, unsigned long number)
{
MESSAGELIST *cur = NIL;
- TSRMLS_FETCH();
if (IMAPG(imap_messages) == NIL) {
IMAPG(imap_messages) = mail_newmessagelist();
@@ -4844,7 +4840,6 @@ PHP_IMAP_EXPORT void mm_flags(MAILSTREAM *stream, unsigned long number)
PHP_IMAP_EXPORT void mm_notify(MAILSTREAM *stream, char *str, long errflg)
{
STRINGLIST *cur = NIL;
- TSRMLS_FETCH();
if (strncmp(str, "[ALERT] ", 8) == 0) {
if (IMAPG(imap_alertstack) == NIL) {
@@ -4868,7 +4863,6 @@ PHP_IMAP_EXPORT void mm_list(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
{
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
- TSRMLS_FETCH();
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build up a the new array of objects */
@@ -4915,7 +4909,6 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
{
STRINGLIST *cur=NIL;
FOBJECTLIST *ocur=NIL;
- TSRMLS_FETCH();
if (IMAPG(folderlist_style) == FLIST_OBJECT) {
/* build the array of objects */
@@ -4957,7 +4950,6 @@ PHP_IMAP_EXPORT void mm_lsub(MAILSTREAM *stream, DTYPE delimiter, char *mailbox,
PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *status)
{
- TSRMLS_FETCH();
IMAPG(status_flags)=status->flags;
if (IMAPG(status_flags) & SA_MESSAGES) {
@@ -4980,7 +4972,6 @@ PHP_IMAP_EXPORT void mm_status(MAILSTREAM *stream, char *mailbox, MAILSTATUS *st
PHP_IMAP_EXPORT void mm_log(char *str, long errflg)
{
ERRORLIST *cur = NIL;
- TSRMLS_FETCH();
/* Author: CJH */
if (errflg != NIL) { /* CJH: maybe put these into a more comprehensive log for debugging purposes? */
@@ -5012,7 +5003,6 @@ PHP_IMAP_EXPORT void mm_dlog(char *str)
PHP_IMAP_EXPORT void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
{
- TSRMLS_FETCH();
if (*mb->user) {
strlcpy (user, mb->user, MAILTMPLEN);
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c
index 6ac44ffeb0..a0600d15aa 100644
--- a/ext/interbase/ibase_blobs.c
+++ b/ext/interbase/ibase_blobs.c
@@ -32,14 +32,14 @@
static int le_blob;
-static void _php_ibase_free_blob(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_blob(zend_resource *rsrc) /* {{{ */
{
ibase_blob *ib_blob = (ibase_blob *)rsrc->ptr;
if (ib_blob->bl_handle != NULL) { /* blob open*/
if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
_php_ibase_module_error("You can lose data. Close any blob after reading from or "
- "writing to it. Use ibase_blob_close() before calling ibase_close()" TSRMLS_CC);
+ "writing to it. Use ibase_blob_close() before calling ibase_close()");
}
}
efree(ib_blob);
@@ -93,7 +93,7 @@ typedef struct { /* {{{ */
/* }}} */
} IBASE_BLOBINFO;
-int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC) /* {{{ */
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len) /* {{{ */
{
if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/
@@ -115,7 +115,7 @@ int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long m
bl_data[cur_len] = '\0';
if (IB_STATUS[0] == 1 && (stat != 0 && stat != isc_segstr_eof && stat != isc_segment)) {
efree(bl_data);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
// TODO: avoid double reallocation???
@@ -128,7 +128,7 @@ int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long m
}
/* }}} */
-int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{ */
+int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob) /* {{{ */
{
unsigned long put_cnt = 0, rem_cnt;
unsigned short chunk_size;
@@ -140,7 +140,7 @@ int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{
chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : (unsigned short)rem_cnt;
if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size, &Z_STRVAL_P(string_arg)[put_cnt] )) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
put_cnt += chunk_size;
@@ -149,7 +149,7 @@ int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC) /* {{{
}
/* }}} */
-static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info TSRMLS_DC) /* {{{ */
+static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_info) /* {{{ */
{
static char bl_items[] = {
isc_info_blob_num_segments,
@@ -166,7 +166,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
bl_info->bl_stream = 0;
if (isc_blob_info(IB_STATUS, &bl_handle, sizeof(bl_items), bl_items, sizeof(bl_inf), bl_inf)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
@@ -193,7 +193,7 @@ static int _php_ibase_blob_info(isc_blob_handle bl_handle, IBASE_BLOBINFO *bl_in
break;
case isc_info_truncated:
case isc_info_error: /* hmm. don't think so...*/
- _php_ibase_module_error("PHP module internal error" TSRMLS_CC);
+ _php_ibase_module_error("PHP module internal error");
return FAILURE;
} /* switch */
p += item_len;
@@ -213,7 +213,7 @@ PHP_FUNCTION(ibase_blob_create)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link)) {
RETURN_FALSE;
}
@@ -224,7 +224,7 @@ PHP_FUNCTION(ibase_blob_create)
ib_blob->type = BLOB_INPUT;
if (isc_create_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ib_blob);
RETURN_FALSE;
}
@@ -251,12 +251,12 @@ PHP_FUNCTION(ibase_blob_open)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -270,13 +270,13 @@ PHP_FUNCTION(ibase_blob_open)
do {
if (! _php_ibase_string_to_quad(blob_id, &ib_blob->bl_qd)) {
- _php_ibase_module_error("String is not a BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("String is not a BLOB ID");
break;
}
if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob->bl_handle,
&ib_blob->bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
break;
}
@@ -307,11 +307,11 @@ PHP_FUNCTION(ibase_blob_add)
ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob);
if (ib_blob->type != BLOB_INPUT) {
- _php_ibase_module_error("BLOB is not open for input" TSRMLS_CC);
+ _php_ibase_module_error("BLOB is not open for input");
RETURN_FALSE;
}
- if (_php_ibase_blob_add(string_arg, ib_blob TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_add(string_arg, ib_blob) != SUCCESS) {
RETURN_FALSE;
}
}
@@ -333,13 +333,13 @@ PHP_FUNCTION(ibase_blob_get)
ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, "Interbase blob", le_blob);
if (ib_blob->type != BLOB_OUTPUT) {
- _php_ibase_module_error("BLOB is not open for output" TSRMLS_CC);
+ _php_ibase_module_error("BLOB is not open for output");
RETURN_FALSE;
}
convert_to_long_ex(len_arg);
- if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_P(len_arg) TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_P(len_arg)) != SUCCESS) {
RETURN_FALSE;
}
}
@@ -363,7 +363,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) /* {{{
if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/
if (isc_close_blob(IB_STATUS, &ib_blob->bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
}
@@ -375,7 +375,7 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) /* {{{
efree(s);
} else { /* discard created blob */
if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
ib_blob->bl_handle = NULL;
@@ -419,12 +419,12 @@ PHP_FUNCTION(ibase_blob_info)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -433,22 +433,22 @@ PHP_FUNCTION(ibase_blob_info)
PHP_IBASE_LINK_TRANS(link, ib_link, trans);
if (! _php_ibase_string_to_quad(blob_id, &ib_blob.bl_qd)) {
- _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("Unrecognized BLOB ID");
RETURN_FALSE;
}
if (ib_blob.bl_qd.gds_quad_high || ib_blob.bl_qd.gds_quad_low) { /* not null ? */
if (isc_open_blob(IB_STATUS, &ib_link->handle, &trans->handle, &ib_blob.bl_handle,
&ib_blob.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
- if (_php_ibase_blob_info(ib_blob.bl_handle, &bl_info TSRMLS_CC)) {
+ if (_php_ibase_blob_info(ib_blob.bl_handle, &bl_info)) {
RETURN_FALSE;
}
if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
} else { /* null blob, all values to zero */
@@ -496,12 +496,12 @@ PHP_FUNCTION(ibase_blob_echo)
default:
WRONG_PARAM_COUNT;
case 1:
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(1, "s", &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
case 2:
- if (FAILURE == zend_parse_parameters(2 TSRMLS_CC, "rs", &link, &blob_id, &blob_id_len)) {
+ if (FAILURE == zend_parse_parameters(2, "rs", &link, &blob_id, &blob_id_len)) {
RETURN_FALSE;
}
break;
@@ -510,7 +510,7 @@ PHP_FUNCTION(ibase_blob_echo)
PHP_IBASE_LINK_TRANS(link, ib_link, trans);
if (! _php_ibase_string_to_quad(blob_id, &ib_blob_id.bl_qd)) {
- _php_ibase_module_error("Unrecognized BLOB ID" TSRMLS_CC);
+ _php_ibase_module_error("Unrecognized BLOB ID");
RETURN_FALSE;
}
@@ -535,7 +535,7 @@ PHP_FUNCTION(ibase_blob_echo)
RETURN_TRUE;
} while (0);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
/* }}} */
@@ -556,7 +556,7 @@ PHP_FUNCTION(ibase_blob_import)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|r",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "r|r",
(ZEND_NUM_ARGS()-1) ? &link : &file, &file)) {
RETURN_FALSE;
}
@@ -587,7 +587,7 @@ PHP_FUNCTION(ibase_blob_import)
return;
} while (0);
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
/* }}} */
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c
index 5a64b31c75..72fc18d00f 100644
--- a/ext/interbase/ibase_events.c
+++ b/ext/interbase/ibase_events.c
@@ -36,7 +36,7 @@ static void _php_ibase_event_free(char *event_buf, char *result_buf) /* {{{ */
}
/* }}} */
-void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
+void _php_ibase_free_event(ibase_event *event) /* {{{ */
{
unsigned short i;
@@ -47,7 +47,7 @@ void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
if (event->link->handle != NULL &&
isc_cancel_events(IB_STATUS, &event->link->handle, &event->event_id)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
/* delete this event from the link struct */
@@ -69,11 +69,11 @@ void _php_ibase_free_event(ibase_event *event TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_event_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_event_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_event *e = (ibase_event *) rsrc->ptr;
- _php_ibase_free_event(e TSRMLS_CC);
+ _php_ibase_free_event(e);
efree(e);
}
@@ -137,7 +137,7 @@ PHP_FUNCTION(ibase_wait_event)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -168,7 +168,7 @@ PHP_FUNCTION(ibase_wait_event)
/* now block until an event occurs */
if (isc_wait_for_event(IB_STATUS, &ib_link->handle, buffer_size, event_buffer, result_buffer)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
_php_ibase_event_free(event_buffer,result_buffer);
efree(args);
RETURN_FALSE;
@@ -232,8 +232,8 @@ static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */
/* call the callback provided by the user */
if (SUCCESS != call_user_function(EG(function_table), NULL,
- &event->callback, &return_value, 2, args TSRMLS_CC)) {
- _php_ibase_module_error("Error calling callback %s" TSRMLS_CC, Z_STRVAL(event->callback));
+ &event->callback, &return_value, 2, args)) {
+ _php_ibase_module_error("Error calling callback %s", Z_STRVAL(event->callback));
break;
}
@@ -246,7 +246,7 @@ static isc_callback _php_ibase_callback(ibase_event *event, /* {{{ */
if (isc_que_events(IB_STATUS, &event->link->handle, &event->event_id, buffer_size,
event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
event->state = ACTIVE;
}
@@ -277,7 +277,7 @@ PHP_FUNCTION(ibase_set_event_handler)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -317,8 +317,8 @@ PHP_FUNCTION(ibase_set_event_handler)
}
/* get the callback */
- if (!zend_is_callable(cb_arg, 0, &cb_name TSRMLS_CC)) {
- _php_ibase_module_error("Callback argument %s is not a callable function" TSRMLS_CC, cb_name->val);
+ if (!zend_is_callable(cb_arg, 0, &cb_name)) {
+ _php_ibase_module_error("Callback argument %s is not a callable function", cb_name->val);
zend_string_release(cb_name);
RETURN_FALSE;
}
@@ -348,7 +348,7 @@ PHP_FUNCTION(ibase_set_event_handler)
if (isc_que_events(IB_STATUS, &ib_link->handle, &event->event_id, buffer_size,
event->event_buffer,(isc_callback)_php_ibase_callback, (void *)event)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(event);
RETURN_FALSE;
}
@@ -369,7 +369,7 @@ PHP_FUNCTION(ibase_free_event_handler)
RESET_ERRMSG;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &event_arg)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "r", &event_arg)) {
ibase_event *event;
ZEND_FETCH_RESOURCE(event, ibase_event *, event_arg, -1, "Interbase event", le_event);
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 2cd2ada65f..e7b6a834b2 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -116,7 +116,7 @@ static void _php_ibase_free_xsqlda(XSQLDA *sqlda) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt) /* {{{ */
{
static char info[] = { isc_info_base_level, isc_info_end };
@@ -127,14 +127,14 @@ static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stm
if (SUCCESS == isc_database_info(IB_STATUS, &link->handle,
sizeof(info), info, sizeof(res_buf), res_buf)) {
if (isc_dsql_free_statement(IB_STATUS, &stmt, DSQL_drop)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
}
}
/* }}} */
-static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */
{
ibase_result *ib_result = (ibase_result *) rsrc->ptr;
@@ -145,14 +145,14 @@ static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
IBDEBUG("query still valid; don't drop statement handle");
ib_result->query->result = NULL; /* Indicate to query, that result is released */
} else {
- _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt TSRMLS_CC);
+ _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt);
}
efree(ib_result);
}
}
/* }}} */
-static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
{
IBDEBUG("Freeing query...");
@@ -166,7 +166,7 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
IBDEBUG("result still valid; don't drop statement handle");
ib_query->result->query = NULL; /* Indicate to result, that query is released */
} else {
- _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt TSRMLS_CC);
+ _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt);
}
if (ib_query->in_array) {
efree(ib_query->in_array);
@@ -180,13 +180,13 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_ibase_free_query_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_ibase_free_query_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_query *ib_query = (ibase_query *)rsrc->ptr;
if (ib_query != NULL) {
IBDEBUG("Preparing to free query by dtor...");
- _php_ibase_free_query(ib_query TSRMLS_CC);
+ _php_ibase_free_query(ib_query);
efree(ib_query);
}
}
@@ -202,7 +202,7 @@ void php_ibase_query_minit(INIT_FUNC_ARGS) /* {{{ */
/* }}} */
static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ */
- isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt TSRMLS_DC)
+ isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt)
{
unsigned short i, n;
ibase_array *ar;
@@ -228,7 +228,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{
if (isc_array_lookup_bounds(IB_STATUS, &link, &trans, var->relname,
var->sqlname, ar_desc)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ar);
return FAILURE;
}
@@ -313,14 +313,14 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{
/* allocate and prepare query */
static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* {{{ */
- ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id TSRMLS_DC)
+ ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id)
{
static char info_type[] = {isc_info_sql_stmt_type};
char result[8];
/* Return FAILURE, if querystring is empty */
if (*query == '\0') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Querystring empty.");
+ php_error_docref(NULL, E_WARNING, "Querystring empty.");
return FAILURE;
}
@@ -338,7 +338,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->in_sqlda = NULL;
if (isc_dsql_allocate_statement(IB_STATUS, &link->handle, &ib_query->stmt)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
@@ -348,14 +348,14 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
if (isc_dsql_prepare(IB_STATUS, &ib_query->trans->handle, &ib_query->stmt,
0, query, dialect, ib_query->out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
/* find out what kind of statement was prepared */
if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type),
info_type, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
ib_query->statement_type = result[3];
@@ -366,7 +366,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->out_sqlda->sqln = ib_query->out_sqlda->sqld;
ib_query->out_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
}
@@ -376,7 +376,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
ib_query->in_sqlda->sqln = 1;
ib_query->in_sqlda->version = SQLDA_CURRENT_VERSION;
if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
@@ -388,7 +388,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt,
SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_alloc_query_error;
}
}
@@ -398,7 +398,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
efree(ib_query->in_sqlda);
ib_query->in_sqlda = NULL;
} else if (FAILURE == _php_ibase_alloc_array(&ib_query->in_array, ib_query->in_sqlda,
- link->handle, trans->handle, &ib_query->in_array_cnt TSRMLS_CC)) {
+ link->handle, trans->handle, &ib_query->in_array_cnt)) {
goto _php_ibase_alloc_query_error;
}
@@ -406,7 +406,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
efree(ib_query->out_sqlda);
ib_query->out_sqlda = NULL;
} else if (FAILURE == _php_ibase_alloc_array(&ib_query->out_array, ib_query->out_sqlda,
- link->handle, trans->handle, &ib_query->out_array_cnt TSRMLS_CC)) {
+ link->handle, trans->handle, &ib_query->out_array_cnt)) {
goto _php_ibase_alloc_query_error;
}
@@ -431,7 +431,7 @@ _php_ibase_alloc_query_error:
/* }}} */
static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /* {{{ */
- ibase_array *array, int dim TSRMLS_DC)
+ ibase_array *array, int dim)
{
zval null_val, *pnull_val = &null_val;
int u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper,
@@ -457,7 +457,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
subval = pnull_val;
}
- if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1 TSRMLS_CC) == FAILURE)
+ if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1) == FAILURE)
{
return FAILURE;
}
@@ -492,14 +492,14 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
switch (array->el_type) {
case SQL_SHORT:
if (l > SHRT_MAX || l < SHRT_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(short*) buf = (short) l;
break;
case SQL_LONG:
if (l > ISC_LONG_MAX || l < ISC_LONG_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(ISC_LONG*) buf = (ISC_LONG) l;
@@ -536,7 +536,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
case SQL_SHORT:
convert_to_long(val);
if (Z_LVAL_P(val) > SHRT_MAX || Z_LVAL_P(val) < SHRT_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
*(short *) buf = (short) Z_LVAL_P(val);
@@ -545,7 +545,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
convert_to_long(val);
#if (SIZEOF_LONG > 4)
if (Z_LVAL_P(val) > ISC_LONG_MAX || Z_LVAL_P(val) < ISC_LONG_MIN) {
- _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
+ _php_ibase_module_error("Array parameter exceeds field width");
return FAILURE;
}
#endif
@@ -584,7 +584,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3 && n != 6) {
_php_ibase_module_error("Invalid date/time format (expected 3 or 6 fields, got %d."
- " Use format 'm/d/Y H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ " Use format 'm/d/Y H:i:s'. You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
t.tm_year -= 1900;
@@ -601,7 +601,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3) {
_php_ibase_module_error("Invalid date format (expected 3 fields, got %d. "
- "Use format 'm/d/Y' You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ "Use format 'm/d/Y' You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
t.tm_year -= 1900;
@@ -618,7 +618,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
if (n != 3) {
_php_ibase_module_error("Invalid time format (expected 3 fields, got %d. "
- "Use format 'H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val));
+ "Use format 'H:i:s'. You gave '%s')", n, Z_STRVAL_P(val));
return FAILURE;
}
#endif
@@ -635,7 +635,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
/* }}} */
static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
- ibase_query *ib_query TSRMLS_DC)
+ ibase_query *ib_query)
{
int i, array_cnt = 0, rv = SUCCESS;
@@ -741,16 +741,16 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (isc_create_blob(IB_STATUS, &ib_query->link->handle,
&ib_query->trans->handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
- if (_php_ibase_blob_add(b_var, &ib_blob TSRMLS_CC) != SUCCESS) {
+ if (_php_ibase_blob_add(b_var, &ib_blob) != SUCCESS) {
return FAILURE;
}
if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
buf[i].val.qval = ib_blob.bl_qd;
@@ -765,7 +765,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (Z_STRLEN_P(b_var) != BLOB_ID_LEN ||
!_php_ibase_string_to_quad(Z_STRVAL_P(b_var), &buf[i].val.qval)) {
- _php_ibase_module_error("Parameter %d: invalid array ID" TSRMLS_CC,i+1);
+ _php_ibase_module_error("Parameter %d: invalid array ID",i+1);
rv = FAILURE;
}
} else {
@@ -775,7 +775,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
ISC_QUAD array_id = { 0, 0 };
if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size,
- ar, 0 TSRMLS_CC)) {
+ ar, 0)) {
_php_ibase_module_error("Parameter %d: failed to bind array argument"
TSRMLS_CC,i+1);
efree(array_data);
@@ -785,7 +785,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */
if (isc_array_put_slice(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle,
&array_id, &ar->ar_desc, array_data, &ar->ar_size)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(array_data);
return FAILURE;
}
@@ -888,7 +888,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0,
ib_query->query, ib_query->dialect, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -920,7 +920,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle,
&ib_query->trans->handle, 0, ib_query->query, ib_query->dialect, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -969,7 +969,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
in_sqlda = emalloc(XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
memcpy(in_sqlda, ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld));
bind_buf = safe_emalloc(sizeof(BIND_BUF), ib_query->in_sqlda->sqld, 0);
- if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query TSRMLS_CC) == FAILURE) {
+ if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query) == FAILURE) {
IBDEBUG("Could not bind input XSQLDA");
goto _php_ibase_exec_error;
}
@@ -984,7 +984,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
}
if (isc_result) {
IBDEBUG("Could not execute query");
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
ib_query->trans->affected_rows = 0;
@@ -1000,7 +1000,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_count),
info_count, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_exec_error;
}
@@ -1077,7 +1077,7 @@ PHP_FUNCTION(ibase_query)
long l;
default:
- if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3 TSRMLS_CC, "rrs",
+ if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3, "rrs",
&zlink, &ztrans, &query, &query_len)) {
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, zlink, -1, LE_LINK, le_link, le_plink);
@@ -1088,7 +1088,7 @@ PHP_FUNCTION(ibase_query)
break;
}
case 2:
- if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2 TSRMLS_CC, "rs",
+ if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2, "rs",
&zlink, &query, &query_len)) {
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zlink, &ib_link, &trans);
@@ -1111,15 +1111,15 @@ PHP_FUNCTION(ibase_query)
} else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
_php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count "
- "(%ld) reached" TSRMLS_CC, l);
+ "(%ld) reached", l);
} else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len,
query, SQL_DIALECT_CURRENT, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
} else if (!db) {
_php_ibase_module_error("Connection to created database could not be "
- "established" TSRMLS_CC);
+ "established");
} else {
@@ -1140,7 +1140,7 @@ PHP_FUNCTION(ibase_query)
}
case 1:
case 0:
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0 TSRMLS_CC, "s", &query,
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0, "s", &query,
&query_len)) {
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK,
le_link, le_plink);
@@ -1152,9 +1152,9 @@ PHP_FUNCTION(ibase_query)
}
/* open default transaction */
- if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)
+ if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans)
|| FAILURE == _php_ibase_alloc_query(&ib_query, ib_link, trans, query, ib_link->dialect,
- trans_res_id TSRMLS_CC)) {
+ trans_res_id)) {
return;
}
@@ -1163,13 +1163,13 @@ PHP_FUNCTION(ibase_query)
expected_n = ib_query.in_sqlda ? ib_query.in_sqlda->sqld : 0;
if (bind_n != expected_n) {
- php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
+ php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
if (bind_n < expected_n) {
break;
}
} else if (bind_n > 0) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &bind_args, &bind_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &bind_args, &bind_num) == FAILURE) {
return;
}
}
@@ -1191,7 +1191,7 @@ PHP_FUNCTION(ibase_query)
}
} while (0);
- _php_ibase_free_query(&ib_query TSRMLS_CC);
+ _php_ibase_free_query(&ib_query);
}
/* }}} */
@@ -1206,7 +1206,7 @@ PHP_FUNCTION(ibase_affected_rows)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
@@ -1264,14 +1264,14 @@ PHP_FUNCTION(ibase_num_rows)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, &result_arg, -1, LE_RESULT, le_result);
if (isc_dsql_sql_info(IB_STATUS, &ib_result->stmt, sizeof(info_count), info_count, sizeof(result), result)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1291,7 +1291,7 @@ PHP_FUNCTION(ibase_num_rows)
/* }}} */
static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */
- int scale, int flag TSRMLS_DC)
+ int scale, int flag)
{
static ISC_INT64 const scales[] = { 1, 10, 100, 1000,
10000,
@@ -1423,7 +1423,7 @@ format_date_time:
/* }}} */
static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_size, /* {{{ */
- ibase_array *ib_array, int dim, int flag TSRMLS_DC)
+ ibase_array *ib_array, int dim, int flag)
{
/**
* Create multidimension array - recursion function
@@ -1444,7 +1444,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
/* recursion here */
if (FAILURE == _php_ibase_arr_zval(&slice_zval, data, slice_size, ib_array, dim + 1,
- flag TSRMLS_CC)) {
+ flag)) {
return FAILURE;
}
data += slice_size;
@@ -1454,7 +1454,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz
} else { /* data at last */
if (FAILURE == _php_ibase_var_zval(ar_zval, data, ib_array->el_type,
- ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag TSRMLS_CC)) {
+ ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag)) {
return FAILURE;
}
@@ -1478,7 +1478,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result_arg, &flag)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result_arg, &flag)) {
return;
}
@@ -1492,7 +1492,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1, ib_result->out_sqlda)) {
ib_result->has_more_rows = 0;
if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
RETURN_FALSE;
}
@@ -1537,7 +1537,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
default:
_php_ibase_var_zval(&result, var->sqldata, var->sqltype, var->sqllen,
- var->sqlscale, flag TSRMLS_CC);
+ var->sqlscale, flag);
break;
case SQL_BLOB:
if (flag & PHP_IBASE_FETCH_BLOBS) { /* fetch blob contents into hash */
@@ -1553,13 +1553,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_open_blob(IB_STATUS, &ib_result->link->handle, &ib_result->trans->handle,
&blob_handle.bl_handle, &blob_handle.bl_qd)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
if (isc_blob_info(IB_STATUS, &blob_handle.bl_handle, sizeof(bl_items),
bl_items, sizeof(bl_info), bl_info)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
@@ -1588,12 +1588,12 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (max_len == 0) {
ZVAL_STRING(&result, "");
} else if (SUCCESS != _php_ibase_blob_get(&result, &blob_handle,
- max_len TSRMLS_CC)) {
+ max_len)) {
goto _php_ibase_fetch_error;
}
if (isc_close_blob(IB_STATUS, &blob_handle.bl_handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
goto _php_ibase_fetch_error;
}
@@ -1614,13 +1614,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type)
if (isc_array_get_slice(IB_STATUS, &ib_result->link->handle,
&ib_result->trans->handle, &ar_qd, &ib_array->ar_desc,
ar_data, &ib_array->ar_size)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ar_data);
goto _php_ibase_fetch_error;
}
if (FAILURE == _php_ibase_arr_zval(&result, ar_data, ib_array->ar_size, ib_array,
- 0, flag TSRMLS_CC)) {
+ 0, flag)) {
efree(ar_data);
goto _php_ibase_fetch_error;
}
@@ -1694,14 +1694,14 @@ PHP_FUNCTION(ibase_name_result)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result);
if (isc_dsql_set_cursor_name(IB_STATUS, &ib_result->stmt, name_arg, 0)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1718,7 +1718,7 @@ PHP_FUNCTION(ibase_free_result)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) {
return;
}
@@ -1742,12 +1742,12 @@ PHP_FUNCTION(ibase_prepare)
RESET_ERRMSG;
if (ZEND_NUM_ARGS() == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink);
} else if (ZEND_NUM_ARGS() == 2) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &link_arg, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link_arg, &query, &query_len) == FAILURE) {
return;
}
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, link_arg, &ib_link, &trans);
@@ -1756,7 +1756,7 @@ PHP_FUNCTION(ibase_prepare)
trans_res_id = Z_RES_P(link_arg)->handle;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, -1, LE_LINK, le_link, le_plink);
@@ -1764,13 +1764,13 @@ PHP_FUNCTION(ibase_prepare)
trans_res_id = Z_RES_P(trans_arg)->handle;
}
- if (FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_def_trans(ib_link, &trans)) {
RETURN_FALSE;
}
ib_query = (ibase_query *) emalloc(sizeof(ibase_query));
- if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id)) {
efree(ib_query);
RETURN_FALSE;
}
@@ -1792,7 +1792,7 @@ PHP_FUNCTION(ibase_execute)
RETVAL_FALSE;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r*", &query, &args, &bind_n)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r*", &query, &args, &bind_n)) {
return;
}
@@ -1802,7 +1802,7 @@ PHP_FUNCTION(ibase_execute)
int expected_n = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0;
if (bind_n != expected_n) {
- php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
+ php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
if (bind_n < expected_n) {
@@ -1818,7 +1818,7 @@ PHP_FUNCTION(ibase_execute)
IBDEBUG("Implicitly closing a cursor");
if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_close)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
break;
}
/* invalidate previous results returned by this query (not necessary for exec proc) */
@@ -1846,7 +1846,7 @@ PHP_FUNCTION(ibase_execute)
result->stmt = NULL;
}
- ret = zend_list_insert(result, le_result TSRMLS_CC);
+ ret = zend_list_insert(result, le_result);
ib_query->result_res_id = Z_RES_HANDLE_P(ret);
ZVAL_COPY_VALUE(return_value, ret);
Z_ADDREF_P(return_value);
@@ -1865,7 +1865,7 @@ PHP_FUNCTION(ibase_free_query)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &query_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &query_arg) == FAILURE) {
return;
}
@@ -1885,7 +1885,7 @@ PHP_FUNCTION(ibase_num_fields)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2009,7 +2009,7 @@ PHP_FUNCTION(ibase_field_info)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) {
return;
}
@@ -2028,7 +2028,7 @@ PHP_FUNCTION(ibase_field_info)
}
if (sqlda == NULL) {
- _php_ibase_module_error("Trying to get field info from a non-select query" TSRMLS_CC);
+ _php_ibase_module_error("Trying to get field info from a non-select query");
RETURN_FALSE;
}
@@ -2048,7 +2048,7 @@ PHP_FUNCTION(ibase_num_params)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2072,7 +2072,7 @@ PHP_FUNCTION(ibase_param_info)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) {
return;
}
diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c
index c068c8d56b..04125cf2aa 100644
--- a/ext/interbase/ibase_service.c
+++ b/ext/interbase/ibase_service.c
@@ -36,12 +36,12 @@ typedef struct {
static int le_service;
-static void _php_ibase_free_service(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_service(zend_resource *rsrc) /* {{{ */
{
ibase_service *sv = (ibase_service *) rsrc->ptr;
if (isc_service_detach(IB_STATUS, &sv->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
if (sv->hostname) {
@@ -58,7 +58,7 @@ static void _php_ibase_free_service(zend_resource *rsrc TSRMLS_DC) /* {{{ */
/* the svc api seems to get confused after an error has occurred,
so invalidate the handle on errors */
#define IBASE_SVC_ERROR(svm) \
- do { zend_list_delete(svm->res); _php_ibase_error(TSRMLS_C); } while (0)
+ do { zend_list_delete(svm->res); _php_ibase_error(); } while (0)
void php_ibase_service_minit(INIT_FUNC_ARGS) /* {{{ */
@@ -144,7 +144,7 @@ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(),
(operation == isc_action_svc_delete_user) ? "rs" : "rss|sss",
&res, &args[0], &args_len[0], &args[1], &args_len[1], &args[2], &args_len[2],
&args[3], &args_len[3], &args[4], &args_len[4])) {
@@ -215,7 +215,7 @@ PHP_FUNCTION(ibase_service_attach)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "sss",
&host, &hlen, &user, &ulen, &pass, &plen)) {
RETURN_FALSE;
@@ -227,7 +227,7 @@ PHP_FUNCTION(ibase_service_attach)
user, isc_spb_password, (char)plen, pass, host);
if (spb_len > sizeof(buf) || spb_len == -1) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -236,7 +236,7 @@ PHP_FUNCTION(ibase_service_attach)
/* attach to the service manager */
if (isc_service_attach(IB_STATUS, 0, loc, &handle, (unsigned short)spb_len, buf)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -259,7 +259,7 @@ PHP_FUNCTION(ibase_service_detach)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res)) {
RETURN_FALSE;
}
@@ -432,7 +432,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|lb",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rss|lb",
&res, &db, &dblen, &bk, &bklen, &opts, &verbose)) {
RETURN_FALSE;
}
@@ -451,7 +451,7 @@ static void _php_ibase_backup_restore(INTERNAL_FUNCTION_PARAMETERS, char operati
}
if (spb_len > sizeof(buf) || spb_len <= 0) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -495,7 +495,7 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl|l",
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rsl|l",
&res, &db, &dblen, &action, &argument)) {
RETURN_FALSE;
}
@@ -520,7 +520,7 @@ static void _php_ibase_service_action(INTERNAL_FUNCTION_PARAMETERS, char svc_act
switch (action) {
default:
unknown_option:
- _php_ibase_module_error("Unrecognised option (%ld)" TSRMLS_CC, action);
+ _php_ibase_module_error("Unrecognised option (%ld)", action);
RETURN_FALSE;
case isc_spb_rpr_check_db:
@@ -559,7 +559,7 @@ options_argument:
}
if (spb_len > sizeof(buf) || spb_len == -1) {
- _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len);
+ _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)", spb_len);
RETURN_FALSE;
}
@@ -602,7 +602,7 @@ PHP_FUNCTION(ibase_server_info)
RESET_ERRMSG;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &action)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &action)) {
RETURN_FALSE;
}
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 59c4a0fa42..cb944c9dde 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -41,7 +41,7 @@
#define COMMIT 1
#define RETAIN 2
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
ZEND_DECLARE_MODULE_GLOBALS(ibase)
static PHP_GINIT_FUNCTION(ibase);
@@ -502,7 +502,7 @@ PHP_FUNCTION(ibase_errcode)
/* }}} */
/* print interbase error and save it for ibase_errmsg() */
-void _php_ibase_error(TSRMLS_D) /* {{{ */
+void _php_ibase_error(void) /* {{{ */
{
char *s = IBG(errmsg);
ISC_STATUS *statusp = IB_STATUS;
@@ -514,17 +514,17 @@ void _php_ibase_error(TSRMLS_D) /* {{{ */
s = IBG(errmsg) + strlen(IBG(errmsg));
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg));
+ php_error_docref(NULL, E_WARNING, "%s", IBG(errmsg));
}
/* }}} */
/* print php interbase module error and save it for ibase_errmsg() */
-void _php_ibase_module_error(char *msg TSRMLS_DC, ...) /* {{{ */
+void _php_ibase_module_error(char *msg, ...) /* {{{ */
{
va_list ap;
#ifdef ZTS
- va_start(ap, TSRMLS_C);
+ va_start(ap, );
#else
va_start(ap, msg);
#endif
@@ -535,7 +535,7 @@ void _php_ibase_module_error(char *msg TSRMLS_DC, ...) /* {{{ */
IBG(sql_code) = -999; /* no SQL error */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg));
+ php_error_docref(NULL, E_WARNING, "%s", IBG(errmsg));
}
/* }}} */
@@ -575,7 +575,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */
/* destructors ---------------------- */
-static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
+static void _php_ibase_commit_link(ibase_db_link *link) /* {{{ */
{
unsigned short i = 0, j;
ibase_tr_list *l;
@@ -589,7 +589,7 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
if (p->trans->handle != NULL) {
IBDEBUG("Committing default transaction...");
if (isc_commit_transaction(IB_STATUS, &p->trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
efree(p->trans); /* default transaction is not a registered resource: clean up */
@@ -598,7 +598,7 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
/* non-default trans might have been rolled back by other call of this dtor */
IBDEBUG("Rolling back other transactions...");
if (isc_rollback_transaction(IB_STATUS, &p->trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
/* set this link pointer to NULL in the transaction */
@@ -616,26 +616,26 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */
link->tr_list = NULL;
for (e = link->event_head; e; e = e->event_next) {
- _php_ibase_free_event(e TSRMLS_CC);
+ _php_ibase_free_event(e);
e->link = NULL;
}
}
/* }}} */
-static void php_ibase_commit_link_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_ibase_commit_link_rsrc(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
}
/* }}} */
-static void _php_ibase_close_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_close_link(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
if (link->handle != NULL) {
IBDEBUG("Closing normal link...");
isc_detach_database(IB_STATUS, &link->handle);
@@ -645,11 +645,11 @@ static void _php_ibase_close_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_close_plink(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_close_plink(zend_resource *rsrc) /* {{{ */
{
ibase_db_link *link = (ibase_db_link *) rsrc->ptr;
- _php_ibase_commit_link(link TSRMLS_CC);
+ _php_ibase_commit_link(link);
IBDEBUG("Closing permanent link...");
if (link->handle != NULL) {
isc_detach_database(IB_STATUS, &link->handle);
@@ -660,7 +660,7 @@ static void _php_ibase_close_plink(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _php_ibase_free_trans(zend_resource *rsrc) /* {{{ */
{
ibase_trans *trans = (ibase_trans *)rsrc->ptr;
unsigned short i;
@@ -669,7 +669,7 @@ static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
if (trans->handle != NULL) {
IBDEBUG("Rolling back unhandled transaction...");
if (isc_rollback_transaction(IB_STATUS, &trans->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
}
}
@@ -694,7 +694,6 @@ static void _php_ibase_free_trans(zend_resource *rsrc TSRMLS_DC) /* {{{ */
/* TODO this function should be part of either Zend or PHP API */
static PHP_INI_DISP(php_ibase_password_displayer_cb)
{
- TSRMLS_FETCH();
if ((type == PHP_INI_DISPLAY_ORIG && ini_entry->orig_value)
|| (type == PHP_INI_DISPLAY_ACTIVE && ini_entry->value)) {
@@ -847,7 +846,7 @@ static char const dpb_args[] = {
0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name, 0
};
-int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db TSRMLS_DC)
+int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db)
{
short i, dpb_len, buf_len = 257-2; /* version byte at the front, and a null at the end */
char dpb_buffer[257] = { isc_dpb_version1, 0 }, *dpb;
@@ -873,7 +872,7 @@ int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db T
buf_len -= dpb_len;
}
if (isc_attach_database(IB_STATUS, (short)len[DB], args[DB], db, (short)(dpb-dpb_buffer), dpb_buffer)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
return SUCCESS;
@@ -892,7 +891,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssllsl",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|ssssllsl",
&args[DB], &len[DB], &args[USER], &len[USER], &args[PASS], &len[PASS],
&args[CSET], &len[CSET], &largs[BUF], &largs[DLECT], &args[ROLE], &len[ROLE],
&largs[SYNC])) {
@@ -975,12 +974,12 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
/* no link found, so we have to open one */
if ((l = INI_INT("ibase.max_links")) != -1 && IBG(num_links) >= l) {
- _php_ibase_module_error("Too many open links (%ld)" TSRMLS_CC, IBG(num_links));
+ _php_ibase_module_error("Too many open links (%ld)", IBG(num_links));
RETURN_FALSE;
}
/* create the ib_link */
- if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle TSRMLS_CC)) {
+ if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle)) {
RETURN_FALSE;
}
@@ -1060,7 +1059,7 @@ PHP_FUNCTION(ibase_close)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) {
return;
}
@@ -1098,7 +1097,7 @@ PHP_FUNCTION(ibase_drop_db)
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &link_arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) {
return;
}
@@ -1113,7 +1112,7 @@ PHP_FUNCTION(ibase_drop_db)
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink);
if (isc_drop_database(IB_STATUS, &ib_link->handle)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1159,7 +1158,7 @@ PHP_FUNCTION(ibase_trans)
ISC_TEB *teb;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argn) == FAILURE) {
efree(ib_link);
RETURN_FALSE;
}
@@ -1250,7 +1249,7 @@ PHP_FUNCTION(ibase_trans)
/* start the transaction */
if (result) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
efree(ib_link);
RETURN_FALSE;
}
@@ -1283,10 +1282,10 @@ PHP_FUNCTION(ibase_trans)
}
/* }}} */
-int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC) /* {{{ */
+int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans) /* {{{ */
{
if (ib_link == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database link");
+ php_error_docref(NULL, E_WARNING, "Invalid database link");
return FAILURE;
}
@@ -1310,7 +1309,7 @@ int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC)
}
if (tr->handle == NULL) {
if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
return FAILURE;
}
}
@@ -1330,7 +1329,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
RESET_ERRMSG;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
@@ -1338,7 +1337,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink);
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
- _php_ibase_module_error("Default link has no default transaction" TSRMLS_CC);
+ _php_ibase_module_error("Default link has no default transaction");
RETURN_FALSE;
}
trans = ib_link->tr_list->trans;
@@ -1352,7 +1351,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
- _php_ibase_module_error("Link has no default transaction" TSRMLS_CC);
+ _php_ibase_module_error("Link has no default transaction");
RETURN_FALSE;
}
trans = ib_link->tr_list->trans;
@@ -1375,7 +1374,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
}
if (result) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
@@ -1434,13 +1433,13 @@ PHP_FUNCTION(ibase_gen_id)
RESET_ERRMSG;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &generator, &gen_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|lr", &generator, &gen_len,
&inc, &link)) {
RETURN_FALSE;
}
if (gen_len > 31) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid generator name");
+ php_error_docref(NULL, E_WARNING, "Invalid generator name");
RETURN_FALSE;
}
@@ -1461,7 +1460,7 @@ PHP_FUNCTION(ibase_gen_id)
/* execute the query */
if (isc_dsql_exec_immed2(IB_STATUS, &ib_link->handle, &trans->handle, 0, query,
SQL_DIALECT_CURRENT, NULL, &out_sqlda)) {
- _php_ibase_error(TSRMLS_C);
+ _php_ibase_error();
RETURN_FALSE;
}
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index 8e80505c17..a4886cb8e0 100644
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -149,8 +149,8 @@ typedef void (__stdcall *info_func_t)(char*);
typedef void (*info_func_t)(char*);
#endif
-void _php_ibase_error(TSRMLS_D);
-void _php_ibase_module_error(char * TSRMLS_DC, ...)
+void _php_ibase_error(void);
+void _php_ibase_module_error(char *, ...)
PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2);
/* determine if a resource is a link or transaction handle */
@@ -160,10 +160,10 @@ void _php_ibase_module_error(char * TSRMLS_DC, ...)
"InterBase link", le_link, le_plink) } \
else \
_php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zv, &lh, &th); \
- if (SUCCESS != _php_ibase_def_trans(lh, &th TSRMLS_CC)) { RETURN_FALSE; } \
+ if (SUCCESS != _php_ibase_def_trans(lh, &th)) { RETURN_FALSE; } \
} while (0)
-int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC);
+int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans);
void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval *link_id,
ibase_db_link **ib_link, ibase_trans **trans);
@@ -174,12 +174,12 @@ void php_ibase_query_minit(INIT_FUNC_ARGS);
void php_ibase_blobs_minit(INIT_FUNC_ARGS);
int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd);
char *_php_ibase_quad_to_string(ISC_QUAD const qd);
-int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC);
-int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob TSRMLS_DC);
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len);
+int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob);
/* provided by ibase_events.c */
void php_ibase_events_minit(INIT_FUNC_ARGS);
-void _php_ibase_free_event(ibase_event *event TSRMLS_DC);
+void _php_ibase_free_event(ibase_event *event);
/* provided by ibase_service.c */
void php_ibase_service_minit(INIT_FUNC_ARGS);
diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c
index 4b47fbcfb6..63c6a89fea 100644
--- a/ext/interbase/php_ibase_udf.c
+++ b/ext/interbase/php_ibase_udf.c
@@ -132,7 +132,7 @@ static void __attribute__((constructor)) init()
static void __attribute__((destructor)) fini()
{
- php_embed_shutdown(TSRMLS_C);
+ php_embed_shutdown();
}
#endif
@@ -156,14 +156,14 @@ void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init)
default:
#ifdef PHP_EMBED
php_request_shutdown(NULL);
- if (FAILURE == (result = php_request_startup(TSRMLS_C))) {
+ if (FAILURE == (result = php_request_startup())) {
break;
}
case 0:
#endif
/* feed it to the parser */
zend_first_try {
- result = zend_eval_stringl(code, b->blob_total_length, NULL, "Firebird Embedded PHP engine" TSRMLS_CC);
+ result = zend_eval_stringl(code, b->blob_total_length, NULL, "Firebird Embedded PHP engine");
} zend_end_try();
}
@@ -192,7 +192,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
LOCK();
/* check if the requested function exists */
- if (!zend_is_callable(&callback, 0, NULL TSRMLS_CC)) {
+ if (!zend_is_callable(&callback, 0, NULL)) {
break;
}
@@ -286,7 +286,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
/* now call the function */
if (FAILURE == call_user_function(EG(function_table), NULL,
- &callback, &return_value, argc, args TSRMLS_CC)) {
+ &callback, &return_value, argc, args)) {
UNLOCK();
break;
}
@@ -345,7 +345,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
* that's not possible. We can however report it back to PHP.
*/
LOCK();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling function '%s' from database", name);
+ php_error_docref(NULL, E_WARNING, "Error calling function '%s' from database", name);
UNLOCK();
}
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index 715a866111..813204cd21 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -47,7 +47,7 @@ zend_object_handlers BreakIterator_handlers;
/* }}} */
U_CFUNC void breakiterator_object_create(zval *object,
- BreakIterator *biter, int brand_new TSRMLS_DC)
+ BreakIterator *biter, int brand_new)
{
UClassID classId = biter->getDynamicClassID();
zend_class_entry *ce;
@@ -63,11 +63,11 @@ U_CFUNC void breakiterator_object_create(zval *object,
if (brand_new) {
object_init_ex(object, ce);
}
- breakiterator_object_construct(object, biter TSRMLS_CC);
+ breakiterator_object_construct(object, biter);
}
U_CFUNC void breakiterator_object_construct(zval *object,
- BreakIterator *biter TSRMLS_DC)
+ BreakIterator *biter)
{
BreakIterator_object *bio;
@@ -78,7 +78,7 @@ U_CFUNC void breakiterator_object_construct(zval *object,
/* {{{ compare handler for BreakIterator */
static int BreakIterator_compare_objects(zval *object1,
- zval *object2 TSRMLS_DC)
+ zval *object2)
{
BreakIterator_object *bio1,
*bio2;
@@ -95,19 +95,19 @@ static int BreakIterator_compare_objects(zval *object1,
/* }}} */
/* {{{ clone handler for BreakIterator */
-static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
+static zend_object *BreakIterator_clone_obj(zval *object)
{
BreakIterator_object *bio_orig,
*bio_new;
zend_object *ret_val;
bio_orig = Z_INTL_BREAKITERATOR_P(object);
- intl_errors_reset(INTL_DATA_ERROR_P(bio_orig) TSRMLS_CC);
+ intl_errors_reset(INTL_DATA_ERROR_P(bio_orig));
- ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = BreakIterator_ce_ptr->create_object(Z_OBJCE_P(object));
bio_new = php_intl_breakiterator_fetch_object(ret_val);
- zend_objects_clone_members(&bio_new->zo, &bio_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&bio_new->zo, &bio_orig->zo);
if (bio_orig->biter != NULL) {
BreakIterator *new_biter;
@@ -116,18 +116,18 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
if (!new_biter) {
zend_string *err_msg;
intl_errors_set_code(BREAKITER_ERROR_P(bio_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(BREAKITER_ERROR_P(bio_orig),
- "Could not clone BreakIterator", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone BreakIterator", 0);
+ err_msg = intl_error_get_message(BREAKITER_ERROR_P(bio_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
bio_new->biter = new_biter;
ZVAL_COPY(&bio_new->text, &bio_orig->text);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed BreakIterator", 0);
}
return ret_val;
@@ -135,7 +135,7 @@ static zend_object *BreakIterator_clone_obj(zval *object TSRMLS_DC)
/* }}} */
/* {{{ get_debug_info handler for BreakIterator */
-static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp)
{
zval val;
HashTable *debug_info;
@@ -176,23 +176,23 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp TSRMLS
/* {{{ void breakiterator_object_init(BreakIterator_object* to)
* Initialize internals of BreakIterator_object not specific to zend standard objects.
*/
-static void breakiterator_object_init(BreakIterator_object *bio TSRMLS_DC)
+static void breakiterator_object_init(BreakIterator_object *bio)
{
- intl_error_init(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_error_init(BREAKITER_ERROR_P(bio));
bio->biter = NULL;
ZVAL_UNDEF(&bio->text);
}
/* }}} */
/* {{{ BreakIterator_objects_dtor */
-static void BreakIterator_objects_dtor(zend_object *object TSRMLS_DC)
+static void BreakIterator_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ BreakIterator_objects_free */
-static void BreakIterator_objects_free(zend_object *object TSRMLS_DC)
+static void BreakIterator_objects_free(zend_object *object)
{
BreakIterator_object* bio = php_intl_breakiterator_fetch_object(object);
@@ -201,22 +201,22 @@ static void BreakIterator_objects_free(zend_object *object TSRMLS_DC)
delete bio->biter;
bio->biter = NULL;
}
- intl_error_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_error_reset(BREAKITER_ERROR_P(bio));
- zend_object_std_dtor(&bio->zo TSRMLS_CC);
+ zend_object_std_dtor(&bio->zo);
}
/* }}} */
/* {{{ BreakIterator_object_create */
-static zend_object *BreakIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *BreakIterator_object_create(zend_class_entry *ce)
{
BreakIterator_object* intern;
intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init((zend_object*) intern, ce);
- breakiterator_object_init(intern TSRMLS_CC);
+ breakiterator_object_init(intern);
intern->zo.handlers = &BreakIterator_handlers;
@@ -316,7 +316,7 @@ static const zend_function_entry CodePointBreakIterator_class_functions[] = {
/* {{{ breakiterator_register_BreakIterator_class
* Initialize 'BreakIterator' class
*/
-U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
+U_CFUNC void breakiterator_register_BreakIterator_class(void)
{
zend_class_entry ce;
@@ -324,7 +324,7 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "IntlBreakIterator", BreakIterator_class_functions);
ce.create_object = BreakIterator_object_create;
ce.get_iterator = _breakiterator_get_iterator;
- BreakIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ BreakIterator_ce_ptr = zend_register_internal_class(&ce);
memcpy(&BreakIterator_handlers, zend_get_std_object_handlers(),
sizeof BreakIterator_handlers);
@@ -335,16 +335,16 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
BreakIterator_handlers.dtor_obj = BreakIterator_objects_dtor;
BreakIterator_handlers.free_obj = BreakIterator_objects_free;
- zend_class_implements(BreakIterator_ce_ptr TSRMLS_CC, 1,
+ zend_class_implements(BreakIterator_ce_ptr, 1,
zend_ce_traversable);
zend_declare_class_constant_long(BreakIterator_ce_ptr,
- "DONE", sizeof("DONE") - 1, BreakIterator::DONE TSRMLS_CC );
+ "DONE", sizeof("DONE") - 1, BreakIterator::DONE );
/* Declare constants that are defined in the C header */
#define BREAKITER_DECL_LONG_CONST(name) \
zend_declare_class_constant_long(BreakIterator_ce_ptr, #name, \
- sizeof(#name) - 1, UBRK_ ## name TSRMLS_CC)
+ sizeof(#name) - 1, UBRK_ ## name)
BREAKITER_DECL_LONG_CONST(WORD_NONE);
BREAKITER_DECL_LONG_CONST(WORD_NONE_LIMIT);
@@ -374,12 +374,12 @@ U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator",
RuleBasedBreakIterator_class_functions);
RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- BreakIterator_ce_ptr TSRMLS_CC);
+ BreakIterator_ce_ptr);
/* Create and register 'CodePointBreakIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator",
CodePointBreakIterator_class_functions);
CodePointBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- BreakIterator_ce_ptr TSRMLS_CC);
+ BreakIterator_ce_ptr);
}
/* }}} */
diff --git a/ext/intl/breakiterator/breakiterator_class.h b/ext/intl/breakiterator/breakiterator_class.h
index 6333003981..d1b5ebb2c8 100644
--- a/ext/intl/breakiterator/breakiterator_class.h
+++ b/ext/intl/breakiterator/breakiterator_class.h
@@ -58,15 +58,15 @@ static inline BreakIterator_object *php_intl_breakiterator_fetch_object(zend_obj
BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; \
if (bio->biter == NULL) \
{ \
- intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0 TSRMLS_CC); \
+ intl_errors_set(&bio->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed BreakIterator", 0); \
RETURN_FALSE; \
}
-void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new TSRMLS_DC);
+void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new);
-void breakiterator_object_construct(zval *object, BreakIterator *break_iter TSRMLS_DC);
+void breakiterator_object_construct(zval *object, BreakIterator *break_iter);
-void breakiterator_register_BreakIterator_class(TSRMLS_D);
+void breakiterator_register_BreakIterator_class(void);
extern zend_class_entry *BreakIterator_ce_ptr,
*RuleBasedBreakIterator_ce_ptr;
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp
index 19de7bce34..624a813e54 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.cpp
+++ b/ext/intl/breakiterator/breakiterator_iterators.cpp
@@ -36,30 +36,30 @@ static zend_object_handlers IntlPartsIterator_handlers;
/* BreakIterator's iterator */
-inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter TSRMLS_DC)
+inline BreakIterator *_breakiter_prolog(zend_object_iterator *iter)
{
BreakIterator_object *bio;
bio = Z_INTL_BREAKITERATOR_P(&iter->data);
- intl_errors_reset(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ intl_errors_reset(BREAKITER_ERROR_P(bio));
if (bio->biter == NULL) {
intl_errors_set(BREAKITER_ERROR_P(bio), U_INVALID_STATE_ERROR,
"The BreakIterator object backing the PHP iterator is not "
- "properly constructed", 0 TSRMLS_CC);
+ "properly constructed", 0);
}
return bio->biter;
}
-static void _breakiterator_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_destroy_it(zend_object_iterator *iter)
{
zval_ptr_dtor(&iter->data);
}
-static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_move_forward(zend_object_iterator *iter)
{
- BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC);
+ BreakIterator *biter = _breakiter_prolog(iter);
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
if (biter == NULL) {
return;
@@ -71,9 +71,9 @@ static void _breakiterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
} //else we've reached the end of the enum, nothing more is required
}
-static void _breakiterator_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_rewind(zend_object_iterator *iter)
{
- BreakIterator *biter = _breakiter_prolog(iter TSRMLS_CC);
+ BreakIterator *biter = _breakiter_prolog(iter);
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
int32_t pos = biter->first();
@@ -91,12 +91,12 @@ static zend_object_iterator_funcs breakiterator_iterator_funcs = {
};
U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+ zend_class_entry *ce, zval *object, int by_ref)
{
BreakIterator_object *bio;
if (by_ref) {
zend_throw_exception(NULL,
- "Iteration by reference is not supported", 0 TSRMLS_CC);
+ "Iteration by reference is not supported", 0);
return NULL;
}
@@ -105,12 +105,12 @@ U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
if (biter == NULL) {
zend_throw_exception(NULL,
- "The BreakIterator is not properly constructed", 0 TSRMLS_CC);
+ "The BreakIterator is not properly constructed", 0);
return NULL;
}
zoi_with_current *zoi_iter = static_cast<zoi_with_current*>(emalloc(sizeof *zoi_iter));
- zend_iterator_init(&zoi_iter->zoi TSRMLS_CC);
+ zend_iterator_init(&zoi_iter->zoi);
ZVAL_COPY(&zoi_iter->zoi.data, object);
zoi_iter->zoi.funcs = &breakiterator_iterator_funcs;
zoi_iter->zoi.index = 0;
@@ -129,23 +129,23 @@ typedef struct zoi_break_iter_parts {
BreakIterator_object *bio; /* so we don't have to fetch it all the time */
} zoi_break_iter_parts;
-static void _breakiterator_parts_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_destroy_it(zend_object_iterator *iter)
{
zval_ptr_dtor(&iter->data);
}
-static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void _breakiterator_parts_get_current_key(zend_object_iterator *iter, zval *key)
{
/* the actual work is done in move_forward and rewind */
ZVAL_LONG(key, iter->index);
}
-static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_move_forward(zend_object_iterator *iter)
{
zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter;
BreakIterator_object *bio = zoi_bit->bio;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
int32_t cur,
next;
@@ -183,18 +183,18 @@ static void _breakiterator_parts_move_forward(zend_object_iterator *iter TSRMLS_
ZVAL_STR(&zoi_bit->zoi_cur.current, res);
}
-static void _breakiterator_parts_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void _breakiterator_parts_rewind(zend_object_iterator *iter)
{
zoi_break_iter_parts *zoi_bit = (zoi_break_iter_parts*)iter;
BreakIterator_object *bio = zoi_bit->bio;
if (!Z_ISUNDEF(zoi_bit->zoi_cur.current)) {
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
}
bio->biter->first();
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
}
static zend_object_iterator_funcs breakiterator_parts_it_funcs = {
@@ -209,7 +209,7 @@ static zend_object_iterator_funcs breakiterator_parts_it_funcs = {
void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
zval *object,
- parts_iter_key_type key_type TSRMLS_DC)
+ parts_iter_key_type key_type)
{
IntlIterator_object *ii;
@@ -217,7 +217,7 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
ii = Z_INTL_ITERATOR_P(object);
ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_break_iter_parts));
- zend_iterator_init(ii->iterator TSRMLS_CC);
+ zend_iterator_init(ii->iterator);
ZVAL_COPY(&ii->iterator->data, break_iter_zv);
ii->iterator->funcs = &breakiterator_parts_it_funcs;
@@ -234,15 +234,15 @@ void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
((zoi_break_iter_parts*)ii->iterator)->key_type = key_type;
}
-U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+U_CFUNC zend_object *IntlPartsIterator_object_create(zend_class_entry *ce)
{
- zend_object *retval = IntlIterator_ce_ptr->create_object(ce TSRMLS_CC);
+ zend_object *retval = IntlIterator_ce_ptr->create_object(ce);
retval->handlers = &IntlPartsIterator_handlers;
return retval;
}
-U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key TSRMLS_DC)
+U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, zend_string *method, const zval *key)
{
zend_function *ret;
zend_string *lc_method_name;
@@ -261,12 +261,12 @@ U_CFUNC zend_function *IntlPartsIterator_get_method(zend_object **object_ptr, ze
if (obj->iterator && !Z_ISUNDEF(obj->iterator->data)) {
zval *break_iter_zv = &obj->iterator->data;
*object_ptr = Z_OBJ_P(break_iter_zv);
- ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key TSRMLS_CC);
+ ret = Z_OBJ_HANDLER_P(break_iter_zv, get_method)(object_ptr, method, key);
goto end;
}
}
- ret = std_object_handlers.get_method(object_ptr, method, key TSRMLS_CC);
+ ret = std_object_handlers.get_method(object_ptr, method, key);
end:
if (key == NULL) {
@@ -282,7 +282,7 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlPartsIterator::getBreakIterator: bad arguments", 0 TSRMLS_CC);
+ "IntlPartsIterator::getBreakIterator: bad arguments", 0);
return;
}
@@ -300,14 +300,14 @@ static const zend_function_entry IntlPartsIterator_class_functions[] = {
PHP_FE_END
};
-U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D)
+U_CFUNC void breakiterator_register_IntlPartsIterator_class(void)
{
zend_class_entry ce;
/* Create and register 'BreakIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlPartsIterator", IntlPartsIterator_class_functions);
IntlPartsIterator_ce_ptr = zend_register_internal_class_ex(&ce,
- IntlIterator_ce_ptr TSRMLS_CC);
+ IntlIterator_ce_ptr);
IntlPartsIterator_ce_ptr->create_object = IntlPartsIterator_object_create;
memcpy(&IntlPartsIterator_handlers, &IntlIterator_handlers,
@@ -316,7 +316,7 @@ U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D)
#define PARTSITER_DECL_LONG_CONST(name) \
zend_declare_class_constant_long(IntlPartsIterator_ce_ptr, #name, \
- sizeof(#name) - 1, PARTS_ITERATOR_ ## name TSRMLS_CC)
+ sizeof(#name) - 1, PARTS_ITERATOR_ ## name)
PARTSITER_DECL_LONG_CONST(KEY_SEQUENTIAL);
PARTSITER_DECL_LONG_CONST(KEY_LEFT);
diff --git a/ext/intl/breakiterator/breakiterator_iterators.h b/ext/intl/breakiterator/breakiterator_iterators.h
index 764f4f4426..71a1e35025 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.h
+++ b/ext/intl/breakiterator/breakiterator_iterators.h
@@ -32,11 +32,11 @@ typedef enum {
#ifdef __cplusplus
void IntlIterator_from_BreakIterator_parts(zval *break_iter_zv,
zval *object,
- parts_iter_key_type key_type TSRMLS_DC);
+ parts_iter_key_type key_type);
#endif
U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
-U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D);
+ zend_class_entry *ce, zval *object, int by_ref);
+U_CFUNC void breakiterator_register_IntlPartsIterator_class(void);
#endif
diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp
index 1153340e14..64c85bad73 100644
--- a/ext/intl/breakiterator/breakiterator_methods.cpp
+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
@@ -37,7 +37,7 @@ U_CFUNC PHP_METHOD(BreakIterator, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
static void _breakiter_factory(const char *func_name,
@@ -49,31 +49,31 @@ static void _breakiter_factory(const char *func_name,
size_t dummy;
char *msg;
UErrorCode status = UErrorCode();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!",
&locale_str, &dummy) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_NULL();
}
if (locale_str == NULL) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
biter = func(Locale::createFromName(locale_str), status);
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
if (U_FAILURE(status)) {
spprintf(&msg, 0, "%s: error creating BreakIterator",
func_name);
- intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, msg, 1);
efree(msg);
RETURN_NULL();
}
- breakiterator_object_create(return_value, biter, 1 TSRMLS_CC);
+ breakiterator_object_create(return_value, biter, 1);
}
U_CFUNC PHP_FUNCTION(breakiter_create_word_instance)
@@ -114,16 +114,16 @@ U_CFUNC PHP_FUNCTION(breakiter_create_title_instance)
U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance)
{
UErrorCode status = UErrorCode();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_create_code_point_instance: bad arguments", 0 TSRMLS_CC);
+ "breakiter_create_code_point_instance: bad arguments", 0);
RETURN_NULL();
}
CodePointBreakIterator *cpbi = new CodePointBreakIterator();
- breakiterator_object_create(return_value, cpbi, 1 TSRMLS_CC);
+ breakiterator_object_create(return_value, cpbi, 1);
}
U_CFUNC PHP_FUNCTION(breakiter_get_text)
@@ -133,7 +133,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_text)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_text: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_text: bad arguments", 0);
RETURN_FALSE;
}
@@ -155,10 +155,10 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&text, &text_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_set_text: bad arguments", 0 TSRMLS_CC);
+ "breakiter_set_text: bad arguments", 0);
RETURN_FALSE;
}
@@ -199,7 +199,7 @@ static void _breakiter_no_args_ret_int32(
if (zend_parse_parameters_none() == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -221,9 +221,9 @@ static void _breakiter_int32_ret_int32(
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -233,7 +233,7 @@ static void _breakiter_int32_ret_int32(
if (arg < INT32_MIN || arg > INT32_MAX) {
spprintf(&msg, 0, "%s: offset argument is outside bounds of "
"a 32-bit wide integer", func_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
RETURN_FALSE;
}
@@ -300,7 +300,7 @@ U_CFUNC PHP_FUNCTION(breakiter_current)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_current: bad arguments", 0 TSRMLS_CC);
+ "breakiter_current: bad arguments", 0);
RETURN_FALSE;
}
@@ -331,17 +331,17 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l",
&offset) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_is_boundary: bad arguments", 0 TSRMLS_CC);
+ "breakiter_is_boundary: bad arguments", 0);
RETURN_FALSE;
}
if (offset < INT32_MIN || offset > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"breakiter_is_boundary: offset argument is outside bounds of "
- "a 32-bit wide integer", 0 TSRMLS_CC);
+ "a 32-bit wide integer", 0);
RETURN_FALSE;
}
@@ -358,15 +358,15 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &locale_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_locale: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_locale: bad arguments", 0);
RETURN_FALSE;
}
if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_locale: invalid locale type", 0 TSRMLS_CC);
+ "breakiter_get_locale: invalid locale type", 0);
RETURN_FALSE;
}
@@ -386,9 +386,9 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
BREAKITER_METHOD_INIT_VARS;
object = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &key_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_parts_iterator: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_parts_iterator: bad arguments", 0);
RETURN_FALSE;
}
@@ -396,14 +396,14 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
&& key_type != PARTS_ITERATOR_KEY_LEFT
&& key_type != PARTS_ITERATOR_KEY_RIGHT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_parts_iterator: bad key type", 0 TSRMLS_CC);
+ "breakiter_get_parts_iterator: bad key type", 0);
RETURN_FALSE;
}
BREAKITER_METHOD_FETCH_OBJECT;
IntlIterator_from_BreakIterator_parts(
- object, return_value, (parts_iter_key_type)key_type TSRMLS_CC);
+ object, return_value, (parts_iter_key_type)key_type);
}
U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
@@ -413,7 +413,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "breakiter_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -433,7 +433,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "breakiter_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "breakiter_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -444,6 +444,6 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(BREAKITER_ERROR_P(bio) TSRMLS_CC);
+ message = intl_error_get_message(BREAKITER_ERROR_P(bio));
RETURN_STR(message);
}
diff --git a/ext/intl/breakiterator/codepointiterator_methods.cpp b/ext/intl/breakiterator/codepointiterator_methods.cpp
index d7fe359712..f916915ae2 100644
--- a/ext/intl/breakiterator/codepointiterator_methods.cpp
+++ b/ext/intl/breakiterator/codepointiterator_methods.cpp
@@ -34,7 +34,7 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "cpbi_get_last_code_point: bad arguments", 0 TSRMLS_CC);
+ "cpbi_get_last_code_point: bad arguments", 0);
RETURN_FALSE;
}
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index d3b36291b2..be38396466 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -36,12 +36,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
size_t rules_len;
zend_bool compiled = 0;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b",
&rules, &rules_len, &compiled) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_create_instance: bad arguments", 0 TSRMLS_CC);
+ "rbbi_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -56,12 +56,12 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"rbbi_create_instance: rules were not a valid UTF-8 string",
- 0 TSRMLS_CC);
+ 0);
RETURN_NULL();
}
rbbi = new RuleBasedBreakIterator(rulesStr, parseError, status);
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
if (U_FAILURE(status)) {
char *msg;
smart_str parse_error_str;
@@ -69,7 +69,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
spprintf(&msg, 0, "rbbi_create_instance: unable to create "
"RuleBasedBreakIterator from rules (%s)", parse_error_str.s? parse_error_str.s->val : "");
smart_str_free(&parse_error_str);
- intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, msg, 1);
efree(msg);
delete rbbi;
Z_OBJ_P(return_value) = NULL;
@@ -80,19 +80,19 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
- "create instance from compiled rules", 0 TSRMLS_CC);
+ "create instance from compiled rules", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
#else
intl_error_set(NULL, U_UNSUPPORTED_ERROR, "rbbi_create_instance: "
- "compiled rules require ICU >= 4.8", 0 TSRMLS_CC);
+ "compiled rules require ICU >= 4.8", 0);
Z_OBJ_P(return_value) = NULL;
return;
#endif
}
- breakiterator_object_create(return_value, rbbi, 0 TSRMLS_CC);
+ breakiterator_object_create(return_value, rbbi, 0);
}
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
@@ -103,7 +103,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -116,7 +116,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rules: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rules: bad arguments", 0);
RETURN_FALSE;
}
@@ -130,7 +130,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
{
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_hash_code: Error converting result to UTF-8 string",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
RETVAL_STRINGL(str, str_len);
@@ -145,7 +145,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rule_status: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rule_status: bad arguments", 0);
RETURN_FALSE;
}
@@ -161,7 +161,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_rule_status_vec: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_rule_status_vec: bad arguments", 0);
RETURN_FALSE;
}
@@ -183,7 +183,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
delete[] rules;
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_get_rule_status_vec: failed obtaining the status values",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -202,7 +202,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "rbbi_get_binary_rules: bad arguments", 0 TSRMLS_CC);
+ "rbbi_get_binary_rules: bad arguments", 0);
RETURN_FALSE;
}
@@ -214,7 +214,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
if (rules_len > INT_MAX - 1) {
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_get_binary_rules: the rules are too large",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 7273b1d277..81f6d81546 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -41,7 +41,7 @@ zend_object_handlers Calendar_handlers;
/* }}} */
U_CFUNC void calendar_object_create(zval *object,
- Calendar *calendar TSRMLS_DC)
+ Calendar *calendar)
{
UClassID classId = calendar->getDynamicClassID();
zend_class_entry *ce;
@@ -54,10 +54,10 @@ U_CFUNC void calendar_object_create(zval *object,
}
object_init_ex(object, ce);
- calendar_object_construct(object, calendar TSRMLS_CC);
+ calendar_object_construct(object, calendar);
}
-U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC)
+U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object)
{
Calendar_object *co = Z_INTL_CALENDAR_P(object);
@@ -65,7 +65,7 @@ U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC)
}
U_CFUNC void calendar_object_construct(zval *object,
- Calendar *calendar TSRMLS_DC)
+ Calendar *calendar)
{
Calendar_object *co;
@@ -75,20 +75,20 @@ U_CFUNC void calendar_object_construct(zval *object,
}
/* {{{ clone handler for Calendar */
-static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC)
+static zend_object *Calendar_clone_obj(zval *object)
{
Calendar_object *co_orig,
*co_new;
zend_object *ret_val;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
co_orig = Z_INTL_CALENDAR_P(object);
- intl_error_reset(INTL_DATA_ERROR_P(co_orig) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(co_orig));
- ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = Calendar_ce_ptr->create_object(Z_OBJCE_P(object));
co_new = php_intl_calendar_fetch_object(ret_val);
- zend_objects_clone_members(&co_new->zo, &co_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&co_new->zo, &co_orig->zo);
if (co_orig->ucal != NULL) {
Calendar *newCalendar;
@@ -97,17 +97,17 @@ static zend_object *Calendar_clone_obj(zval *object TSRMLS_DC)
if (!newCalendar) {
zend_string *err_msg;
intl_errors_set_code(CALENDAR_ERROR_P(co_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(CALENDAR_ERROR_P(co_orig),
- "Could not clone IntlCalendar", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone IntlCalendar", 0);
+ err_msg = intl_error_get_message(CALENDAR_ERROR_P(co_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
co_new->ucal = newCalendar;
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlCalendar", 0);
}
return ret_val;
@@ -144,7 +144,7 @@ static const struct {
};
/* {{{ get_debug_info handler for Calendar */
-static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *Calendar_get_debug_info(zval *object, int *is_temp)
{
zval zv,
zfields;
@@ -176,8 +176,8 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
int is_tmp;
HashTable *debug_info_tz;
- timezone_object_construct(&cal->getTimeZone(), &ztz , 0 TSRMLS_CC);
- debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp TSRMLS_CC);
+ timezone_object_construct(&cal->getTimeZone(), &ztz , 0);
+ debug_info = Z_OBJ_HANDLER(ztz, get_debug_info)(&ztz, &is_tmp);
assert(is_tmp == 1);
array_init(&ztz_debug);
@@ -224,22 +224,22 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ void calendar_object_init(Calendar_object* to)
* Initialize internals of Calendar_object not specific to zend standard objects.
*/
-static void calendar_object_init(Calendar_object *co TSRMLS_DC)
+static void calendar_object_init(Calendar_object *co)
{
- intl_error_init(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ intl_error_init(CALENDAR_ERROR_P(co));
co->ucal = NULL;
}
/* }}} */
/* {{{ Calendar_objects_dtor */
-static void Calendar_objects_dtor(zend_object *object TSRMLS_DC)
+static void Calendar_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ Calendar_objects_free */
-static void Calendar_objects_free(zend_object *object TSRMLS_DC)
+static void Calendar_objects_free(zend_object *object)
{
Calendar_object* co = php_intl_calendar_fetch_object(object);
@@ -247,22 +247,22 @@ static void Calendar_objects_free(zend_object *object TSRMLS_DC)
delete co->ucal;
co->ucal = NULL;
}
- intl_error_reset(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ intl_error_reset(CALENDAR_ERROR_P(co));
- zend_object_std_dtor(&co->zo TSRMLS_CC);
+ zend_object_std_dtor(&co->zo);
}
/* }}} */
/* {{{ Calendar_object_create */
-static zend_object *Calendar_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *Calendar_object_create(zend_class_entry *ce)
{
Calendar_object* intern;
intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init((zend_object*) intern, ce);
- calendar_object_init(intern TSRMLS_CC);
+ calendar_object_init(intern);
intern->zo.handlers = &Calendar_handlers;
@@ -455,17 +455,17 @@ static const zend_function_entry GregorianCalendar_class_functions[] = {
/* {{{ calendar_register_IntlCalendar_class
* Initialize 'IntlCalendar' class
*/
-void calendar_register_IntlCalendar_class(TSRMLS_D)
+void calendar_register_IntlCalendar_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlCalendar", Calendar_class_functions);
ce.create_object = Calendar_object_create;
- Calendar_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ Calendar_ce_ptr = zend_register_internal_class(&ce);
if (!Calendar_ce_ptr) {
//can't happen now without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlCalendar: class registration has failed.");
return;
}
@@ -480,10 +480,10 @@ void calendar_register_IntlCalendar_class(TSRMLS_D)
/* Create and register 'IntlGregorianCalendar' class. */
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions);
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
- Calendar_ce_ptr TSRMLS_CC);
+ Calendar_ce_ptr);
if (!GregorianCalendar_ce_ptr) {
//can't happen know without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlGregorianCalendar: class registration has failed.");
return;
}
@@ -491,7 +491,7 @@ void calendar_register_IntlCalendar_class(TSRMLS_D)
/* Declare 'IntlCalendar' class constants */
#define CALENDAR_DECL_LONG_CONST(name, val) \
zend_declare_class_constant_long(Calendar_ce_ptr, name, sizeof(name) - 1, \
- val TSRMLS_CC)
+ val)
CALENDAR_DECL_LONG_CONST("FIELD_ERA", UCAL_ERA);
CALENDAR_DECL_LONG_CONST("FIELD_YEAR", UCAL_YEAR);
diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h
index 47f991f118..a884580a9a 100644
--- a/ext/intl/calendar/calendar_class.h
+++ b/ext/intl/calendar/calendar_class.h
@@ -55,17 +55,17 @@ static inline Calendar_object *php_intl_calendar_fetch_object(zend_object *obj)
CALENDAR_METHOD_FETCH_OBJECT_NO_CHECK; \
if (co->ucal == NULL) \
{ \
- intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0 TSRMLS_CC); \
+ intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlCalendar", 0); \
RETURN_FALSE; \
}
-void calendar_object_create(zval *object, Calendar *calendar TSRMLS_DC);
+void calendar_object_create(zval *object, Calendar *calendar);
-Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC);
+Calendar *calendar_fetch_native_calendar(zval *object);
-void calendar_object_construct(zval *object, Calendar *calendar TSRMLS_DC);
+void calendar_object_construct(zval *object, Calendar *calendar);
-void calendar_register_IntlCalendar_class(TSRMLS_D);
+void calendar_register_IntlCalendar_class(void);
extern zend_class_entry *Calendar_ce_ptr,
*GregorianCalendar_ce_ptr;
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index eaa1930e42..da338db46b 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -44,7 +44,7 @@ U_CFUNC PHP_METHOD(IntlCalendar, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
U_CFUNC PHP_FUNCTION(intlcal_create_instance)
@@ -54,34 +54,34 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance)
size_t dummy;
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zs!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|zs!",
&zv_timezone, &locale_str, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_create_calendar: bad arguments", 0 TSRMLS_CC);
+ "intlcal_create_calendar: bad arguments", 0);
RETURN_NULL();
}
timeZone = timezone_process_timezone_argument(zv_timezone, NULL,
- "intlcal_create_instance" TSRMLS_CC);
+ "intlcal_create_instance");
if (timeZone == NULL) {
RETURN_NULL();
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
Calendar *cal = Calendar::createInstance(timeZone,
Locale::createFromName(locale_str), status);
if (cal == NULL) {
delete timeZone;
- intl_error_set(NULL, status, "Error creating ICU Calendar object", 0 TSRMLS_CC);
+ intl_error_set(NULL, status, "Error creating ICU Calendar object", 0);
RETURN_NULL();
}
- calendar_object_create(return_value, cal TSRMLS_CC);
+ calendar_object_create(return_value, cal);
}
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42
@@ -146,12 +146,12 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
size_t key_len,
locale_len;
zend_bool commonly_used;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssb",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb",
&key, &key_len, &locale, &locale_len, &commonly_used) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_keyword_values_for_locale: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_keyword_values_for_locale: bad arguments", 0);
RETURN_FALSE;
}
@@ -162,7 +162,7 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
status);
if (se == NULL) {
intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: "
- "error calling underlying method", 0 TSRMLS_CC);
+ "error calling underlying method", 0);
RETURN_FALSE;
}
#else
@@ -171,24 +171,24 @@ U_CFUNC PHP_FUNCTION(intlcal_get_keyword_values_for_locale)
if (U_FAILURE(status)) {
uenum_close(uenum);
intl_error_set(NULL, status, "intlcal_get_keyword_values_for_locale: "
- "error calling underlying method", 0 TSRMLS_CC);
+ "error calling underlying method", 0);
RETURN_FALSE;
}
StringEnumeration *se = new BugStringCharEnumeration(uenum);
#endif
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
}
#endif //ICU 4.2 only
U_CFUNC PHP_FUNCTION(intlcal_get_now)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_now: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_now: bad arguments", 0);
RETURN_FALSE;
}
@@ -197,11 +197,11 @@ U_CFUNC PHP_FUNCTION(intlcal_get_now)
U_CFUNC PHP_FUNCTION(intlcal_get_available_locales)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_available_locales: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_available_locales: bad arguments", 0);
RETURN_FALSE;
}
@@ -223,17 +223,17 @@ static void _php_intlcal_field_uec_ret_in32t_method(
char *message;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
spprintf(&message, 0, "%s: bad arguments", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
spprintf(&message, 0, "%s: invalid field", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
@@ -257,10 +257,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -278,10 +278,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time)
double time_arg;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Od",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Od",
&object, Calendar_ce_ptr, &time_arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -299,21 +299,21 @@ U_CFUNC PHP_FUNCTION(intlcal_add)
amount;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &amount) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: bad arguments", 0 TSRMLS_CC);
+ "intlcal_add: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: invalid field", 0 TSRMLS_CC);
+ "intlcal_add: invalid field", 0);
RETURN_FALSE;
}
if (amount < INT32_MIN || amount > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_add: amount out of bounds", 0 TSRMLS_CC);
+ "intlcal_add: amount out of bounds", 0);
RETURN_FALSE;
}
@@ -331,10 +331,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
TimeZone *timeZone;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oz!", &object, Calendar_ce_ptr, &zv_timezone) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_time_zone: bad arguments", 0);
RETURN_FALSE;
}
@@ -345,7 +345,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
}
timeZone = timezone_process_timezone_argument(zv_timezone,
- CALENDAR_ERROR_P(co), "intlcal_set_time_zone" TSRMLS_CC);
+ CALENDAR_ERROR_P(co), "intlcal_set_time_zone");
if (timeZone == NULL) {
RETURN_FALSE;
}
@@ -364,11 +364,11 @@ static void _php_intlcal_before_after(
Calendar_object *when_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &when_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_before/after: bad arguments", 0 TSRMLS_CC);
+ "intlcal_before/after: bad arguments", 0);
RETURN_FALSE;
}
@@ -377,7 +377,7 @@ static void _php_intlcal_before_after(
when_co = Z_INTL_CALENDAR_P(when_object);
if (when_co->ucal == NULL) {
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_before/after: Other IntlCalendar was unconstructed", 0 TSRMLS_CC);
+ "intlcal_before/after: Other IntlCalendar was unconstructed", 0);
RETURN_FALSE;
}
@@ -410,7 +410,7 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
if (ZEND_NUM_ARGS() > (getThis() ? 6 : 7) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: too many arguments", 0 TSRMLS_CC);
+ "intlcal_set: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
@@ -422,11 +422,11 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
}
if (variant == 4 ||
- zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll|llll", &object, Calendar_ce_ptr, &arg1, &arg2, &arg3, &arg4,
&arg5, &arg6) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set: bad arguments", 0);
RETURN_FALSE;
}
@@ -434,14 +434,14 @@ U_CFUNC PHP_FUNCTION(intlcal_set)
if (Z_LVAL(args[i]) < INT32_MIN || Z_LVAL(args[i]) > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set: at least one of the arguments has an absolute "
- "value that is too large", 0 TSRMLS_CC);
+ "value that is too large", 0);
RETURN_FALSE;
}
}
if (variant == 2 && (arg1 < 0 || arg1 >= UCAL_FIELD_COUNT)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: invalid field", 0 TSRMLS_CC);
+ "intlcal_set: invalid field", 0);
RETURN_FALSE;
}
@@ -472,37 +472,37 @@ U_CFUNC PHP_FUNCTION(intlcal_roll)
if (ZEND_NUM_ARGS() > (getThis() ? 2 :3) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: too many arguments", 0 TSRMLS_CC);
+ "intlcal_set: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
args++;
}
if (!Z_ISUNDEF(args[1]) && (Z_TYPE(args[1]) == IS_TRUE || Z_TYPE(args[1]) == IS_FALSE)) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Olb", &object, Calendar_ce_ptr, &field, &bool_variant_val)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: bad arguments", 0 TSRMLS_CC);
+ "intlcal_roll: bad arguments", 0);
RETURN_FALSE;
}
bool_variant_val = Z_TYPE(args[1]) == IS_TRUE? 1 : 0;
- } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oll", &object, Calendar_ce_ptr, &field, &value) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: bad arguments", 0 TSRMLS_CC);
+ "intlcal_roll: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: invalid field", 0 TSRMLS_CC);
+ "intlcal_roll: invalid field", 0);
RETURN_FALSE;
}
if (bool_variant_val == (zend_bool)-1 &&
(value < INT32_MIN || value > INT32_MAX)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_roll: value out of bounds", 0 TSRMLS_CC);
+ "intlcal_roll: value out of bounds", 0);
RETURN_FALSE;
}
@@ -531,7 +531,7 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
if (ZEND_NUM_ARGS() > (getThis() ? 1 : 2) ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: too many arguments", 0 TSRMLS_CC);
+ "intlcal_clear: too many arguments", 0);
RETURN_FALSE;
}
if (!getThis()) {
@@ -539,21 +539,21 @@ U_CFUNC PHP_FUNCTION(intlcal_clear)
}
if (Z_ISUNDEF(args[0]) || Z_TYPE(args[0]) == IS_NULL) {
zval *dummy; /* we know it's null */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(),
getThis(), "O|z", &object, Calendar_ce_ptr, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: bad arguments", 0 TSRMLS_CC);
+ "intlcal_clear: bad arguments", 0);
RETURN_FALSE;
}
variant = 0;
- } else if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ } else if (zend_parse_method_parameters(ZEND_NUM_ARGS(),
getThis(), "Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: bad arguments", 0 TSRMLS_CC);
+ "intlcal_clear: bad arguments", 0);
RETURN_FALSE;
} else if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_clear: invalid field", 0 TSRMLS_CC);
+ "intlcal_clear: invalid field", 0);
RETURN_FALSE;
} else {
variant = 1;
@@ -576,16 +576,16 @@ U_CFUNC PHP_FUNCTION(intlcal_field_difference)
double when;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Odl", &object, Calendar_ce_ptr, &when, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_field_difference: bad arguments", 0 TSRMLS_CC);
+ "intlcal_field_difference: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_field_difference: invalid field", 0 TSRMLS_CC);
+ "intlcal_field_difference: invalid field", 0);
RETURN_FALSE;
}
@@ -617,16 +617,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_day_of_week_type)
zend_ulong dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_day_of_week_type: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_day_of_week_type: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_day_of_week_type: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_get_day_of_week_type: invalid day of week", 0);
RETURN_FALSE;
}
@@ -645,10 +645,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_first_day_of_week)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_first_day_of_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_first_day_of_week: bad arguments", 0);
RETURN_FALSE;
}
@@ -670,17 +670,17 @@ static void _php_intlcal_field_ret_in32t_method(
char *message;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
spprintf(&message, 0, "%s: bad arguments", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
spprintf(&message, 0, "%s: invalid field", method_name);
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
RETURN_FALSE;
}
@@ -710,16 +710,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_locale)
zend_long locale_type;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_locale: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_locale: bad arguments", 0);
RETURN_FALSE;
}
if (locale_type != ULOC_ACTUAL_LOCALE && locale_type != ULOC_VALID_LOCALE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_locale: invalid locale type", 0 TSRMLS_CC);
+ "intlcal_get_locale: invalid locale type", 0);
RETURN_FALSE;
}
@@ -743,10 +743,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_minimal_days_in_first_week)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_minimal_days_in_first_week: bad arguments", 0);
RETURN_FALSE;
}
@@ -769,10 +769,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_time_zone: bad arguments", 0);
RETURN_FALSE;
}
@@ -781,21 +781,21 @@ U_CFUNC PHP_FUNCTION(intlcal_get_time_zone)
TimeZone *tz = co->ucal->getTimeZone().clone();
if (tz == NULL) {
intl_errors_set(CALENDAR_ERROR_P(co), U_MEMORY_ALLOCATION_ERROR,
- "intlcal_get_time_zone: could not clone TimeZone", 0 TSRMLS_CC);
+ "intlcal_get_time_zone: could not clone TimeZone", 0);
RETURN_FALSE;
}
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intlcal_get_type)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_type: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_type: bad arguments", 0);
RETURN_FALSE;
}
@@ -810,16 +810,16 @@ U_CFUNC PHP_FUNCTION(intlcal_get_weekend_transition)
zend_long dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_weekend_transition: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_weekend_transition: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_weekend_transition: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_get_weekend_transition: invalid day of week", 0);
RETURN_FALSE;
}
@@ -838,10 +838,10 @@ U_CFUNC PHP_FUNCTION(intlcal_in_daylight_time)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_in_daylight_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_in_daylight_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -860,18 +860,18 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to)
Calendar_object *other_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_equivalent_to: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_equivalent_to: bad arguments", 0);
RETURN_FALSE;
}
other_co = Z_INTL_CALENDAR_P(other_object);
if (other_co->ucal == NULL) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intlcal_is_equivalent_to:"
- " Other IntlCalendar is unconstructed", 0 TSRMLS_CC);
+ " Other IntlCalendar is unconstructed", 0);
RETURN_FALSE;
}
@@ -884,10 +884,10 @@ U_CFUNC PHP_FUNCTION(intlcal_is_lenient)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_lenient: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_lenient: bad arguments", 0);
RETURN_FALSE;
}
@@ -901,16 +901,16 @@ U_CFUNC PHP_FUNCTION(intlcal_is_set)
zend_long field;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_set: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_set: bad arguments", 0);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_set: invalid field", 0 TSRMLS_CC);
+ "intlcal_is_set: invalid field", 0);
RETURN_FALSE;
}
@@ -927,13 +927,13 @@ U_CFUNC PHP_FUNCTION(intlcal_is_weekend)
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ ZEND_NUM_ARGS(), getThis(),
"O|z!", &object, Calendar_ce_ptr, &rawDate) == FAILURE
|| (rawDate != NULL &&
- zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|d", &object, Calendar_ce_ptr, &date) == FAILURE)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_is_weekend: bad arguments", 0 TSRMLS_CC);
+ "intlcal_is_weekend: bad arguments", 0);
RETURN_FALSE;
}
@@ -956,16 +956,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_first_day_of_week)
zend_long dow;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &dow) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_first_day_of_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_first_day_of_week: bad arguments", 0);
RETURN_FALSE;
}
if (dow < UCAL_SUNDAY || dow > UCAL_SATURDAY) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_first_day_of_week: invalid day of week", 0 TSRMLS_CC);
+ "intlcal_set_first_day_of_week: invalid day of week", 0);
RETURN_FALSE;
}
@@ -981,10 +981,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_lenient)
zend_bool is_lenient;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ob", &object, Calendar_ce_ptr, &is_lenient) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_lenient: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_lenient: bad arguments", 0);
RETURN_FALSE;
}
@@ -1000,17 +1000,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_minimal_days_in_first_week)
zend_long num_days;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &num_days) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_minimal_days_in_first_week: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_minimal_days_in_first_week: bad arguments", 0);
RETURN_FALSE;
}
if (num_days < 1 || num_days > 7) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_set_minimal_days_in_first_week: invalid number of days; "
- "must be between 1 and 7", 0 TSRMLS_CC);
+ "must be between 1 and 7", 0);
RETURN_FALSE;
}
@@ -1027,11 +1027,11 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
Calendar_object *other_co;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, Calendar_ce_ptr, &other_object, Calendar_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_equals: bad arguments", 0 TSRMLS_CC);
+ "intlcal_equals: bad arguments", 0);
RETURN_FALSE;
}
@@ -1039,7 +1039,7 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
other_co = Z_INTL_CALENDAR_P(other_object);
if (other_co->ucal == NULL) {
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_equals: The second IntlCalendar is unconstructed", 0 TSRMLS_CC);
+ "intlcal_equals: The second IntlCalendar is unconstructed", 0);
RETURN_FALSE;
}
@@ -1055,10 +1055,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_repeated_wall_time_option)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_repeated_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
@@ -1071,10 +1071,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_skipped_wall_time_option)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_skipped_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
@@ -1088,16 +1088,16 @@ U_CFUNC PHP_FUNCTION(intlcal_set_repeated_wall_time_option)
zend_long option;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_repeated_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_repeated_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_repeated_wall_time_option: invalid option", 0 TSRMLS_CC);
+ "intlcal_set_repeated_wall_time_option: invalid option", 0);
RETURN_FALSE;
}
@@ -1113,17 +1113,17 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option)
zend_long option;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, Calendar_ce_ptr, &option) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_skipped_wall_time_option: bad arguments", 0 TSRMLS_CC);
+ "intlcal_set_skipped_wall_time_option: bad arguments", 0);
RETURN_FALSE;
}
if (option != UCAL_WALLTIME_FIRST && option != UCAL_WALLTIME_LAST
&& option != UCAL_WALLTIME_NEXT_VALID) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set_skipped_wall_time_option: invalid option", 0 TSRMLS_CC);
+ "intlcal_set_skipped_wall_time_option: invalid option", 0);
RETURN_FALSE;
}
@@ -1148,21 +1148,21 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
TimeZone *timeZone;
UErrorCode status = U_ZERO_ERROR;
Calendar *cal;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s!",
&zv_arg, &locale_str, &locale_str_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_from_date_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_from_date_time: bad arguments", 0);
RETURN_NULL();
}
if (!(Z_TYPE_P(zv_arg) == IS_OBJECT && instanceof_function(
- Z_OBJCE_P(zv_arg), php_date_get_date_ce() TSRMLS_CC))) {
+ Z_OBJCE_P(zv_arg), php_date_get_date_ce()))) {
object_init_ex(&zv_tmp, php_date_get_date_ce());
zend_call_method_with_1_params(&zv_tmp, NULL, NULL, "__construct", NULL, zv_arg);
if (EG(exception)) {
- zend_object_store_ctor_failed(Z_OBJ(zv_tmp) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(zv_tmp));
goto error;
}
zv_datetime = &zv_tmp;
@@ -1174,7 +1174,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (!datetime->time) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: DateTime object is unconstructed",
- 0 TSRMLS_CC);
+ 0);
goto error;
}
@@ -1182,7 +1182,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (Z_TYPE(zv_timestamp) != IS_LONG) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_from_date_time: bad DateTime; call to "
- "DateTime::getTimestamp() failed", 0 TSRMLS_CC);
+ "DateTime::getTimestamp() failed", 0);
zval_ptr_dtor(&zv_timestamp);
goto error;
}
@@ -1191,14 +1191,14 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
timeZone = TimeZone::getGMT()->clone();
} else {
timeZone = timezone_convert_datetimezone(datetime->time->zone_type,
- datetime, 1, NULL, "intlcal_from_date_time" TSRMLS_CC);
+ datetime, 1, NULL, "intlcal_from_date_time");
if (timeZone == NULL) {
goto error;
}
}
if (!locale_str) {
- locale_str = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
+ locale_str = const_cast<char*>(intl_locale_get_default());
}
cal = Calendar::createInstance(timeZone,
@@ -1206,7 +1206,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
if (cal == NULL) {
delete timeZone;
intl_error_set(NULL, status, "intlcal_from_date_time: "
- "error creating ICU Calendar object", 0 TSRMLS_CC);
+ "error creating ICU Calendar object", 0);
goto error;
}
cal->setTime(((UDate)Z_LVAL(zv_timestamp)) * 1000., status);
@@ -1214,11 +1214,11 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
/* time zone was adopted by cal; should not be deleted here */
delete cal;
intl_error_set(NULL, status, "intlcal_from_date_time: "
- "error creating ICU Calendar::setTime()", 0 TSRMLS_CC);
+ "error creating ICU Calendar::setTime()", 0);
goto error;
}
- calendar_object_create(return_value, cal TSRMLS_CC);
+ calendar_object_create(return_value, cal);
error:
if (zv_datetime && zv_datetime != zv_arg) {
@@ -1231,10 +1231,10 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
zval retval;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_to_date_time: bad arguments", 0 TSRMLS_CC);
+ "intlcal_to_date_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -1253,7 +1253,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (date > (double)U_INT64_MAX || date < (double)U_INT64_MIN) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: The calendar date is out of the "
- "range for a 64-bit integer", 0 TSRMLS_CC);
+ "range for a 64-bit integer", 0);
RETURN_FALSE;
}
@@ -1266,7 +1266,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
/* Now get the time zone */
const TimeZone& tz = co->ucal->getTimeZone();
zval *timezone_zval = timezone_convert_to_datetimezone(
- &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp TSRMLS_CC);
+ &tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time", &tmp);
if (timezone_zval == NULL) {
RETURN_FALSE;
}
@@ -1279,8 +1279,8 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (EG(exception)) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: DateTime constructor has thrown exception",
- 1 TSRMLS_CC);
- zend_object_store_ctor_failed(Z_OBJ_P(return_value) TSRMLS_CC);
+ 1);
+ zend_object_store_ctor_failed(Z_OBJ_P(return_value));
zval_ptr_dtor(return_value);
zval_ptr_dtor(&ts_zval);
@@ -1295,7 +1295,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
if (Z_ISUNDEF(retval) || Z_TYPE(retval) == IS_FALSE) {
intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_to_date_time: call to DateTime::setTimeZone has failed",
- 1 TSRMLS_CC);
+ 1);
zval_ptr_dtor(return_value);
RETVAL_FALSE;
goto error;
@@ -1310,10 +1310,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_code)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "intlcal_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -1330,10 +1330,10 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message)
zend_string* message = NULL;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, Calendar_ce_ptr) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "intlcal_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -1344,6 +1344,6 @@ U_CFUNC PHP_FUNCTION(intlcal_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(CALENDAR_ERROR_P(co) TSRMLS_CC);
+ message = intl_error_get_message(CALENDAR_ERROR_P(co));
RETURN_STR(message);
}
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index b0c8a964f6..8484f09629 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -46,13 +46,13 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
zend_long largs[6];
UErrorCode status = U_ZERO_ERROR;
int variant;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
// parameter number validation / variant determination
if (ZEND_NUM_ARGS() > 6 ||
zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: too many arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: too many arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -62,26 +62,26 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (variant == 4) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: no variant with 4 arguments "
- "(excluding trailing NULLs)", 0 TSRMLS_CC);
+ "(excluding trailing NULLs)", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
// argument parsing
if (variant <= 2) {
- if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2) TSRMLS_CC,
+ if (zend_parse_parameters(MIN(ZEND_NUM_ARGS(), 2),
"|z!s!", &tz_object, &locale, &locale_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
}
- if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (variant > 2 && zend_parse_parameters(ZEND_NUM_ARGS(),
"lll|lll", &largs[0], &largs[1], &largs[2], &largs[3], &largs[4],
&largs[5]) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_create_instance: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_create_instance: bad arguments", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -92,20 +92,20 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (variant <= 2) {
// From timezone and locale (0 to 2 arguments)
TimeZone *tz = timezone_process_timezone_argument(tz_object, NULL,
- "intlgregcal_create_instance" TSRMLS_CC);
+ "intlgregcal_create_instance");
if (tz == NULL) {
Z_OBJ_P(return_value) = NULL;
return;
}
if (!locale) {
- locale = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
+ locale = const_cast<char*>(intl_locale_get_default());
}
gcal = new GregorianCalendar(tz, Locale::createFromName(locale),
status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "intlgregcal_create_instance: error "
- "creating ICU GregorianCalendar from time zone and locale", 0 TSRMLS_CC);
+ "creating ICU GregorianCalendar from time zone and locale", 0);
if (gcal) {
delete gcal;
}
@@ -119,7 +119,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
if (largs[i] < INT32_MIN || largs[i] > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: at least one of the arguments"
- " has an absolute value that is too large", 0 TSRMLS_CC);
+ " has an absolute value that is too large", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -138,7 +138,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
}
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "intlgregcal_create_instance: error "
- "creating ICU GregorianCalendar from date", 0 TSRMLS_CC);
+ "creating ICU GregorianCalendar from date", 0);
if (gcal) {
delete gcal;
}
@@ -146,7 +146,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
return;
}
- timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C);
+ timelib_tzinfo *tzinfo = get_timezone_info();
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 42
UnicodeString tzstr = UnicodeString::fromUTF8(StringPiece(tzinfo->name));
#else
@@ -157,7 +157,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_create_instance: could not create UTF-8 string "
"from PHP's default timezone name (see date_default_timezone_get())",
- 0 TSRMLS_CC);
+ 0);
delete gcal;
Z_OBJ_P(return_value) = NULL;
return;
@@ -174,7 +174,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
U_CFUNC PHP_FUNCTION(intlgregcal_create_instance)
{
zval orig;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
object_init_ex(return_value, GregorianCalendar_ce_ptr);
ZVAL_COPY_VALUE(&orig, return_value);
@@ -190,14 +190,14 @@ U_CFUNC PHP_FUNCTION(intlgregcal_create_instance)
U_CFUNC PHP_METHOD(IntlGregorianCalendar, __construct)
{
zval orig_this = *getThis();
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
return_value = getThis();
//changes this to IS_NULL (without first destroying) if there's an error
_php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -208,10 +208,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_set_gregorian_change)
double date;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Od", &object, GregorianCalendar_ce_ptr, &date) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_set_gregorian_change: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_set_gregorian_change: bad arguments", 0);
RETURN_FALSE;
}
@@ -228,10 +228,10 @@ U_CFUNC PHP_FUNCTION(intlgregcal_get_gregorian_change)
{
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, GregorianCalendar_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_get_gregorian_change: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_get_gregorian_change: bad arguments", 0);
RETURN_FALSE;
}
@@ -245,16 +245,16 @@ U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year)
zend_long year;
CALENDAR_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_is_leap_year: bad arguments", 0 TSRMLS_CC);
+ "intlgregcal_is_leap_year: bad arguments", 0);
RETURN_FALSE;
}
if (year < INT32_MIN || year > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlgregcal_is_leap_year: year out of bounds", 0 TSRMLS_CC);
+ "intlgregcal_is_leap_year: year out of bounds", 0);
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator.c b/ext/intl/collator/collator.c
index 07dc6385c8..d86139c9e0 100644
--- a/ext/intl/collator/collator.c
+++ b/ext/intl/collator/collator.c
@@ -39,8 +39,8 @@ void collator_register_constants( INIT_FUNC_ARGS )
}
#define COLLATOR_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x TSRMLS_CC );
- #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define COLLATOR_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( #x ) - 1, UCOL_##x );
+ #define COLLATOR_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Collator_ce_ptr, ZEND_STRS( name ) - 1, value );
/* UColAttributeValue constants */
COLLATOR_EXPOSE_CUSTOM_CLASS_CONST( "DEFAULT_VALUE", UCOL_DEFAULT );
diff --git a/ext/intl/collator/collator_attr.c b/ext/intl/collator/collator_attr.c
index 8d879de8f7..7063db3562 100644
--- a/ext/intl/collator/collator_attr.c
+++ b/ext/intl/collator/collator_attr.c
@@ -38,11 +38,11 @@ PHP_FUNCTION( collator_get_attribute )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -69,11 +69,11 @@ PHP_FUNCTION( collator_set_attribute )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oll",
&object, Collator_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -99,11 +99,11 @@ PHP_FUNCTION( collator_get_strength )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -128,11 +128,11 @@ PHP_FUNCTION( collator_set_strength )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &strength ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_set_strength: unable to parse input params", 0 TSRMLS_CC );
+ "collator_set_strength: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index fd3f08e359..5632dc0f76 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -36,31 +36,31 @@ static zend_object_handlers Collator_handlers;
*/
/* {{{ Collator_objects_dtor */
-static void Collator_objects_dtor(zend_object *object TSRMLS_DC )
+static void Collator_objects_dtor(zend_object *object )
{
- zend_objects_destroy_object(object TSRMLS_CC );
+ zend_objects_destroy_object(object );
}
/* }}} */
/* {{{ Collator_objects_free */
-void Collator_objects_free(zend_object *object TSRMLS_DC )
+void Collator_objects_free(zend_object *object )
{
Collator_object* co = php_intl_collator_fetch_object(object);
- zend_object_std_dtor(&co->zo TSRMLS_CC );
+ zend_object_std_dtor(&co->zo );
- collator_object_destroy(co TSRMLS_CC );
+ collator_object_destroy(co );
}
/* }}} */
/* {{{ Collator_object_create */
-zend_object *Collator_object_create(zend_class_entry *ce TSRMLS_DC )
+zend_object *Collator_object_create(zend_class_entry *ce )
{
Collator_object* intern;
intern = ecalloc(1, sizeof(Collator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- intl_error_init(COLLATOR_ERROR_P(intern) TSRMLS_CC);
- zend_object_std_init(&intern->zo, ce TSRMLS_CC );
+ intl_error_init(COLLATOR_ERROR_P(intern));
+ zend_object_std_init(&intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &Collator_handlers;
@@ -123,14 +123,14 @@ zend_function_entry Collator_class_functions[] = {
/* {{{ collator_register_Collator_class
* Initialize 'Collator' class
*/
-void collator_register_Collator_class( TSRMLS_D )
+void collator_register_Collator_class( void )
{
zend_class_entry ce;
/* Create and register 'Collator' class. */
INIT_CLASS_ENTRY( ce, "Collator", Collator_class_functions );
ce.create_object = Collator_object_create;
- Collator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Collator_ce_ptr = zend_register_internal_class( &ce );
memcpy(&Collator_handlers, zend_get_std_object_handlers(),
sizeof Collator_handlers);
@@ -156,19 +156,19 @@ void collator_register_Collator_class( TSRMLS_D )
* Initialize internals of Collator_object.
* Must be called before any other call to 'collator_object_...' functions.
*/
-void collator_object_init( Collator_object* co TSRMLS_DC )
+void collator_object_init( Collator_object* co )
{
if( !co )
return;
- intl_error_init( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_init( COLLATOR_ERROR_P( co ) );
}
/* }}} */
/* {{{ void collator_object_destroy( Collator_object* co )
* Clean up mem allocted by internals of Collator_object
*/
-void collator_object_destroy( Collator_object* co TSRMLS_DC )
+void collator_object_destroy( Collator_object* co )
{
if( !co )
return;
@@ -179,7 +179,7 @@ void collator_object_destroy( Collator_object* co TSRMLS_DC )
co->ucoll = NULL;
}
- intl_error_reset( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ intl_error_reset( COLLATOR_ERROR_P( co ) );
}
/* }}} */
diff --git a/ext/intl/collator/collator_class.h b/ext/intl/collator/collator_class.h
index f9d2cedf88..4ee8aba749 100644
--- a/ext/intl/collator/collator_class.h
+++ b/ext/intl/collator/collator_class.h
@@ -48,9 +48,9 @@ static inline Collator_object *php_intl_collator_fetch_object(zend_object *obj)
}
#define Z_INTL_COLLATOR_P(zv) php_intl_collator_fetch_object(Z_OBJ_P(zv))
-void collator_register_Collator_class( TSRMLS_D );
-void collator_object_init( Collator_object* co TSRMLS_DC );
-void collator_object_destroy( Collator_object* co TSRMLS_DC );
+void collator_register_Collator_class( void );
+void collator_object_init( Collator_object* co );
+void collator_object_destroy( Collator_object* co );
extern zend_class_entry *Collator_ce_ptr;
@@ -59,16 +59,16 @@ extern zend_class_entry *Collator_ce_ptr;
#define COLLATOR_METHOD_INIT_VARS \
zval* object = NULL; \
Collator_object* co = NULL; \
- intl_error_reset( NULL TSRMLS_CC ); \
+ intl_error_reset( NULL ); \
#define COLLATOR_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(INTL_COLLATOR, co)
// Macro to check return value of a ucol_* function call.
#define COLLATOR_CHECK_STATUS( co, msg ) \
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC ); \
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) ); \
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) ) \
{ \
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), msg, 0 ); \
RETURN_FALSE; \
} \
diff --git a/ext/intl/collator/collator_compare.c b/ext/intl/collator/collator_compare.c
index d27ff32ebd..a7bc7f6383 100644
--- a/ext/intl/collator/collator_compare.c
+++ b/ext/intl/collator/collator_compare.c
@@ -46,11 +46,11 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oss",
&object, Collator_ce_ptr, &str1, &str1_len, &str2, &str2_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_compare: unable to parse input params", 0 TSRMLS_CC );
+ "collator_compare: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -59,10 +59,10 @@ PHP_FUNCTION( collator_compare )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -77,11 +77,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
@@ -93,11 +93,11 @@ PHP_FUNCTION( collator_compare )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting second argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting second argument to UTF-16", 0 );
if (ustr1) {
efree( ustr1 );
}
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index 607add2fcf..8ff63a902e 100644
--- a/ext/intl/collator/collator_convert.c
+++ b/ext/intl/collator/collator_convert.c
@@ -225,7 +225,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv )
/* {{{ collator_convert_object_to_string
* Convert object to UTF16-encoded string.
*/
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
+zval* collator_convert_object_to_string( zval* obj, zval *rv )
{
zval* zstr = NULL;
UErrorCode status = U_ZERO_ERROR;
@@ -241,7 +241,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
/* Try object's handlers. */
if( Z_OBJ_HT_P(obj)->get )
{
- zstr = Z_OBJ_HT_P(obj)->get( obj, rv TSRMLS_CC );
+ zstr = Z_OBJ_HT_P(obj)->get( obj, rv );
switch( Z_TYPE_P( zstr ) )
{
@@ -265,7 +265,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC )
{
zstr = rv;
- if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE TSRMLS_CC ) == FAILURE )
+ if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE ) == FAILURE )
{
/* cast_object failed => bail out. */
zval_ptr_dtor( zstr );
@@ -400,9 +400,8 @@ zval* collator_make_printable_zval( zval* arg, zval *rv)
if( Z_TYPE_P(arg) != IS_STRING )
{
- TSRMLS_FETCH();
-
- use_copy = zend_make_printable_zval(arg, &arg_copy TSRMLS_CC);
+
+ use_copy = zend_make_printable_zval(arg, &arg_copy);
if( use_copy )
{
diff --git a/ext/intl/collator/collator_convert.h b/ext/intl/collator/collator_convert.h
index bf116bdfd8..4cfc8b56ce 100644
--- a/ext/intl/collator/collator_convert.h
+++ b/ext/intl/collator/collator_convert.h
@@ -28,7 +28,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv );
zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv );
zval* collator_normalize_sort_argument( zval* arg, zval *rv );
-zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC );
+zval* collator_convert_object_to_string( zval* obj, zval *rv );
zval* collator_convert_string_to_number( zval* arg, zval *rv );
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv );
zval* collator_convert_string_to_double( zval* str, zval *rv );
diff --git a/ext/intl/collator/collator_create.c b/ext/intl/collator/collator_create.c
index 3c59f218e6..3945fb78b3 100644
--- a/ext/intl/collator/collator_create.c
+++ b/ext/intl/collator/collator_create.c
@@ -32,14 +32,14 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval* object;
Collator_object* co;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&locale, &locale_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_create: unable to parse input params", 0 TSRMLS_CC );
+ "collator_create: unable to parse input params", 0 );
zval_dtor(return_value);
RETURN_NULL();
}
@@ -48,7 +48,7 @@ static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
COLLATOR_METHOD_FETCH_OBJECT;
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
/* Open ICU collator. */
@@ -78,7 +78,7 @@ PHP_METHOD( Collator, __construct )
collator_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
diff --git a/ext/intl/collator/collator_error.c b/ext/intl/collator/collator_error.c
index fb8886ef64..5d30b8c655 100644
--- a/ext/intl/collator/collator_error.c
+++ b/ext/intl/collator/collator_error.c
@@ -33,11 +33,11 @@ PHP_FUNCTION( collator_get_error_code )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -64,11 +64,11 @@ PHP_FUNCTION( collator_get_error_message )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Collator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -79,7 +79,7 @@ PHP_FUNCTION( collator_get_error_message )
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message( COLLATOR_ERROR_P( co ) TSRMLS_CC );
+ message = intl_error_get_message( COLLATOR_ERROR_P( co ) );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/collator/collator_locale.c b/ext/intl/collator/collator_locale.c
index 76f154bb7c..8e0b32650a 100644
--- a/ext/intl/collator/collator_locale.c
+++ b/ext/intl/collator/collator_locale.c
@@ -39,11 +39,11 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, Collator_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -52,10 +52,10 @@ PHP_FUNCTION( collator_get_locale )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index 6f29c9b6de..d0d6b1a9d9 100644
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -50,7 +50,7 @@ static const size_t DEF_SORT_KEYS_INDX_BUF_INCREMENT = 1048576;
static const size_t DEF_UTF16_BUF_SIZE = 1024;
/* {{{ collator_regular_compare_function */
-static int collator_regular_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_regular_compare_function(zval *result, zval *op1, zval *op2)
{
Collator_object* co = NULL;
int rc = SUCCESS;
@@ -59,8 +59,8 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
zval norm1, norm2;
zval *num1_p = NULL, *num2_p = NULL;
zval *norm1_p = NULL, *norm2_p = NULL;
- zval* str1_p = collator_convert_object_to_string( op1, &str1 TSRMLS_CC );
- zval* str2_p = collator_convert_object_to_string( op2, &str2 TSRMLS_CC );
+ zval* str1_p = collator_convert_object_to_string( op1, &str1 );
+ zval* str2_p = collator_convert_object_to_string( op2, &str2 );
/* If both args are strings AND either of args is not numeric string
* then use ICU-compare. Otherwise PHP-compare. */
@@ -72,10 +72,10 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
co = Z_INTL_COLLATOR_P(&INTL_G(current_collator));
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
}
@@ -120,7 +120,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
norm2_p = collator_normalize_sort_argument( str2_p, &norm2 );
}
- rc = compare_function( result, norm1_p, norm2_p TSRMLS_CC );
+ rc = compare_function( result, norm1_p, norm2_p );
zval_ptr_dtor( norm1_p );
zval_ptr_dtor( norm2_p );
@@ -142,7 +142,7 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_numeric_compare_function
* Convert input args to double and compare it.
*/
-static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2)
{
int rc = SUCCESS;
zval num1, num2;
@@ -161,7 +161,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
op2 = num2_p;
}
- rc = numeric_compare_function( result, op1, op2 TSRMLS_CC);
+ rc = numeric_compare_function( result, op1, op2);
if( num1_p )
zval_ptr_dtor( num1_p );
@@ -175,7 +175,7 @@ static int collator_numeric_compare_function(zval *result, zval *op1, zval *op2
/* {{{ collator_icu_compare_function
* Direct use of ucol_strcoll.
*/
-static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
+static int collator_icu_compare_function(zval *result, zval *op1, zval *op2)
{
zval str1, str2;
int rc = SUCCESS;
@@ -205,7 +205,7 @@ static int collator_icu_compare_function(zval *result, zval *op1, zval *op2 TSRM
/* {{{ collator_compare_func
* Taken from PHP7 source (array_data_compare).
*/
-static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
+static int collator_compare_func( const void* a, const void* b )
{
Bucket *f;
Bucket *s;
@@ -219,7 +219,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
first = &f->val;
second = &s->val;
- if( INTL_G(compare_func)( &result, first, second TSRMLS_CC) == FAILURE )
+ if( INTL_G(compare_func)( &result, first, second) == FAILURE )
return 0;
if( Z_TYPE(result) == IS_DOUBLE )
@@ -246,7 +246,7 @@ static int collator_compare_func( const void* a, const void* b TSRMLS_DC )
/* {{{ collator_cmp_sort_keys
* Compare sort keys
*/
-static int collator_cmp_sort_keys( const void *p1, const void *p2 TSRMLS_DC )
+static int collator_cmp_sort_keys( const void *p1, const void *p2 )
{
char* key1 = ((collator_sort_key_index_t*)p1)->key;
char* key2 = ((collator_sort_key_index_t*)p2)->key;
@@ -295,11 +295,11 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa/|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa/|l",
&object, Collator_ce_ptr, &array, &sort_flags ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_internal: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_internal: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -321,7 +321,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS )
ZVAL_COPY_VALUE(&INTL_G( current_collator ), object);
/* Sort specified array. */
- zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber TSRMLS_CC );
+ zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber );
/* Restore saved collator. */
ZVAL_COPY_VALUE(&INTL_G( current_collator ), &saved_collator);
@@ -381,11 +381,11 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa",
&object, Collator_ce_ptr, &array ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_sort_with_sort_keys: unable to parse input params", 0 TSRMLS_CC );
+ "collator_sort_with_sort_keys: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -394,10 +394,10 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -428,8 +428,8 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
- intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
+ intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ), "Sort with sort keys failed", 0 );
if( utf16_buf )
efree( utf16_buf );
@@ -496,7 +496,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
sortKeyIndxBuf[j].key = sortKeyBuf + (ptrdiff_t)sortKeyIndxBuf[j].key;
/* sort it */
- zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys TSRMLS_CC );
+ zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys );
zval_ptr_dtor( array );
/* for resulting hash we'll assign new hash keys rather then reordering */
@@ -545,11 +545,11 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, Collator_ce_ptr, &str, &str_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "collator_get_sort_key: unable to parse input params", 0 TSRMLS_CC );
+ "collator_get_sort_key: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -558,10 +558,10 @@ PHP_FUNCTION( collator_get_sort_key )
COLLATOR_METHOD_FETCH_OBJECT;
if (!co || !co->ucoll) {
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Object not initialized", 0 TSRMLS_CC );
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Object not initialized");
+ "Object not initialized", 0 );
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Object not initialized");
RETURN_FALSE;
}
@@ -576,11 +576,11 @@ PHP_FUNCTION( collator_get_sort_key )
if( U_FAILURE( COLLATOR_ERROR_CODE( co ) ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) TSRMLS_CC );
+ intl_error_set_code( NULL, COLLATOR_ERROR_CODE( co ) );
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
- "Error converting first argument to UTF-16", 0 TSRMLS_CC );
+ "Error converting first argument to UTF-16", 0 );
efree( ustr );
RETURN_FALSE;
}
diff --git a/ext/intl/collator/collator_sort.h b/ext/intl/collator/collator_sort.h
index b5cb017a8c..ffaf86e664 100644
--- a/ext/intl/collator/collator_sort.h
+++ b/ext/intl/collator/collator_sort.h
@@ -20,7 +20,7 @@
#include <php.h>
-typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
+typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 );
PHP_FUNCTION( collator_sort );
PHP_FUNCTION( collator_sort_with_sort_keys );
diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp
index 23dc342080..326e8c01c9 100644
--- a/ext/intl/common/common_date.cpp
+++ b/ext/intl/common/common_date.cpp
@@ -39,7 +39,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
void *object,
int is_datetime,
intl_error *outside_error,
- const char *func TSRMLS_DC)
+ const char *func)
{
char *id = NULL,
offset_id[] = "GMT+00:00";
@@ -66,7 +66,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
spprintf(&message, 0, "%s: object has an time zone offset "
"that's too large", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return NULL;
}
@@ -97,7 +97,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
spprintf(&message, 0, "%s: time zone id '%s' "
"extracted from ext/date DateTimeZone not recognized", func, id);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
delete timeZone;
return NULL;
@@ -107,7 +107,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
/* }}} */
U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- intl_error *err, const char *func TSRMLS_DC)
+ intl_error *err, const char *func)
{
zval retval;
zval zfuncname;
@@ -126,12 +126,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
if (millis) {
ZVAL_STRING(&zfuncname, "getTimestamp");
- if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL TSRMLS_CC)
+ if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL)
!= SUCCESS || Z_TYPE(retval) != IS_LONG) {
spprintf(&message, 0, "%s: error calling ::getTimeStamp() on the "
"object", func);
intl_errors_set(err, U_INTERNAL_PROGRAM_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
zval_ptr_dtor(&zfuncname);
return FAILURE;
@@ -148,7 +148,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
spprintf(&message, 0, "%s: the DateTime object is not properly "
"initialized", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return FAILURE;
}
@@ -156,12 +156,12 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
*tz = TimeZone::getGMT()->clone();
} else {
*tz = timezone_convert_datetimezone(datetime->time->zone_type,
- datetime, 1, NULL, func TSRMLS_CC);
+ datetime, 1, NULL, func);
if (*tz == NULL) {
spprintf(&message, 0, "%s: could not convert DateTime's "
"time zone", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
return FAILURE;
}
@@ -171,7 +171,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
return SUCCESS;
}
-U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC)
+U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func)
{
double rv = NAN;
zend_long lv;
@@ -194,7 +194,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
"which would be required for it to be a valid date", func,
Z_STRVAL_P(z));
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
}
break;
@@ -205,15 +205,15 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
- intl_datetime_decompose(z, &rv, NULL, err, func TSRMLS_CC);
- } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce())) {
+ intl_datetime_decompose(z, &rv, NULL, err, func);
+ } else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr)) {
Calendar_object *co = Z_INTL_CALENDAR_P(z);
if (co->ucal == NULL) {
spprintf(&message, 0, "%s: IntlCalendar object is not properly "
"constructed", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
} else {
UErrorCode status = UErrorCode();
@@ -221,7 +221,7 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
if (U_FAILURE(status)) {
spprintf(&message, 0, "%s: call to internal "
"Calendar::getTime() has failed", func);
- intl_errors_set(err, status, message, 1 TSRMLS_CC);
+ intl_errors_set(err, status, message, 1);
efree(message);
}
}
@@ -230,14 +230,14 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TS
spprintf(&message, 0, "%s: invalid object type for date/time "
"(only IntlCalendar and DateTime permitted)", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
}
break;
default:
spprintf(&message, 0, "%s: invalid PHP type for date", func);
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
efree(message);
break;
}
diff --git a/ext/intl/common/common_date.h b/ext/intl/common/common_date.h
index e8ab66f40d..d6b7c20719 100644
--- a/ext/intl/common/common_date.h
+++ b/ext/intl/common/common_date.h
@@ -28,13 +28,13 @@ U_CDECL_END
#include <unicode/timezone.h>
-U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC);
+U_CFUNC TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func);
U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz,
- intl_error *err, const char *func TSRMLS_DC);
+ intl_error *err, const char *func);
#endif
-U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func TSRMLS_DC);
+U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func);
#endif /* COMMON_DATE_H */
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index 952b39edca..cea9dc71c5 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -33,7 +33,7 @@ extern "C" {
zend_class_entry *IntlIterator_ce_ptr;
zend_object_handlers IntlIterator_handlers;
-void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC)
+void zoi_with_current_dtor(zend_object_iterator *iter)
{
zoi_with_current *zoiwc = (zoi_with_current*)iter;
@@ -52,22 +52,22 @@ void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC)
* precedes the object free phase. Therefore there's no risk on this
* function being called by the iterator wrapper destructor function and
* not finding the memory of this iterator allocated anymore. */
- iter->funcs->invalidate_current(iter TSRMLS_CC);
- zoiwc->destroy_it(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
+ zoiwc->destroy_it(iter);
}
}
-U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter)
{
return Z_ISUNDEF(((zoi_with_current*)iter)->current)? FAILURE : SUCCESS;
}
-U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter)
{
return &((zoi_with_current*)iter)->current;
}
-U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC)
+U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
if (!Z_ISUNDEF(zoi_iter->current)) {
@@ -76,12 +76,12 @@ U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRM
}
}
-static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_current_move_forward(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
INTLITERATOR_METHOD_INIT_VARS;
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
object = &zoi_iter->wrapping_obj;
INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK;
@@ -90,22 +90,22 @@ static void string_enum_current_move_forward(zend_object_iterator *iter TSRMLS_D
const char *result = ((StringEnumeration*)Z_PTR(iter->data))->next(
&result_length, INTLITERATOR_ERROR_CODE(ii));
- intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC);
+ intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii));
if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) {
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii),
- "Error fetching next iteration element", 0 TSRMLS_CC);
+ "Error fetching next iteration element", 0);
} else if (result) {
ZVAL_STRINGL(&zoi_iter->current, result, result_length);
} //else we've reached the end of the enum, nothing more is required
}
-static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_rewind(zend_object_iterator *iter)
{
zoi_with_current *zoi_iter = (zoi_with_current*)iter;
INTLITERATOR_METHOD_INIT_VARS;
if (!Z_ISUNDEF(zoi_iter->current)) {
- iter->funcs->invalidate_current(iter TSRMLS_CC);
+ iter->funcs->invalidate_current(iter);
}
object = &zoi_iter->wrapping_obj;
@@ -113,16 +113,16 @@ static void string_enum_rewind(zend_object_iterator *iter TSRMLS_DC)
((StringEnumeration*)Z_PTR(iter->data))->reset(INTLITERATOR_ERROR_CODE(ii));
- intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii) TSRMLS_CC);
+ intl_error_set_code(NULL, INTLITERATOR_ERROR_CODE(ii));
if (U_FAILURE(INTLITERATOR_ERROR_CODE(ii))) {
intl_errors_set_custom_msg(INTL_DATA_ERROR_P(ii),
- "Error resetting enumeration", 0 TSRMLS_CC);
+ "Error resetting enumeration", 0);
} else {
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
}
}
-static void string_enum_destroy_it(zend_object_iterator *iter TSRMLS_DC)
+static void string_enum_destroy_it(zend_object_iterator *iter)
{
delete (StringEnumeration*)Z_PTR(iter->data);
}
@@ -137,13 +137,13 @@ static zend_object_iterator_funcs string_enum_object_iterator_funcs = {
zoi_with_current_invalidate_current
};
-U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC)
+U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object)
{
IntlIterator_object *ii;
object_init_ex(object, IntlIterator_ce_ptr);
ii = Z_INTL_ITERATOR_P(object);
ii->iterator = (zend_object_iterator*)emalloc(sizeof(zoi_with_current));
- zend_iterator_init(ii->iterator TSRMLS_CC);
+ zend_iterator_init(ii->iterator);
ZVAL_PTR(&ii->iterator->data, se);
ii->iterator->funcs = &string_enum_object_iterator_funcs;
ii->iterator->index = 0;
@@ -152,26 +152,26 @@ U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *ob
ZVAL_UNDEF(&((zoi_with_current*)ii->iterator)->current);
}
-static void IntlIterator_objects_free(zend_object *object TSRMLS_DC)
+static void IntlIterator_objects_free(zend_object *object)
{
IntlIterator_object *ii = php_intl_iterator_fetch_object(object);
if (ii->iterator) {
zval *wrapping_objp = &((zoi_with_current*)ii->iterator)->wrapping_obj;
ZVAL_UNDEF(wrapping_objp);
- zend_iterator_dtor(ii->iterator TSRMLS_CC);
+ zend_iterator_dtor(ii->iterator);
}
- intl_error_reset(INTLITERATOR_ERROR_P(ii) TSRMLS_CC);
+ intl_error_reset(INTLITERATOR_ERROR_P(ii));
- zend_object_std_dtor(&ii->zo TSRMLS_CC);
+ zend_object_std_dtor(&ii->zo);
}
static zend_object_iterator *IntlIterator_get_iterator(
- zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+ zend_class_entry *ce, zval *object, int by_ref)
{
if (by_ref) {
zend_throw_exception(NULL,
- "Iteration by reference is not supported", 0 TSRMLS_CC);
+ "Iteration by reference is not supported", 0);
return NULL;
}
@@ -179,7 +179,7 @@ static zend_object_iterator *IntlIterator_get_iterator(
if (ii->iterator == NULL) {
zend_throw_exception(NULL,
- "The IntlIterator is not properly constructed", 0 TSRMLS_CC);
+ "The IntlIterator is not properly constructed", 0);
return NULL;
}
@@ -188,15 +188,15 @@ static zend_object_iterator *IntlIterator_get_iterator(
return ii->iterator;
}
-static zend_object *IntlIterator_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *IntlIterator_object_create(zend_class_entry *ce)
{
IntlIterator_object *intern;
intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
- intl_error_init(INTLITERATOR_ERROR_P(intern) TSRMLS_CC);
+ intl_error_init(INTLITERATOR_ERROR_P(intern));
intern->iterator = NULL;
@@ -212,12 +212,12 @@ static PHP_METHOD(IntlIterator, current)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::current: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::current: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- data = ii->iterator->funcs->get_current_data(ii->iterator TSRMLS_CC);
+ data = ii->iterator->funcs->get_current_data(ii->iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -229,14 +229,14 @@ static PHP_METHOD(IntlIterator, key)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::key: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::key: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
if (ii->iterator->funcs->get_current_key) {
- ii->iterator->funcs->get_current_key(ii->iterator, return_value TSRMLS_CC);
+ ii->iterator->funcs->get_current_key(ii->iterator, return_value);
} else {
RETURN_LONG(ii->iterator->index);
}
@@ -248,12 +248,12 @@ static PHP_METHOD(IntlIterator, next)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::next: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::next: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- ii->iterator->funcs->move_forward(ii->iterator TSRMLS_CC);
+ ii->iterator->funcs->move_forward(ii->iterator);
/* foreach also advances the index after the last iteration,
* so I see no problem in incrementing the index here unconditionally */
ii->iterator->index++;
@@ -265,16 +265,16 @@ static PHP_METHOD(IntlIterator, rewind)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::rewind: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::rewind: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
if (ii->iterator->funcs->rewind) {
- ii->iterator->funcs->rewind(ii->iterator TSRMLS_CC);
+ ii->iterator->funcs->rewind(ii->iterator);
} else {
intl_errors_set(INTLITERATOR_ERROR_P(ii), U_UNSUPPORTED_ERROR,
- "IntlIterator::rewind: rewind not supported", 0 TSRMLS_CC);
+ "IntlIterator::rewind: rewind not supported", 0);
}
}
@@ -284,12 +284,12 @@ static PHP_METHOD(IntlIterator, valid)
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "IntlIterator::valid: bad arguments", 0 TSRMLS_CC);
+ "IntlIterator::valid: bad arguments", 0);
return;
}
INTLITERATOR_METHOD_FETCH_OBJECT;
- RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(ii->iterator->funcs->valid(ii->iterator) == SUCCESS);
}
ZEND_BEGIN_ARG_INFO_EX(ainfo_se_void, 0, 0, 0)
@@ -308,16 +308,16 @@ static zend_function_entry IntlIterator_class_functions[] = {
/* {{{ intl_register_IntlIterator_class
* Initialize 'IntlIterator' class
*/
-U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D)
+U_CFUNC void intl_register_IntlIterator_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlIterator' class. */
INIT_CLASS_ENTRY(ce, "IntlIterator", IntlIterator_class_functions);
ce.create_object = IntlIterator_object_create;
- IntlIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ IntlIterator_ce_ptr = zend_register_internal_class(&ce);
IntlIterator_ce_ptr->get_iterator = IntlIterator_get_iterator;
- zend_class_implements(IntlIterator_ce_ptr TSRMLS_CC, 1,
+ zend_class_implements(IntlIterator_ce_ptr, 1,
zend_ce_iterator);
memcpy(&IntlIterator_handlers, zend_get_std_object_handlers(),
diff --git a/ext/intl/common/common_enum.h b/ext/intl/common/common_enum.h
index af46a47751..b9b87c17e0 100644
--- a/ext/intl/common/common_enum.h
+++ b/ext/intl/common/common_enum.h
@@ -43,7 +43,7 @@ extern "C" {
object = getThis(); \
INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
if (ii->iterator == NULL) { \
- intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0 TSRMLS_CC); \
+ intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0); \
RETURN_FALSE; \
}
@@ -63,21 +63,21 @@ typedef struct {
zend_object_iterator zoi;
zval current;
zval wrapping_obj;
- void (*destroy_it)(zend_object_iterator *iterator TSRMLS_DC);
+ void (*destroy_it)(zend_object_iterator *iterator);
} zoi_with_current;
extern zend_class_entry *IntlIterator_ce_ptr;
extern zend_object_handlers IntlIterator_handlers;
-U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter TSRMLS_DC);
-U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter TSRMLS_DC);
+U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter);
+U_CFUNC int zoi_with_current_valid(zend_object_iterator *iter);
+U_CFUNC zval *zoi_with_current_get_current_data(zend_object_iterator *iter);
+U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter);
#ifdef __cplusplus
-U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object TSRMLS_DC);
+U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
#endif
-U_CFUNC void intl_register_IntlIterator_class(TSRMLS_D);
+U_CFUNC void intl_register_IntlIterator_class(void);
#endif // INTL_COMMON_ENUM_H
diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c
index 524bb94327..16933c587f 100644
--- a/ext/intl/common/common_error.c
+++ b/ext/intl/common/common_error.c
@@ -28,7 +28,7 @@
*/
PHP_FUNCTION( intl_get_error_code )
{
- RETURN_LONG( intl_error_get_code( NULL TSRMLS_CC ) );
+ RETURN_LONG( intl_error_get_code( NULL ) );
}
/* }}} */
@@ -37,7 +37,7 @@ PHP_FUNCTION( intl_get_error_code )
*/
PHP_FUNCTION( intl_get_error_message )
{
- RETURN_STR(intl_error_get_message( NULL TSRMLS_CC ));
+ RETURN_STR(intl_error_get_message( NULL ));
}
/* }}} */
@@ -51,11 +51,11 @@ PHP_FUNCTION( intl_is_failure )
zend_long err_code;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "l",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intl_is_failure: unable to parse input params", 0 TSRMLS_CC );
+ "intl_is_failure: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -73,11 +73,11 @@ PHP_FUNCTION( intl_error_name )
zend_long err_code;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "l",
&err_code ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intl_error_name: unable to parse input params", 0 TSRMLS_CC );
+ "intl_error_name: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index eb37ce00f1..f52d0490cc 100644
--- a/ext/intl/converter/converter.c
+++ b/ext/intl/converter/converter.c
@@ -41,11 +41,11 @@ static zend_class_entry *php_converter_ce;
static zend_object_handlers php_converter_object_handlers;
#define CONV_GET(pzv) (Z_INTL_CONVERTER_P((pzv)))
-#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error TSRMLS_CC, \
+#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error, \
fname "() returned error " ZEND_LONG_FMT ": %s", (zend_long)error, u_errorName(error))
/* {{{ php_converter_throw_failure */
-static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error TSRMLS_DC, const char *format, ...) {
+static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error, const char *format, ...) {
intl_error *err = objval ? &(objval->error) : NULL;
char message[1024];
va_list vargs;
@@ -54,12 +54,12 @@ static inline void php_converter_throw_failure(php_converter_object *objval, UEr
vsnprintf(message, sizeof(message), format, vargs);
va_end(vargs);
- intl_errors_set(err, error, message, 1 TSRMLS_CC);
+ intl_errors_set(err, error, message, 1);
}
/* }}} */
/* {{{ php_converter_default_callback */
-static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error TSRMLS_DC) {
+static void php_converter_default_callback(zval *return_value, zval *zobj, zend_long reason, zval *error) {
ZVAL_DEREF(error);
zval_dtor(error);
ZVAL_LONG(error, U_ZERO_ERROR);
@@ -74,7 +74,7 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
int8_t chars_len = sizeof(chars);
UErrorCode uerror = U_ZERO_ERROR;
if(!objval->src) {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
chars[0] = 0x1A;
chars[1] = 0;
chars_len = 1;
@@ -117,12 +117,12 @@ static PHP_METHOD(UConverter, toUCallback) {
zend_long reason;
zval *source, *codeUnits, *error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz",
&reason, &source, &codeUnits, &error) == FAILURE) {
return;
}
- php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC);
+ php_converter_default_callback(return_value, getThis(), reason, error);
}
/* }}} */
@@ -139,29 +139,29 @@ static PHP_METHOD(UConverter, fromUCallback) {
zend_long reason;
zval *source, *codePoint, *error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzzz",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lzzz",
&reason, &source, &codePoint, &error) == FAILURE) {
return;
}
- php_converter_default_callback(return_value, getThis(), reason, error TSRMLS_CC);
+ php_converter_default_callback(return_value, getThis(), reason, error);
}
/* }}} */
/* {{{ php_converter_check_limits */
-static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed TSRMLS_DC) {
+static inline zend_bool php_converter_check_limits(php_converter_object *objval, zend_long available, zend_long needed) {
if (available < needed) {
- php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR TSRMLS_CC, "Buffer overrun %pd bytes needed, %pd available", needed, available);
+ php_converter_throw_failure(objval, U_BUFFER_OVERFLOW_ERROR, "Buffer overrun %pd bytes needed, %pd available", needed, available);
return 0;
}
return 1;
}
/* }}} */
-#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed TSRMLS_CC)
+#define TARGET_CHECK(cnvargs, needed) php_converter_check_limits(objval, cnvargs->targetLimit - cnvargs->target, needed)
/* {{{ php_converter_append_toUnicode_target */
-static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) {
+static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicodeArgs *args, php_converter_object *objval) {
switch (Z_TYPE_P(val)) {
case IS_NULL:
/* Code unit is being skipped */
@@ -170,7 +170,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
{
zend_long lval = Z_LVAL_P(val);
if ((lval < 0) || (lval > 0x10FFFF)) {
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "Invalid codepoint U+%04lx", lval);
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "Invalid codepoint U+%04lx", lval);
return;
}
if (lval > 0xFFFF) {
@@ -206,12 +206,12 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
zval *tmpzval;
ZEND_HASH_FOREACH_VAL(ht, tmpzval) {
- php_converter_append_toUnicode_target(tmpzval, args, objval TSRMLS_CC);
+ php_converter_append_toUnicode_target(tmpzval, args, objval);
} ZEND_HASH_FOREACH_END();
return;
}
default:
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC,
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR,
"toUCallback() specified illegal type for substitution character");
}
}
@@ -236,11 +236,11 @@ static void php_converter_to_u_callback(const void *context,
objval->to_cb.params = zargs;
objval->to_cb.retval = &retval;
objval->to_cb.no_separation = 0;
- if (zend_call_function(&(objval->to_cb), &(objval->to_cache) TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) {
/* Unlikely */
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling toUCallback()");
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()");
} else if (!Z_ISUNDEF(retval)) {
- php_converter_append_toUnicode_target(&retval, args, objval TSRMLS_CC);
+ php_converter_append_toUnicode_target(&retval, args, objval);
zval_ptr_dtor(&retval);
}
@@ -258,7 +258,7 @@ static void php_converter_to_u_callback(const void *context,
/* }}} */
/* {{{ php_converter_append_fromUnicode_target */
-static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval TSRMLS_DC) {
+static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUnicodeArgs *args, php_converter_object *objval) {
switch (Z_TYPE_P(val)) {
case IS_NULL:
/* Ignore */
@@ -282,12 +282,12 @@ static void php_converter_append_fromUnicode_target(zval *val, UConverterFromUni
HashTable *ht = Z_ARRVAL_P(val);
zval *tmpzval;
ZEND_HASH_FOREACH_VAL(ht, tmpzval) {
- php_converter_append_fromUnicode_target(tmpzval, args, objval TSRMLS_CC);
+ php_converter_append_fromUnicode_target(tmpzval, args, objval);
} ZEND_HASH_FOREACH_END();
return;
}
default:
- php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR TSRMLS_CC, "fromUCallback() specified illegal type for substitution character");
+ php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, "fromUCallback() specified illegal type for substitution character");
}
}
/* }}} */
@@ -318,11 +318,11 @@ static void php_converter_from_u_callback(const void *context,
objval->from_cb.params = zargs;
objval->from_cb.retval = &retval;
objval->from_cb.no_separation = 0;
- if (zend_call_function(&(objval->from_cb), &(objval->from_cache) TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) {
/* Unlikely */
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Unexpected failure calling fromUCallback()");
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()");
} else if (!Z_ISUNDEF(retval)) {
- php_converter_append_fromUnicode_target(&retval, args, objval TSRMLS_CC);
+ php_converter_append_fromUnicode_target(&retval, args, objval);
zval_ptr_dtor(&retval);
}
@@ -340,7 +340,7 @@ static void php_converter_from_u_callback(const void *context,
/* }}} */
/* {{{ php_converter_set_callbacks */
-static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv TSRMLS_DC) {
+static inline zend_bool php_converter_set_callbacks(php_converter_object *objval, UConverter *cnv) {
zend_bool ret = 1;
UErrorCode error = U_ZERO_ERROR;
@@ -373,7 +373,7 @@ static inline zend_bool php_converter_set_callbacks(php_converter_object *objval
static zend_bool php_converter_set_encoding(php_converter_object *objval,
UConverter **pcnv,
const char *enc, int enc_len
- TSRMLS_DC) {
+ ) {
UErrorCode error = U_ZERO_ERROR;
UConverter *cnv = ucnv_open(enc, &error);
@@ -384,17 +384,17 @@ static zend_bool php_converter_set_encoding(php_converter_object *objval,
/* Should never happen */
actual_encoding = "(unknown)";
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding);
+ php_error_docref(NULL, E_WARNING, "Ambiguous encoding specified, using %s", actual_encoding);
} else if (U_FAILURE(error)) {
if (objval) {
THROW_UFAILURE(objval, "ucnv_open", error);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error));
+ php_error_docref(NULL, E_WARNING, "Error setting encoding: %d - %s", (int)error, u_errorName(error));
}
return 0;
}
- if (objval && !php_converter_set_callbacks(objval, cnv TSRMLS_CC)) {
+ if (objval && !php_converter_set_callbacks(objval, cnv)) {
return 0;
}
@@ -415,14 +415,14 @@ static void php_converter_do_set_encoding(UConverter *cnv, INTERNAL_FUNCTION_PAR
char *enc;
size_t enc_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &enc, &enc_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Bad arguments, "
- "expected one string argument", 0 TSRMLS_CC);
+ "expected one string argument", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
- RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len TSRMLS_CC));
+ RETURN_BOOL(php_converter_set_encoding(objval, &(objval->src), enc, enc_len));
}
/* }}} */
@@ -447,11 +447,11 @@ static void php_converter_do_get_encoding(php_converter_object *objval, UConvert
const char *name;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!cnv) {
RETURN_NULL();
@@ -488,10 +488,10 @@ static void php_converter_do_get_type(php_converter_object *objval, UConverter *
UConverterType t;
if (zend_parse_parameters_none() == FAILURE) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "Expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!cnv) {
RETURN_NULL();
@@ -526,7 +526,7 @@ static void php_converter_resolve_callback(zval *zobj,
php_converter_object *objval,
const char *callback_name,
zend_fcall_info *finfo,
- zend_fcall_info_cache *fcache TSRMLS_DC) {
+ zend_fcall_info_cache *fcache) {
char *errstr = NULL;
zval caller;
@@ -534,8 +534,8 @@ static void php_converter_resolve_callback(zval *zobj,
Z_ADDREF_P(zobj);
add_index_zval(&caller, 0, zobj);
add_index_string(&caller, 1, callback_name);
- if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr TSRMLS_CC) == FAILURE) {
- php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR TSRMLS_CC, "Error setting converter callback: %s", errstr);
+ if (zend_fcall_info_init(&caller, 0, finfo, fcache, NULL, &errstr) == FAILURE) {
+ php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Error setting converter callback: %s", errstr);
}
zval_dtor(&caller);
if (errstr) {
@@ -557,19 +557,19 @@ static PHP_METHOD(UConverter, __construct) {
char *dest = src;
size_t dest_len = src_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!",
&dest, &dest_len, &src, &src_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::__construct(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::__construct(): bad arguments", 0);
return;
}
- php_converter_set_encoding(objval, &(objval->src), src, src_len TSRMLS_CC);
- php_converter_set_encoding(objval, &(objval->dest), dest, dest_len TSRMLS_CC);
- php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache) TSRMLS_CC);
- php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache) TSRMLS_CC);
+ php_converter_set_encoding(objval, &(objval->src), src, src_len );
+ php_converter_set_encoding(objval, &(objval->dest), dest, dest_len);
+ php_converter_resolve_callback(getThis(), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache));
+ php_converter_resolve_callback(getThis(), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache));
}
/* }}} */
@@ -584,12 +584,12 @@ static PHP_METHOD(UConverter, setSubstChars) {
size_t chars_len;
int ret = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &chars, &chars_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &chars, &chars_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::setSubstChars(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::setSubstChars(): bad arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (objval->src) {
UErrorCode error = U_ZERO_ERROR;
@@ -599,7 +599,7 @@ static PHP_METHOD(UConverter, setSubstChars) {
ret = 0;
}
} else {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Source Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
ret = 0;
}
@@ -611,7 +611,7 @@ static PHP_METHOD(UConverter, setSubstChars) {
ret = 0;
}
} else {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, "Destination Converter has not been initialized yet");
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Destination Converter has not been initialized yet");
ret = 0;
}
@@ -631,10 +631,10 @@ static PHP_METHOD(UConverter, getSubstChars) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getSubstChars(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getSubstChars(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (!objval->src) {
RETURN_NULL();
@@ -657,7 +657,7 @@ static PHP_METHOD(UConverter, getSubstChars) {
static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, int32_t *pdest_len,
UConverter *src_cnv, const char *src, int32_t src_len,
php_converter_object *objval
- TSRMLS_DC) {
+ ) {
UErrorCode error = U_ZERO_ERROR;
int32_t dest_len,
temp_len;
@@ -665,7 +665,7 @@ static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, in
UChar *temp;
if (!src_cnv || !dest_cnv) {
- php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC,
+ php_converter_throw_failure(objval, U_INVALID_STATE_ERROR,
"Internal converters not initialized");
return 0;
}
@@ -725,12 +725,12 @@ ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, reasonText) {
zend_long reason;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &reason) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &reason) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::reasonText(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::reasonText(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
switch (reason) {
UCNV_REASON_CASE(UNASSIGNED)
@@ -740,7 +740,7 @@ static PHP_METHOD(UConverter, reasonText) {
UCNV_REASON_CASE(CLOSE)
UCNV_REASON_CASE(CLONE)
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason);
+ php_error_docref(NULL, E_WARNING, "Unknown UConverterCallbackReason: %pd", reason);
RETURN_FALSE;
}
}
@@ -759,19 +759,19 @@ static PHP_METHOD(UConverter, convert) {
int32_t dest_len;
zend_bool reverse = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b",
&str, &str_len, &reverse) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::convert(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::convert(): bad arguments", 0);
RETURN_FALSE;
}
- intl_errors_reset(&objval->error TSRMLS_CC);
+ intl_errors_reset(&objval->error);
if (php_converter_do_convert(reverse ? objval->src : objval->dest,
&dest, &dest_len,
reverse ? objval->dest : objval->src,
str, str_len,
- objval TSRMLS_CC)) {
+ objval)) {
RETVAL_STRINGL(dest, dest_len);
//???
efree(dest);
@@ -796,16 +796,16 @@ static PHP_METHOD(UConverter, transcode) {
zval *options = NULL;
UConverter *src_cnv = NULL, *dest_cnv = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|a!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|a!",
&str, &str_len, &dest, &dest_len, &src, &src_len, &options) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::transcode(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::transcode(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (php_converter_set_encoding(NULL, &src_cnv, src, src_len TSRMLS_CC) &&
- php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len TSRMLS_CC)) {
+ if (php_converter_set_encoding(NULL, &src_cnv, src, src_len) &&
+ php_converter_set_encoding(NULL, &dest_cnv, dest, dest_len)) {
char *out = NULL;
int out_len = 0;
UErrorCode error = U_ZERO_ERROR;
@@ -828,7 +828,7 @@ static PHP_METHOD(UConverter, transcode) {
}
if (U_SUCCESS(error) &&
- php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL TSRMLS_CC)) {
+ php_converter_do_convert(dest_cnv, &out, &out_len, src_cnv, str, str_len, NULL)) {
RETVAL_STRINGL(out, out_len);
//???
efree(out);
@@ -860,11 +860,11 @@ static PHP_METHOD(UConverter, getErrorCode) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorCode(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorCode(): expected no arguments", 0);
RETURN_FALSE;
}
- RETURN_LONG(intl_error_get_code(&(objval->error) TSRMLS_CC));
+ RETURN_LONG(intl_error_get_code(&(objval->error)));
}
/* }}} */
@@ -873,11 +873,11 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_geterrormsg_arginfo, 0, ZEND_RETURN_VALUE,
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getErrorMessage) {
php_converter_object *objval = CONV_GET(getThis());
- zend_string *message = intl_error_get_message(&(objval->error) TSRMLS_CC);
+ zend_string *message = intl_error_get_message(&(objval->error));
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorMessage(): expected no arguments", 0);
RETURN_FALSE;
}
@@ -898,10 +898,10 @@ static PHP_METHOD(UConverter, getAvailable) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getErrorMessage(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getErrorMessage(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
array_init(return_value);
for(i = 0; i < count; i++) {
@@ -921,12 +921,12 @@ static PHP_METHOD(UConverter, getAliases) {
UErrorCode error = U_ZERO_ERROR;
uint16_t i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getAliases(): bad arguments", 0 TSRMLS_CC);
+ "UConverter::getAliases(): bad arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
count = ucnv_countAliases(name, &error);
if (U_FAILURE(error)) {
@@ -958,10 +958,10 @@ static PHP_METHOD(UConverter, getStandards) {
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "UConverter::getStandards(): expected no arguments", 0 TSRMLS_CC);
+ "UConverter::getStandards(): expected no arguments", 0);
RETURN_FALSE;
}
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
array_init(return_value);
count = ucnv_countStandards();
@@ -1016,7 +1016,7 @@ static zend_function_entry php_converter_methods[] = {
};
/* {{{ Converter create/clone/destroy */
-static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) {
+static void php_converter_dtor_object(zend_object *obj) {
php_converter_object *objval = php_converter_fetch_object(obj);
if (objval->src) {
@@ -1027,16 +1027,16 @@ static void php_converter_dtor_object(zend_object *obj TSRMLS_DC) {
ucnv_close(objval->dest);
}
- intl_error_reset(&(objval->error) TSRMLS_CC);
+ intl_error_reset(&(objval->error));
}
-static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval TSRMLS_DC) {
+static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converter_object **pobjval) {
php_converter_object *objval;
objval = ecalloc(1, sizeof(php_converter_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&objval->obj, ce TSRMLS_CC );
- intl_error_init(&(objval->error) TSRMLS_CC);
+ zend_object_std_init(&objval->obj, ce );
+ intl_error_init(&(objval->error));
objval->obj.handlers = &php_converter_object_handlers;
*pobjval = objval;
@@ -1044,21 +1044,21 @@ static zend_object *php_converter_object_ctor(zend_class_entry *ce, php_converte
return &objval->obj;
}
-static zend_object *php_converter_create_object(zend_class_entry *ce TSRMLS_DC) {
+static zend_object *php_converter_create_object(zend_class_entry *ce) {
php_converter_object *objval = NULL;
- zend_object *retval = php_converter_object_ctor(ce, &objval TSRMLS_CC);
+ zend_object *retval = php_converter_object_ctor(ce, &objval);
object_properties_init(&(objval->obj), ce);
return retval;
}
-static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
+static zend_object *php_converter_clone_object(zval *object) {
php_converter_object *objval, *oldobj = Z_INTL_CONVERTER_P(object);
- zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval TSRMLS_CC);
+ zend_object *retval = php_converter_object_ctor(Z_OBJCE_P(object), &objval);
UErrorCode error = U_ZERO_ERROR;
- intl_errors_reset(&oldobj->error TSRMLS_CC);
+ intl_errors_reset(&oldobj->error);
objval->src = ucnv_safeClone(oldobj->src, NULL, NULL, &error);
if (U_SUCCESS(error)) {
@@ -1069,18 +1069,18 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
zend_string *err_msg;
THROW_UFAILURE(oldobj, "ucnv_safeClone", error);
- err_msg = intl_error_get_message(&oldobj->error TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ err_msg = intl_error_get_message(&oldobj->error);
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_release(err_msg);
return retval;
}
/* Update contexts for converter error handlers */
- php_converter_set_callbacks(objval, objval->src TSRMLS_CC);
- php_converter_set_callbacks(objval, objval->dest TSRMLS_CC);
+ php_converter_set_callbacks(objval, objval->src );
+ php_converter_set_callbacks(objval, objval->dest);
- zend_objects_clone_members(&(objval->obj), &(oldobj->obj) TSRMLS_CC);
+ zend_objects_clone_members(&(objval->obj), &(oldobj->obj));
/* Newly cloned object deliberately does not inherit error state from original object */
@@ -1088,15 +1088,15 @@ static zend_object *php_converter_clone_object(zval *object TSRMLS_DC) {
}
/* }}} */
-#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v TSRMLS_CC)
-#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v TSRMLS_CC)
+#define CONV_REASON_CONST(v) zend_declare_class_constant_long(php_converter_ce, "REASON_" #v, sizeof("REASON_" #v) - 1, UCNV_ ## v)
+#define CONV_TYPE_CONST(v) zend_declare_class_constant_long(php_converter_ce, #v , sizeof(#v) - 1, UCNV_ ## v)
/* {{{ php_converter_minit */
int php_converter_minit(INIT_FUNC_ARGS) {
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "UConverter", php_converter_methods);
- php_converter_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ php_converter_ce = zend_register_internal_class(&ce);
php_converter_ce->create_object = php_converter_create_object;
memcpy(&php_converter_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj);
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index ffa606a9cd..b1821ce0d3 100644
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -35,10 +35,10 @@ void dateformat_register_constants( INIT_FUNC_ARGS )
}
#define DATEFORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x TSRMLS_CC );
- #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define DATEFORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UDAT_##x );
+ #define DATEFORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( name ) - 1, value );
- #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x TSRMLS_CC );
+ #define DATEFORMATTER_EXPOSE_UCAL_CLASS_CONST(x) zend_declare_class_constant_long( IntlDateFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UCAL_##x );
/* UDateFormatStyle constants */
DATEFORMATTER_EXPOSE_CLASS_CONST( FULL );
@@ -74,11 +74,11 @@ PHP_FUNCTION( datefmt_get_error_code )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -100,11 +100,11 @@ PHP_FUNCTION( datefmt_get_error_message )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -112,7 +112,7 @@ PHP_FUNCTION( datefmt_get_error_message )
dfo = Z_INTL_DATEFORMATTER_P( object );
/* Return last error message. */
- message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) TSRMLS_CC );
+ message = intl_error_get_message( INTL_DATA_ERROR_P(dfo) );
RETURN_STR( message);
}
/* }}} */
diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c
index 314ae730c7..ee8b91dbed 100644
--- a/ext/intl/dateformat/dateformat_attr.c
+++ b/ext/intl/dateformat/dateformat_attr.c
@@ -36,10 +36,10 @@ PHP_FUNCTION( datefmt_get_datetype )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_datetype: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_datetype: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -62,10 +62,10 @@ PHP_FUNCTION( datefmt_get_timetype )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_timetype: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_timetype: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -93,10 +93,10 @@ PHP_FUNCTION( datefmt_get_pattern )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -137,11 +137,11 @@ PHP_FUNCTION( datefmt_set_pattern )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, IntlDateFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_pattern: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_set_pattern: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -175,11 +175,11 @@ PHP_FUNCTION( datefmt_get_locale )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l",
&object, IntlDateFormatter_ce_ptr,&loc_type) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -204,11 +204,11 @@ PHP_FUNCTION( datefmt_is_lenient )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_is_lenient: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_is_lenient: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -232,11 +232,11 @@ PHP_FUNCTION( datefmt_set_lenient )
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ob",
&object, IntlDateFormatter_ce_ptr,&isLenient ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_lenient: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_set_lenient: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp
index 71b136c6c1..52df471a10 100644
--- a/ext/intl/dateformat/dateformat_attrcpp.cpp
+++ b/ext/intl/dateformat/dateformat_attrcpp.cpp
@@ -48,10 +48,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id)
int str_len;
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_get_timezone_"
- "id: unable to parse input params", 0 TSRMLS_CC);
+ "id: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -76,10 +76,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_timezone: unable to parse input params", 0 TSRMLS_CC );
+ "datefmt_get_timezone: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -90,17 +90,17 @@ U_CFUNC PHP_FUNCTION(datefmt_get_timezone)
if (tz_clone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_get_timezone: Out of memory when cloning time zone",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
object_init_ex(return_value, TimeZone_ce_ptr);
- timezone_object_construct(tz_clone, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz_clone, return_value, 1);
}
U_CFUNC PHP_FUNCTION(datefmt_set_timezone_id)
{
- php_error_docref0(NULL TSRMLS_CC, E_DEPRECATED,
+ php_error_docref0(NULL, E_DEPRECATED,
"Use datefmt_set_timezone() instead, which also accepts a plain "
"time zone identifier and for which this function is now an "
"alias");
@@ -119,17 +119,17 @@ U_CFUNC PHP_FUNCTION(datefmt_set_timezone)
DATE_FORMAT_METHOD_INIT_VARS;
- if ( zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if ( zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Oz", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: "
- "unable to parse input params", 0 TSRMLS_CC);
+ "unable to parse input params", 0);
RETURN_FALSE;
}
DATE_FORMAT_METHOD_FETCH_OBJECT;
timezone = timezone_process_timezone_argument(timezone_zv,
- INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone" TSRMLS_CC);
+ INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone");
if (timezone == NULL) {
RETURN_FALSE;
}
@@ -146,10 +146,10 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_get_calendar: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_get_calendar: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -173,11 +173,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object)
{
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_get_calendar_object: unable to parse input params",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -192,11 +192,11 @@ U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object)
if (cal_clone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_get_calendar_object: Out of memory when cloning "
- "calendar", 0 TSRMLS_CC);
+ "calendar", 0);
RETURN_FALSE;
}
- calendar_object_create(return_value, cal_clone TSRMLS_CC);
+ calendar_object_create(return_value, cal_clone);
}
/* }}} */
@@ -210,10 +210,10 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
zval *calendar_zv;
DATE_FORMAT_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz",
&object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_set_calendar: unable to parse input params", 0 TSRMLS_CC);
+ "datefmt_set_calendar: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -229,7 +229,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (datefmt_process_calendar_arg(calendar_zv, locale,
"datefmt_set_calendar", INTL_DATA_ERROR_P(dfo), cal, cal_type,
- cal_owned TSRMLS_CC) == FAILURE) {
+ cal_owned) == FAILURE) {
RETURN_FALSE;
}
@@ -239,7 +239,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (old_timezone == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_set_calendar: Out of memory when cloning calendar",
- 0 TSRMLS_CC);
+ 0);
delete cal;
RETURN_FALSE;
}
@@ -249,7 +249,7 @@ U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
if (cal == NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
"datefmt_set_calendar: Out of memory when cloning calendar",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
}
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 0d93338ecd..ef63929a43 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -35,35 +35,35 @@ static zend_object_handlers IntlDateFormatter_handlers;
*/
/* {{{ IntlDateFormatter_objects_dtor */
-static void IntlDateFormatter_object_dtor(zend_object *object TSRMLS_DC )
+static void IntlDateFormatter_object_dtor(zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ IntlDateFormatter_objects_free */
-void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC )
+void IntlDateFormatter_object_free( zend_object *object )
{
IntlDateFormatter_object* dfo = php_intl_dateformatter_fetch_object(object);
- zend_object_std_dtor( &dfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &dfo->zo );
if (dfo->requested_locale) {
efree( dfo->requested_locale );
}
- dateformat_data_free( &dfo->datef_data TSRMLS_CC );
+ dateformat_data_free( &dfo->datef_data );
}
/* }}} */
/* {{{ IntlDateFormatter_object_create */
-zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *IntlDateFormatter_object_create(zend_class_entry *ce)
{
IntlDateFormatter_object* intern;
intern = ecalloc( 1, sizeof(IntlDateFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- dateformat_data_init( &intern->datef_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ dateformat_data_init( &intern->datef_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->date_type = 0;
intern->time_type = 0;
@@ -78,28 +78,28 @@ zend_object *IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ IntlDateFormatter_object_clone */
-zend_object *IntlDateFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *IntlDateFormatter_object_clone(zval *object)
{
IntlDateFormatter_object *dfo, *new_dfo;
zend_object *new_obj;
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_dfo = php_intl_dateformatter_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_dfo->zo, &dfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_dfo->zo, &dfo->zo);
/* clone formatter object */
if (dfo->datef_data.udatf != NULL) {
DATE_FORMAT_OBJECT(new_dfo) = udat_clone(DATE_FORMAT_OBJECT(dfo), &INTL_DATA_ERROR_CODE(dfo));
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* set up error in case error handler is interested */
intl_errors_set(INTL_DATA_ERROR_P(dfo), INTL_DATA_ERROR_CODE(dfo),
- "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC );
- zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0 TSRMLS_CC);
+ "Failed to clone IntlDateFormatter object", 0 );
+ zend_throw_exception(NULL, "Failed to clone IntlDateFormatter object", 0);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlDateFormatter", 0);
}
return new_obj;
}
@@ -188,14 +188,14 @@ static zend_function_entry IntlDateFormatter_class_functions[] = {
/* {{{ dateformat_register_class
* Initialize 'IntlDateFormatter' class
*/
-void dateformat_register_IntlDateFormatter_class( TSRMLS_D )
+void dateformat_register_IntlDateFormatter_class( void )
{
zend_class_entry ce;
/* Create and register 'IntlDateFormatter' class. */
INIT_CLASS_ENTRY( ce, "IntlDateFormatter", IntlDateFormatter_class_functions );
ce.create_object = IntlDateFormatter_object_create;
- IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ IntlDateFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&IntlDateFormatter_handlers, zend_get_std_object_handlers(),
sizeof IntlDateFormatter_handlers);
diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h
index ebd057022e..e96a20b5ee 100644
--- a/ext/intl/dateformat/dateformat_class.h
+++ b/ext/intl/dateformat/dateformat_class.h
@@ -37,7 +37,7 @@ static inline IntlDateFormatter_object *php_intl_dateformatter_fetch_object(zend
}
#define Z_INTL_DATEFORMATTER_P(zv) php_intl_dateformatter_fetch_object(Z_OBJ_P(zv))
-void dateformat_register_IntlDateFormatter_class( TSRMLS_D );
+void dateformat_register_IntlDateFormatter_class( void );
extern zend_class_entry *IntlDateFormatter_ce_ptr;
/* Auxiliary macros */
@@ -48,7 +48,7 @@ extern zend_class_entry *IntlDateFormatter_ce_ptr;
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
if (dfo->datef_data.udatf == NULL) \
{ \
- intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \
+ intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
index 4a272aa45f..9a90029ca1 100644
--- a/ext/intl/dateformat/dateformat_create.cpp
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -58,21 +58,21 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int slength = 0;
IntlDateFormatter_object* dfo;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
object = return_value;
/* Parse parameters. */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|zzs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|zzs",
&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
- "unable to parse input parameters", 0 TSRMLS_CC);
+ "unable to parse input parameters", 0);
Z_OBJ_P(return_value) = NULL;
return;
}
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (locale_len == 0) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
locale = Locale::createFromName(locale_str);
@@ -80,14 +80,14 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (DATE_FORMAT_OBJECT(dfo) != NULL) {
intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
+ "datefmt_create: cannot call constructor twice", 0);
return;
}
/* process calendar */
if (datefmt_process_calendar_arg(calendar_zv, locale, "datefmt_create",
INTL_DATA_ERROR_P(dfo), calendar, calendar_type,
- calendar_owned TSRMLS_CC)
+ calendar_owned)
== FAILURE) {
goto error;
}
@@ -98,7 +98,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (explicit_tz || calendar_owned ) {
//we have an explicit time zone or a non-object calendar
timezone = timezone_process_timezone_argument(timezone_zv,
- INTL_DATA_ERROR_P(dfo), "datefmt_create" TSRMLS_CC);
+ INTL_DATA_ERROR_P(dfo), "datefmt_create");
if (timezone == NULL) {
goto error;
}
@@ -111,7 +111,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
/* object construction -> only set global error */
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
- "error converting pattern to UTF-16", 0 TSRMLS_CC);
+ "error converting pattern to UTF-16", 0);
goto error;
}
}
@@ -140,7 +140,7 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
} else {
intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: date "
- "formatter creation failed", 0 TSRMLS_CC);
+ "formatter creation failed", 0);
goto error;
}
@@ -160,7 +160,7 @@ error:
if (calendar != NULL && calendar_owned) {
delete calendar;
}
- if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
+ if (U_FAILURE(intl_error_get_code(NULL))) {
/* free_object handles partially constructed instances fine */
Z_OBJ_P(return_value) = NULL;
}
@@ -195,7 +195,7 @@ U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
diff --git a/ext/intl/dateformat/dateformat_data.c b/ext/intl/dateformat/dateformat_data.c
index 509e91b617..04d37aa7ac 100644
--- a/ext/intl/dateformat/dateformat_data.c
+++ b/ext/intl/dateformat/dateformat_data.c
@@ -22,20 +22,20 @@
/* {{{ void dateformat_data_init( dateformat_data* datef_data )
* Initialize internals of dateformat_data.
*/
-void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC )
+void dateformat_data_init( dateformat_data* datef_data )
{
if( !datef_data )
return;
datef_data->udatf = NULL;
- intl_error_reset( &datef_data->error TSRMLS_CC );
+ intl_error_reset( &datef_data->error );
}
/* }}} */
/* {{{ void dateformat_data_free( dateformat_data* datef_data )
* Clean up memory allocated for dateformat_data
*/
-void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC )
+void dateformat_data_free( dateformat_data* datef_data )
{
if( !datef_data )
return;
@@ -44,18 +44,18 @@ void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC )
udat_close( datef_data->udatf );
datef_data->udatf = NULL;
- intl_error_reset( &datef_data->error TSRMLS_CC );
+ intl_error_reset( &datef_data->error );
}
/* }}} */
/* {{{ dateformat_data* dateformat_data_create()
* Allocate memory for dateformat_data and initialize it with default values.
*/
-dateformat_data* dateformat_data_create( TSRMLS_D )
+dateformat_data* dateformat_data_create( void )
{
dateformat_data* datef_data = ecalloc( 1, sizeof(dateformat_data) );
- dateformat_data_init( datef_data TSRMLS_CC );
+ dateformat_data_init( datef_data );
return datef_data;
}
diff --git a/ext/intl/dateformat/dateformat_data.h b/ext/intl/dateformat/dateformat_data.h
index a49da7dc89..aaf61e6266 100644
--- a/ext/intl/dateformat/dateformat_data.h
+++ b/ext/intl/dateformat/dateformat_data.h
@@ -30,8 +30,8 @@ typedef struct {
UDateFormat * udatf;
} dateformat_data;
-dateformat_data* dateformat_data_create( TSRMLS_D );
-void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC );
-void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC );
+dateformat_data* dateformat_data_create( void );
+void dateformat_data_init( dateformat_data* datef_data );
+void dateformat_data_free( dateformat_data* datef_data );
#endif // DATE_FORMAT_DATA_H
diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c
index d11eb2df24..61c3627cb8 100644
--- a/ext/intl/dateformat/dateformat_format.c
+++ b/ext/intl/dateformat/dateformat_format.c
@@ -32,7 +32,7 @@
/* {{{
* Internal function which calls the udat_format
*/
-static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value TSRMLS_DC)
+static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval *return_value)
{
UChar* formatted = NULL;
int32_t resultlengthneeded =0 ;
@@ -60,7 +60,7 @@ static void internal_format(IntlDateFormatter_object *dfo, UDate timestamp, zval
* Internal function which fetches an element from the passed array for the key_name passed
*/
static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
- HashTable* hash_arr, char* key_name, intl_error *err TSRMLS_DC)
+ HashTable* hash_arr, char* key_name, intl_error *err)
{
zval *ele_value = NULL;
int32_t result = 0;
@@ -74,7 +74,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
if(Z_TYPE_P(ele_value) != IS_LONG) {
spprintf(&message, 0, "datefmt_format: parameter array contains "
"a non-integer element for key '%s'", key_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
} else {
if (Z_LVAL_P(ele_value) > INT32_MAX ||
@@ -82,7 +82,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
spprintf(&message, 0, "datefmt_format: value %pd is out of "
"bounds for a 32-bit integer in key '%s'",
Z_LVAL_P(ele_value), key_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
} else {
result = Z_LVAL_P(ele_value);
@@ -98,7 +98,7 @@ static int32_t internal_get_arr_ele(IntlDateFormatter_object *dfo,
* Internal function which sets UCalendar from the passed array and retrieves timestamp
*/
static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
- HashTable *hash_arr TSRMLS_DC)
+ HashTable *hash_arr)
{
int32_t year,
month,
@@ -111,7 +111,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
intl_error *err = &dfo->datef_data.error;
#define INTL_GET_ELEM(elem) \
- internal_get_arr_ele(dfo, hash_arr, (elem), err TSRMLS_CC)
+ internal_get_arr_ele(dfo, hash_arr, (elem), err)
/* Fetch values from the incoming array */
year = INTL_GET_ELEM(CALENDAR_YEAR) + 1900; /* tm_year is years since 1900 */
@@ -130,7 +130,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo,
if (INTL_DATA_ERROR_CODE(dfo) != U_ZERO_ERROR) {
intl_errors_set(err, INTL_DATA_ERROR_CODE(dfo), "datefmt_format: "
- "error cloning calendar", 0 TSRMLS_CC);
+ "error cloning calendar", 0);
return 0;
}
@@ -158,10 +158,10 @@ PHP_FUNCTION(datefmt_format)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz",
&object, IntlDateFormatter_ce_ptr, &zarg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_format: unable "
- "to parse input params", 0 TSRMLS_CC );
+ "to parse input params", 0 );
RETURN_FALSE;
}
@@ -173,17 +173,17 @@ PHP_FUNCTION(datefmt_format)
RETURN_FALSE;
}
- timestamp = internal_get_timestamp(dfo, hash_arr TSRMLS_CC);
+ timestamp = internal_get_timestamp(dfo, hash_arr);
INTL_METHOD_CHECK_STATUS(dfo, "datefmt_format: date formatting failed")
} else {
timestamp = intl_zval_to_millis(zarg, INTL_DATA_ERROR_P(dfo),
- "datefmt_format" TSRMLS_CC);
+ "datefmt_format");
if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
RETURN_FALSE;
}
}
- internal_format( dfo, timestamp, return_value TSRMLS_CC);
+ internal_format( dfo, timestamp, return_value);
}
/* }}} */
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp
index b552ed7529..fe38a71287 100644
--- a/ext/intl/dateformat/dateformat_format_object.cpp
+++ b/ext/intl/dateformat/dateformat_format_object.cpp
@@ -73,13 +73,13 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
DateFormat::EStyle dateStyle = DateFormat::kDefault,
timeStyle = DateFormat::kDefault;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|zs!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|zs!",
&object, &format, &locale_str, &locale_len) == FAILURE) {
RETURN_FALSE;
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
if (format == NULL || Z_TYPE_P(format) == IS_NULL) {
@@ -91,7 +91,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (zend_hash_num_elements(ht) != 2) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; if array, it must have "
- "two elements", 0 TSRMLS_CC);
+ "two elements", 0);
RETURN_FALSE;
}
@@ -100,7 +100,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(z)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; the date format (first "
- "element of the array) is not valid", 0 TSRMLS_CC);
+ "element of the array) is not valid", 0);
RETURN_FALSE;
}
dateStyle = (DateFormat::EStyle)Z_LVAL_P(z);
@@ -110,7 +110,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(z)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad format; the time format ("
- "second element of the array) is not valid", 0 TSRMLS_CC);
+ "second element of the array) is not valid", 0);
RETURN_FALSE;
}
timeStyle = (DateFormat::EStyle)Z_LVAL_P(z);
@@ -118,7 +118,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (!valid_format(format)) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: the date/time format type is invalid",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format);
@@ -126,7 +126,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
convert_to_string_ex(format);
if (Z_STRLEN_P(format) == 0) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "datefmt_format_object: the format is empty", 0 TSRMLS_CC);
+ "datefmt_format_object: the format is empty", 0);
RETURN_FALSE;
}
pattern = true;
@@ -136,12 +136,12 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative);
zend_class_entry *instance_ce = Z_OBJCE_P(object);
- if (instanceof_function(instance_ce, Calendar_ce_ptr TSRMLS_CC)) {
- Calendar *obj_cal = calendar_fetch_native_calendar(object TSRMLS_CC);
+ if (instanceof_function(instance_ce, Calendar_ce_ptr)) {
+ Calendar *obj_cal = calendar_fetch_native_calendar(object);
if (obj_cal == NULL) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"datefmt_format_object: bad IntlCalendar instance: "
- "not initialized properly", 0 TSRMLS_CC);
+ "not initialized properly", 0);
RETURN_FALSE;
}
timeZone = obj_cal->getTimeZone().clone();
@@ -149,28 +149,28 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: error obtaining instant from "
- "IntlCalendar", 0 TSRMLS_CC);
+ "IntlCalendar", 0);
RETVAL_FALSE;
goto cleanup;
}
cal = obj_cal->clone();
- } else if (instanceof_function(instance_ce, php_date_get_date_ce() TSRMLS_CC)) {
+ } else if (instanceof_function(instance_ce, php_date_get_date_ce())) {
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
- "datefmt_format_object" TSRMLS_CC) == FAILURE) {
+ "datefmt_format_object") == FAILURE) {
RETURN_FALSE;
}
cal = new GregorianCalendar(Locale::createFromName(locale_str), status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: could not create GregorianCalendar",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
} else {
intl_error_set(NULL, status, "datefmt_format_object: the passed object "
"must be an instance of either IntlCalendar or DateTime",
- 0 TSRMLS_CC);
+ 0);
RETURN_FALSE;
}
@@ -184,7 +184,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (U_FAILURE(status)) {
intl_error_set(NULL, status,
"datefmt_format_object: could not create SimpleDateFormat",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
@@ -195,7 +195,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (df == NULL) { /* according to ICU sources, this should never happen */
intl_error_set(NULL, status,
"datefmt_format_object: could not create DateFormat",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
@@ -216,7 +216,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
if (intl_charFromString(result, &ret_str, &ret_str_len, &status) == FAILURE) {
intl_error_set(NULL, status,
"datefmt_format_object: error converting result to UTF-8",
- 0 TSRMLS_CC);
+ 0);
RETVAL_FALSE;
goto cleanup;
}
diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp
index b3f134a4f1..959afa8d82 100644
--- a/ext/intl/dateformat/dateformat_helpers.cpp
+++ b/ext/intl/dateformat/dateformat_helpers.cpp
@@ -34,7 +34,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
intl_error *err,
Calendar*& cal,
zend_long& cal_int_type,
- bool& calendar_owned TSRMLS_DC)
+ bool& calendar_owned)
{
char *msg;
UErrorCode status = UErrorCode();
@@ -56,7 +56,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
"calendar) or IntlDateFormatter::GREGORIAN. "
"Alternatively, it can be an IntlCalendar object",
func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
} else if (v == (zend_long)UCAL_TRADITIONAL) {
@@ -70,13 +70,13 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
} else if (Z_TYPE_P(calendar_zv) == IS_OBJECT &&
instanceof_function_ex(Z_OBJCE_P(calendar_zv),
- Calendar_ce_ptr, 0 TSRMLS_CC)) {
+ Calendar_ce_ptr, 0)) {
- cal = calendar_fetch_native_calendar(calendar_zv TSRMLS_CC);
+ cal = calendar_fetch_native_calendar(calendar_zv);
if (cal == NULL) {
spprintf(&msg, 0, "%s: Found unconstructed IntlCalendar object",
func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
@@ -87,7 +87,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
} else {
spprintf(&msg, 0, "%s: Invalid calendar argument; should be an integer "
"or an IntlCalendar instance", func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
@@ -97,7 +97,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
}
if (U_FAILURE(status)) {
spprintf(&msg, 0, "%s: Failure instantiating calendar", func_name);
- intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+ intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1);
efree(msg);
return FAILURE;
}
diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h
index c6121d75bb..eb90c99169 100644
--- a/ext/intl/dateformat/dateformat_helpers.h
+++ b/ext/intl/dateformat/dateformat_helpers.h
@@ -33,7 +33,7 @@ int datefmt_process_calendar_arg(zval* calendar_zv,
intl_error *err,
Calendar*& cal,
zend_long& cal_int_type,
- bool& calendar_owned TSRMLS_DC);
+ bool& calendar_owned);
#endif /* DATEFORMAT_HELPERS_H */
diff --git a/ext/intl/dateformat/dateformat_parse.c b/ext/intl/dateformat/dateformat_parse.c
index 15279da3a1..7d12f877e7 100644
--- a/ext/intl/dateformat/dateformat_parse.c
+++ b/ext/intl/dateformat/dateformat_parse.c
@@ -34,7 +34,7 @@
* if set to 1 - store any error encountered in the parameter parse_error
* if set to 0 - no need to store any error encountered in the parameter parse_error
*/
-static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC)
+static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value)
{
double result = 0;
UDate timestamp =0;
@@ -62,7 +62,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex
}
/* }}} */
-static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name TSRMLS_DC)
+static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, zend_long calendar_field, char* key_name)
{
zend_long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo));
INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" );
@@ -81,7 +81,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va
/* {{{
* Internal function which calls the udat_parseCalendar
*/
-static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC)
+static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value)
{
UCalendar *parsed_calendar = NULL;
UChar* text_utf16 = NULL;
@@ -104,14 +104,14 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
array_init( return_value );
/* Add entries from various fields of the obtained parsed_calendar */
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY TSRMLS_CC);
- add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON TSRMLS_CC);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_SECOND, CALENDAR_SEC);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MINUTE, CALENDAR_MIN);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_HOUR_OF_DAY, CALENDAR_HOUR);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_YEAR, CALENDAR_YEAR);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_MONTH, CALENDAR_MDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_WEEK, CALENDAR_WDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_DAY_OF_YEAR, CALENDAR_YDAY);
+ add_to_localtime_arr( dfo, return_value, parsed_calendar, UCAL_MONTH, CALENDAR_MON);
/* Is in DST? */
isInDST = ucal_inDaylightTime(parsed_calendar , &INTL_DATA_ERROR_CODE(dfo));
@@ -135,9 +135,9 @@ PHP_FUNCTION(datefmt_parse)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z/!",
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -152,7 +152,7 @@ PHP_FUNCTION(datefmt_parse)
RETURN_FALSE;
}
}
- internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
+ internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
if(z_parse_pos) {
zval_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
@@ -174,9 +174,9 @@ PHP_FUNCTION(datefmt_localtime)
DATE_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|z!",
&object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -191,7 +191,7 @@ PHP_FUNCTION(datefmt_localtime)
RETURN_FALSE;
}
}
- internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
+ internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value);
if (z_parse_pos) {
zval_dtor(z_parse_pos);
ZVAL_LONG(z_parse_pos, parse_pos);
diff --git a/ext/intl/formatter/formatter.c b/ext/intl/formatter/formatter.c
index bb4d3d2ac5..63664ecc03 100644
--- a/ext/intl/formatter/formatter.c
+++ b/ext/intl/formatter/formatter.c
@@ -41,8 +41,8 @@ void formatter_register_constants( INIT_FUNC_ARGS )
}
#define FORMATTER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x TSRMLS_CC );
- #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define FORMATTER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( #x ) - 1, UNUM_##x );
+ #define FORMATTER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( NumberFormatter_ce_ptr, ZEND_STRS( name ) - 1, value );
/* UNumberFormatStyle constants */
FORMATTER_EXPOSE_CLASS_CONST( PATTERN_DECIMAL );
diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c
index 639342f4af..d3189df6d6 100644
--- a/ext/intl/formatter/formatter_attr.c
+++ b/ext/intl/formatter/formatter_attr.c
@@ -36,11 +36,11 @@ PHP_FUNCTION( numfmt_get_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -109,11 +109,11 @@ PHP_FUNCTION( numfmt_get_text_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &attribute ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_text_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_text_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -150,11 +150,11 @@ PHP_FUNCTION( numfmt_set_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Olz",
&object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -215,11 +215,11 @@ PHP_FUNCTION( numfmt_set_text_attribute )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols",
&object, NumberFormatter_ce_ptr, &attribute, &value, &len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_text_attribute: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_text_attribute: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -256,17 +256,17 @@ PHP_FUNCTION( numfmt_get_symbol )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ol",
&object, NumberFormatter_ce_ptr, &symbol ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_symbol: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_symbol: unable to parse input params", 0 );
RETURN_FALSE;
}
if(symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_get_symbol: invalid symbol value", 0 );
RETURN_FALSE;
}
@@ -305,17 +305,17 @@ PHP_FUNCTION( numfmt_set_symbol )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ols",
&object, NumberFormatter_ce_ptr, &symbol, &value, &value_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_symbol: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_symbol: unable to parse input params", 0 );
RETURN_FALSE;
}
if (symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 );
RETURN_FALSE;
}
@@ -350,11 +350,11 @@ PHP_FUNCTION( numfmt_get_pattern )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -393,11 +393,11 @@ PHP_FUNCTION( numfmt_set_pattern )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, NumberFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_set_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -431,11 +431,11 @@ PHP_FUNCTION( numfmt_get_locale )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O|l",
&object, NumberFormatter_ce_ptr, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index 8fcc155e85..aa8844cca0 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -38,29 +38,29 @@ static void NumberFormatter_object_dtor(
zend_object *object
TSRMLS_DC )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ NumberFormatter_objects_free */
-void NumberFormatter_object_free( zend_object *object TSRMLS_DC )
+void NumberFormatter_object_free( zend_object *object )
{
NumberFormatter_object* nfo = php_intl_number_format_fetch_object(object);
- zend_object_std_dtor( &nfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &nfo->zo );
- formatter_data_free( &nfo->nf_data TSRMLS_CC );
+ formatter_data_free( &nfo->nf_data );
}
/* }}} */
/* {{{ NumberFormatter_object_create */
-zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *NumberFormatter_object_create(zend_class_entry *ce)
{
NumberFormatter_object* intern;
intern = ecalloc( 1, sizeof(NumberFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- formatter_data_init( &intern->nf_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ formatter_data_init( &intern->nf_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &NumberFormatter_handlers;
@@ -70,16 +70,16 @@ zend_object *NumberFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ NumberFormatter_object_clone */
-zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *NumberFormatter_object_clone(zval *object)
{
NumberFormatter_object *nfo, *new_nfo;
zend_object *new_obj;
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_nfo = php_intl_number_format_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_nfo->zo, &nfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_nfo->zo, &nfo->zo);
/* clone formatter object. It may fail, the destruction code must handle this case */
if (FORMATTER_OBJECT(nfo) != NULL) {
FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo),
@@ -87,11 +87,11 @@ zend_object *NumberFormatter_object_clone(zval *object TSRMLS_DC)
if (U_FAILURE(INTL_DATA_ERROR_CODE(nfo))) {
/* set up error in case error handler is interested */
intl_errors_set(INTL_DATA_ERROR_P(nfo), INTL_DATA_ERROR_CODE(nfo),
- "Failed to clone NumberFormatter object", 0 TSRMLS_CC);
- zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0 TSRMLS_CC);
+ "Failed to clone NumberFormatter object", 0);
+ zend_throw_exception(NULL, "Failed to clone NumberFormatter object", 0);
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed NumberFormatter", 0);
}
return new_obj;
}
@@ -184,14 +184,14 @@ static zend_function_entry NumberFormatter_class_functions[] = {
/* {{{ formatter_register_class
* Initialize 'NumberFormatter' class
*/
-void formatter_register_class( TSRMLS_D )
+void formatter_register_class( void )
{
zend_class_entry ce;
/* Create and register 'NumberFormatter' class. */
INIT_CLASS_ENTRY( ce, "NumberFormatter", NumberFormatter_class_functions );
ce.create_object = NumberFormatter_object_create;
- NumberFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ NumberFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&NumberFormatter_handlers, zend_get_std_object_handlers(),
sizeof(NumberFormatter_handlers));
diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h
index 1db688712c..1d6fa817c9 100644
--- a/ext/intl/formatter/formatter_class.h
+++ b/ext/intl/formatter/formatter_class.h
@@ -34,7 +34,7 @@ static inline NumberFormatter_object *php_intl_number_format_fetch_object(zend_o
}
#define Z_INTL_NUMBERFORMATTER_P(zv) php_intl_number_format_fetch_object(Z_OBJ_P(zv))
-void formatter_register_class( TSRMLS_D );
+void formatter_register_class( void );
extern zend_class_entry *NumberFormatter_ce_ptr;
/* Auxiliary macros */
@@ -47,7 +47,7 @@ extern zend_class_entry *NumberFormatter_ce_ptr;
if (FORMATTER_OBJECT(nfo) == NULL) \
{ \
intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \
+ "Found unconstructed NumberFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/formatter/formatter_data.c b/ext/intl/formatter/formatter_data.c
index 2f785ba68f..46b94ad4ea 100644
--- a/ext/intl/formatter/formatter_data.c
+++ b/ext/intl/formatter/formatter_data.c
@@ -23,20 +23,20 @@
/* {{{ void formatter_data_init( formatter_data* nf_data )
* Initialize internals of formatter_data.
*/
-void formatter_data_init( formatter_data* nf_data TSRMLS_DC )
+void formatter_data_init( formatter_data* nf_data )
{
if( !nf_data )
return;
nf_data->unum = NULL;
- intl_error_reset( &nf_data->error TSRMLS_CC );
+ intl_error_reset( &nf_data->error );
}
/* }}} */
/* {{{ void formatter_data_free( formatter_data* nf_data )
* Clean up mem allocted by internals of formatter_data
*/
-void formatter_data_free( formatter_data* nf_data TSRMLS_DC )
+void formatter_data_free( formatter_data* nf_data )
{
if( !nf_data )
return;
@@ -45,18 +45,18 @@ void formatter_data_free( formatter_data* nf_data TSRMLS_DC )
unum_close( nf_data->unum );
nf_data->unum = NULL;
- intl_error_reset( &nf_data->error TSRMLS_CC );
+ intl_error_reset( &nf_data->error );
}
/* }}} */
/* {{{ formatter_data* formatter_data_create()
* Alloc mem for formatter_data and initialize it with default values.
*/
-formatter_data* formatter_data_create( TSRMLS_D )
+formatter_data* formatter_data_create( void )
{
formatter_data* nf_data = ecalloc( 1, sizeof(formatter_data) );
- formatter_data_init( nf_data TSRMLS_CC );
+ formatter_data_init( nf_data );
return nf_data;
}
diff --git a/ext/intl/formatter/formatter_data.h b/ext/intl/formatter/formatter_data.h
index 0e3bc4fea4..8d1bfd12cd 100644
--- a/ext/intl/formatter/formatter_data.h
+++ b/ext/intl/formatter/formatter_data.h
@@ -31,8 +31,8 @@ typedef struct {
UNumberFormat* unum;
} formatter_data;
-formatter_data* formatter_data_create( TSRMLS_D );
-void formatter_data_init( formatter_data* nf_data TSRMLS_DC );
-void formatter_data_free( formatter_data* nf_data TSRMLS_DC );
+formatter_data* formatter_data_create( void );
+void formatter_data_init( formatter_data* nf_data );
+void formatter_data_free( formatter_data* nf_data );
#endif // FORMATTER_DATA_H
diff --git a/ext/intl/formatter/formatter_format.c b/ext/intl/formatter/formatter_format.c
index 937cb05812..b852e54b3e 100644
--- a/ext/intl/formatter/formatter_format.c
+++ b/ext/intl/formatter/formatter_format.c
@@ -40,11 +40,11 @@ PHP_FUNCTION( numfmt_format )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oz|l",
&object, NumberFormatter_ce_ptr, &number, &type ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_format: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_format: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -69,7 +69,7 @@ PHP_FUNCTION( numfmt_format )
if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) {
SEPARATE_ZVAL_IF_NOT_REF(number);
- convert_scalar_to_number(number TSRMLS_CC );
+ convert_scalar_to_number(number );
}
switch(type) {
@@ -78,7 +78,7 @@ PHP_FUNCTION( numfmt_format )
formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number),
formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number),
formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
@@ -94,7 +94,7 @@ PHP_FUNCTION( numfmt_format )
int64_t value = (Z_TYPE_P(number) == IS_DOUBLE)?(int64_t)Z_DVAL_P(number):Z_LVAL_P(number);
formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
formatted_len = unum_formatInt64(FORMATTER_OBJECT(nfo), value, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) {
@@ -109,7 +109,7 @@ PHP_FUNCTION( numfmt_format )
convert_to_double_ex(number);
formatted_len = unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
unum_formatDouble(FORMATTER_OBJECT(nfo), Z_DVAL_P(number), formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (U_FAILURE( INTL_DATA_ERROR_CODE(nfo) ) ) {
@@ -120,7 +120,7 @@ PHP_FUNCTION( numfmt_format )
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
RETURN_FALSE;
break;
}
@@ -147,11 +147,11 @@ PHP_FUNCTION( numfmt_format_currency )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ods",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Ods",
&object, NumberFormatter_ce_ptr, &number, &currency, &currency_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_format_currency: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_format_currency: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -171,14 +171,14 @@ PHP_FUNCTION( numfmt_format_currency )
* and use it to format the number.
*/
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
- intl_error_reset(INTL_DATA_ERROR_P(nfo) TSRMLS_CC);
+ intl_error_reset(INTL_DATA_ERROR_P(nfo));
formatted = eumalloc(formatted_len);
unum_formatDoubleCurrency(FORMATTER_OBJECT(nfo), number, scurrency, formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
}
if( U_FAILURE( INTL_DATA_ERROR_CODE((nfo)) ) ) {
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) TSRMLS_CC );
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((nfo)) );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(nfo), "Number formatting failed", 0 );
RETVAL_FALSE;
if (formatted != format_buf) {
efree(formatted);
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c
index 939a8f782b..067f3bd82b 100644
--- a/ext/intl/formatter/formatter_main.c
+++ b/ext/intl/formatter/formatter_main.c
@@ -36,11 +36,11 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sl|s",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sl|s",
&locale, &locale_len, &style, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_create: unable to parse input parameters", 0 TSRMLS_CC );
+ "numfmt_create: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -56,7 +56,7 @@ static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
/* Create an ICU number formatter. */
@@ -96,7 +96,7 @@ PHP_METHOD( NumberFormatter, __construct )
numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -113,11 +113,11 @@ PHP_FUNCTION( numfmt_get_error_code )
FORMATTER_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -140,11 +140,11 @@ PHP_FUNCTION( numfmt_get_error_message )
FORMATTER_METHOD_INIT_VARS
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, NumberFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "numfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "numfmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -152,7 +152,7 @@ PHP_FUNCTION( numfmt_get_error_message )
nfo = Z_INTL_NUMBERFORMATTER_P(object);
/* Return last error message. */
- message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) TSRMLS_CC );
+ message = intl_error_get_message( INTL_DATA_ERROR_P(nfo) );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index 0959d11830..b2af74a2e0 100644
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -50,11 +50,11 @@ PHP_FUNCTION( numfmt_parse )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|lz/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os|lz/!",
&object, NumberFormatter_ce_ptr, &str, &str_len, &type, &zposition ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "number_parse: unable to parse input params", 0 TSRMLS_CC );
+ "number_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -97,7 +97,7 @@ PHP_FUNCTION( numfmt_parse )
RETVAL_DOUBLE(val_double);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported format type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unsupported format type %pd", type);
RETVAL_FALSE;
break;
}
@@ -139,11 +139,11 @@ PHP_FUNCTION( numfmt_parse_currency )
FORMATTER_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osz/|z/!",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Osz/|z/!",
&object, NumberFormatter_ce_ptr, &str, &str_len, &zcurrency, &zposition ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "number_parse_currency: unable to parse input params", 0 TSRMLS_CC );
+ "number_parse_currency: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h
index 5256a272a1..871e660639 100644
--- a/ext/intl/grapheme/grapheme.h
+++ b/ext/intl/grapheme/grapheme.h
@@ -31,6 +31,6 @@ PHP_FUNCTION(grapheme_stristr);
PHP_FUNCTION(grapheme_extract);
void grapheme_register_constants( INIT_FUNC_ARGS );
-void grapheme_close_global_iterator( TSRMLS_D );
+void grapheme_close_global_iterator( void );
#endif // GRAPHEME_GRAPHEME_H
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 55ce63955f..d5a33fe663 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -61,10 +61,10 @@ PHP_FUNCTION(grapheme_strlen)
int ret_len;
UErrorCode status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string, &string_len) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strlen: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strlen: unable to parse input param", 0 );
RETURN_FALSE;
}
@@ -80,17 +80,17 @@ PHP_FUNCTION(grapheme_strlen)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustring) {
efree( ustring );
}
RETURN_NULL();
}
- ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 TSRMLS_CC );
+ ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 );
if (ustring) {
efree( ustring );
@@ -115,17 +115,17 @@ PHP_FUNCTION(grapheme_strpos)
int32_t offset = 0;
int ret_pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -137,7 +137,7 @@ PHP_FUNCTION(grapheme_strpos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -160,7 +160,7 @@ PHP_FUNCTION(grapheme_strpos)
}
/* do utf16 part of the strpos */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ );
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -183,17 +183,17 @@ PHP_FUNCTION(grapheme_stripos)
int ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_stripos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_stripos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -205,7 +205,7 @@ PHP_FUNCTION(grapheme_stripos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_stripos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(grapheme_stripos)
}
/* do utf16 part of the strpos */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ );
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -257,17 +257,17 @@ PHP_FUNCTION(grapheme_strrpos)
int32_t ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strrpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -279,7 +279,7 @@ PHP_FUNCTION(grapheme_strrpos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos)
/* else we need to continue via utf16 */
}
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC);
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */);
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -327,17 +327,17 @@ PHP_FUNCTION(grapheme_strripos)
int32_t ret_pos;
int is_ascii;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strrpos: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strrpos: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(loffset, haystack_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 );
RETURN_FALSE;
}
@@ -349,7 +349,7 @@ PHP_FUNCTION(grapheme_strripos)
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos)
/* else we need to continue via utf16 */
}
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC);
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */);
if ( ret_pos >= 0 ) {
RETURN_LONG(ret_pos);
@@ -412,17 +412,17 @@ PHP_FUNCTION(grapheme_substr)
int sub_str_start_pos, sub_str_end_pos;
int32_t (*iter_func)(UBreakIterator *);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l", (char **)&str, &str_len, &lstart, &length) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_substr: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_substr: unable to parse input param", 0 );
RETURN_FALSE;
}
if ( OUTSIDE_STRING(lstart, str_len) ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 );
RETURN_FALSE;
}
@@ -436,7 +436,7 @@ PHP_FUNCTION(grapheme_substr)
grapheme_substr_ascii((char *)str, str_len, start, length, ZEND_NUM_ARGS(), (char **) &sub_str, &sub_str_len);
if ( NULL == sub_str ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: invalid parameters", 1 );
RETURN_FALSE;
}
@@ -450,17 +450,17 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustr) {
efree( ustr );
}
RETURN_FALSE;
}
- bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status );
if( U_FAILURE(status) ) {
RETURN_FALSE;
@@ -492,7 +492,7 @@ PHP_FUNCTION(grapheme_substr)
if ( 0 != start || sub_str_start_pos >= ustr_len ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 );
if (ustr) {
efree(ustr);
@@ -517,10 +517,10 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
if (sub_str) {
efree( sub_str );
@@ -573,7 +573,7 @@ PHP_FUNCTION(grapheme_substr)
if ( UBRK_DONE == sub_str_end_pos) {
if(length < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length not contained in string", 1 );
efree(ustr);
RETURN_FALSE;
@@ -583,7 +583,7 @@ PHP_FUNCTION(grapheme_substr)
}
if(sub_str_start_pos > sub_str_end_pos) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: length is beyond start", 1 );
efree(ustr);
RETURN_FALSE;
@@ -597,10 +597,10 @@ PHP_FUNCTION(grapheme_substr)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
if ( NULL != sub_str )
efree( sub_str );
@@ -624,17 +624,17 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
int ret_pos, uchar_pos;
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &part) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_strstr: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_strstr: unable to parse input param", 0 );
RETURN_FALSE;
}
if (needle_len == 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Empty delimiter", 1 );
RETURN_FALSE;
}
@@ -666,7 +666,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
}
/* need to work in utf16 */
- ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC );
+ ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ );
if ( ret_pos < 0 ) {
RETURN_FALSE;
@@ -829,10 +829,10 @@ PHP_FUNCTION(grapheme_extract)
int ret_pos;
zval *next = NULL; /* return offset of next part of the string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|llz", (char **)&str, &str_len, &size, &extract_type, &lstart, &next) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: unable to parse input param", 0 TSRMLS_CC );
+ "grapheme_extract: unable to parse input param", 0 );
RETURN_FALSE;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(grapheme_extract)
if ( NULL != next ) {
if ( !Z_ISREF_P(next) ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: 'next' was not passed by reference", 0 TSRMLS_CC );
+ "grapheme_extract: 'next' was not passed by reference", 0 );
RETURN_FALSE;
}
@@ -856,18 +856,18 @@ PHP_FUNCTION(grapheme_extract)
if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: unknown extract type param", 0 TSRMLS_CC );
+ "grapheme_extract: unknown extract type param", 0 );
RETURN_FALSE;
}
if ( lstart > INT32_MAX || lstart < 0 || lstart >= str_len ) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: start not contained in string", 0 );
RETURN_FALSE;
}
if ( size > INT32_MAX || size < 0) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_extract: size is invalid", 0 );
RETURN_FALSE;
}
if (size == 0) {
@@ -887,7 +887,7 @@ PHP_FUNCTION(grapheme_extract)
pstr++;
if ( pstr >= str_end ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "grapheme_extract: invalid input string", 0 TSRMLS_CC );
+ "grapheme_extract: invalid input string", 0 );
RETURN_FALSE;
}
@@ -916,10 +916,10 @@ PHP_FUNCTION(grapheme_extract)
if ( U_FAILURE( status ) ) {
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if ( NULL != ustr )
efree( ustr );
@@ -929,7 +929,7 @@ PHP_FUNCTION(grapheme_extract)
bi = NULL;
status = U_ZERO_ERROR;
- bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status );
ubrk_setText(bi, ustr, ustr_len, &status);
diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c
index 5e94eefc8a..bb4ecac084 100644
--- a/ext/intl/grapheme/grapheme_util.c
+++ b/ext/intl/grapheme/grapheme_util.c
@@ -38,7 +38,7 @@ ZEND_EXTERN_MODULE_GLOBALS( intl )
/* {{{ grapheme_close_global_iterator - clean up */
void
-grapheme_close_global_iterator( TSRMLS_D )
+grapheme_close_global_iterator( void )
{
UBreakIterator *global_break_iterator = INTL_G( grapheme_iterator );
@@ -109,8 +109,8 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
#define STRPOS_CHECK_STATUS(status, error) \
if ( U_FAILURE( (status) ) ) { \
- intl_error_set_code( NULL, (status) TSRMLS_CC ); \
- intl_error_set_custom_msg( NULL, (error), 0 TSRMLS_CC ); \
+ intl_error_set_code( NULL, (status) ); \
+ intl_error_set_custom_msg( NULL, (error), 0 ); \
if (uhaystack) { \
efree( uhaystack ); \
} \
@@ -128,7 +128,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
/* {{{ grapheme_strpos_utf16 - strrpos using utf16*/
-int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC)
+int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last)
{
UChar *uhaystack = NULL, *uneedle = NULL;
int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0;
@@ -153,7 +153,7 @@ int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigne
/* get a pointer to the haystack taking into account the offset */
status = U_ZERO_ERROR;
- bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status );
STRPOS_CHECK_STATUS(status, "Failed to get iterator");
status = U_ZERO_ERROR;
ubrk_setText(bi, uhaystack, uhaystack_len, &status);
@@ -231,14 +231,14 @@ int grapheme_ascii_check(const unsigned char *day, int32_t len)
/* }}} */
/* {{{ grapheme_split_string: find and optionally return grapheme boundaries */
-int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC )
+int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len )
{
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];
UErrorCode status = U_ZERO_ERROR;
int ret_len, pos;
UBreakIterator* bi;
- bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status TSRMLS_CC );
+ bi = grapheme_get_break_iterator((void*)u_break_iterator_buffer, &status );
if( U_FAILURE(status) ) {
return -1;
@@ -374,7 +374,7 @@ grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned c
/* }}} */
/* {{{ grapheme_get_break_iterator: get a clone of the global character break iterator */
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC )
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status )
{
int32_t buffer_size;
diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h
index a66796d80d..99021287fa 100644
--- a/ext/intl/grapheme/grapheme_util.h
+++ b/ext/intl/grapheme/grapheme_util.h
@@ -21,17 +21,17 @@
#include "intl_convert.h"
/* get_break_interator: get a break iterator from the global structure */
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC );
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
void grapheme_substr_ascii(char *str, int32_t str_len, int32_t f, int32_t l, int argc, char **sub_str, int *sub_str_len);
-int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case TSRMLS_DC);
+int grapheme_strrpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int f_ignore_case);
-int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last TSRMLS_DC);
+int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int *puchar_pos, int f_ignore_case, int last);
int grapheme_ascii_check(const unsigned char *day, int32_t len);
-int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len TSRMLS_DC );
+int grapheme_split_string(const UChar *text, int32_t text_length, int boundary_array[], int boundary_array_len );
int32_t grapheme_count_graphemes(UBreakIterator *bi, UChar *string, int32_t string_len);
@@ -41,7 +41,7 @@ int grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset);
int32_t grapheme_strrpos_ascii(unsigned char *haystack, int32_t haystack_len, unsigned char *needle, int32_t needle_len, int32_t offset);
-UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC );
+UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status );
/* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */
#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (zend_long) max_len : offset >= (zend_long) max_len) )
diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c
index 1d07dbba80..0848be94a7 100644
--- a/ext/intl/idn/idn.c
+++ b/ext/intl/idn/idn.c
@@ -111,15 +111,15 @@ enum {
};
/* like INTL_CHECK_STATUS, but as a function and varying the name of the func */
-static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode TSRMLS_DC)
+static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode)
{
- intl_error_set_code(NULL, err TSRMLS_CC);
+ intl_error_set_code(NULL, err);
if (U_FAILURE(err)) {
char *buff;
spprintf(&buff, 0, "%s: %s",
mode == INTL_IDN_TO_ASCII ? "idn_to_ascii" : "idn_to_utf8",
msg);
- intl_error_set_custom_msg(NULL, buff, 1 TSRMLS_CC);
+ intl_error_set_custom_msg(NULL, buff, 1);
efree(buff);
return FAILURE;
}
@@ -127,9 +127,9 @@ static int php_intl_idn_check_status(UErrorCode err, const char *msg, int mode T
return SUCCESS;
}
-static inline void php_intl_bad_args(const char *msg, int mode TSRMLS_DC)
+static inline void php_intl_bad_args(const char *msg, int mode)
{
- php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode TSRMLS_CC);
+ php_intl_idn_check_status(U_ILLEGAL_ARGUMENT_ERROR, msg, mode);
}
#ifdef HAVE_46_API
@@ -146,7 +146,7 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
uts46 = uidna_openUTS46(option, &status);
if (php_intl_idn_check_status(status, "failed to open UIDNA instance",
- mode TSRMLS_CC) == FAILURE) {
+ mode) == FAILURE) {
zend_string_free(buffer);
RETURN_FALSE;
}
@@ -159,13 +159,13 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
buffer->val, buffer_capac, &info, &status);
}
if (php_intl_idn_check_status(status, "failed to convert name",
- mode TSRMLS_CC) == FAILURE) {
+ mode) == FAILURE) {
uidna_close(uts46);
zend_string_free(buffer);
RETURN_FALSE;
}
if (len >= 255) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "ICU returned an unexpected length");
+ php_error_docref(NULL, E_ERROR, "ICU returned an unexpected length");
}
buffer->val[len] = '\0';
@@ -217,10 +217,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
intl_convert_utf8_to_utf16(&ustring, &ustring_len, domain, domain_len, &status);
if (U_FAILURE(status)) {
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (ustring) {
efree(ustring);
}
@@ -237,7 +237,7 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
efree(ustring);
if (U_FAILURE(status)) {
- intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 TSRMLS_CC );
+ intl_error_set( NULL, status, "idn_to_ascii: cannot convert to ASCII", 0 );
RETURN_FALSE;
}
@@ -246,10 +246,10 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
if (U_FAILURE(status)) {
/* Set global error code. */
- intl_error_set_code(NULL, status TSRMLS_CC);
+ intl_error_set_code(NULL, status);
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 );
efree(converted_utf8);
RETURN_FALSE;
}
@@ -269,42 +269,42 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
variant = INTL_IDN_VARIANT_2003;
zval *idna_info = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|llz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|llz/",
&domain, &domain_len, &option, &variant, &idna_info) == FAILURE) {
- php_intl_bad_args("bad arguments", mode TSRMLS_CC);
+ php_intl_bad_args("bad arguments", mode);
RETURN_NULL(); /* don't set FALSE because that's not the way it was before... */
}
#ifdef HAVE_46_API
if (variant != INTL_IDN_VARIANT_2003 && variant != INTL_IDN_VARIANT_UTS46) {
php_intl_bad_args("invalid variant, must be one of {"
- "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode TSRMLS_CC);
+ "INTL_IDNA_VARIANT_2003, INTL_IDNA_VARIANT_UTS46}", mode);
RETURN_FALSE;
}
#else
if (variant != INTL_IDN_VARIANT_2003) {
php_intl_bad_args("invalid variant, PHP was compiled against "
"an old version of ICU and only supports INTL_IDN_VARIANT_2003",
- mode TSRMLS_CC);
+ mode);
RETURN_FALSE;
}
#endif
if (domain_len < 1) {
- php_intl_bad_args("empty domain name", mode TSRMLS_CC);
+ php_intl_bad_args("empty domain name", mode);
RETURN_FALSE;
}
if (domain_len > INT32_MAX - 1) {
- php_intl_bad_args("domain name too large", mode TSRMLS_CC);
+ php_intl_bad_args("domain name too large", mode);
RETURN_FALSE;
}
/* don't check options; it wasn't checked before */
if (idna_info != NULL) {
if (variant == INTL_IDN_VARIANT_2003) {
- php_error_docref0(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref0(NULL, E_NOTICE,
"4 arguments were provided, but INTL_IDNA_VARIANT_2003 only "
"takes 3 - extra argument ignored");
} else {
diff --git a/ext/intl/intl_data.h b/ext/intl/intl_data.h
index a7afb36be9..6467d40909 100644
--- a/ext/intl/intl_data.h
+++ b/ext/intl/intl_data.h
@@ -35,7 +35,7 @@ typedef struct _intl_data {
#define INTL_METHOD_INIT_VARS(oclass, obj) \
zval* object = NULL; \
oclass##_object* obj = NULL; \
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
#define INTL_DATA_ERROR(obj) (((intl_object *)(obj))->error)
#define INTL_DATA_ERROR_P(obj) (&(INTL_DATA_ERROR((obj))))
@@ -43,32 +43,32 @@ typedef struct _intl_data {
#define INTL_METHOD_FETCH_OBJECT(oclass, obj) \
obj = Z_##oclass##_P( object ); \
- intl_error_reset( INTL_DATA_ERROR_P(obj) TSRMLS_CC ); \
+ intl_error_reset( INTL_DATA_ERROR_P(obj) ); \
/* Check status by error code, if error - exit */
#define INTL_CHECK_STATUS(err, msg) \
- intl_error_set_code( NULL, (err) TSRMLS_CC ); \
+ intl_error_set_code( NULL, (err) ); \
if( U_FAILURE((err)) ) \
{ \
- intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC ); \
+ intl_error_set_custom_msg( NULL, msg, 0 ); \
RETURN_FALSE; \
}
/* Check status in object, if error - exit */
#define INTL_METHOD_CHECK_STATUS(obj, msg) \
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
RETURN_FALSE; \
}
/* Check status, if error - destroy value and exit */
#define INTL_CTOR_CHECK_STATUS(obj, msg) \
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) TSRMLS_CC ); \
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE((obj)) ); \
if( U_FAILURE( INTL_DATA_ERROR_CODE((obj)) ) ) \
{ \
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 TSRMLS_CC ); \
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P((obj)), msg, 0 ); \
/* yes, this is ugly, but it alreay is */ \
if (return_value != getThis()) { \
zval_dtor(return_value); \
@@ -96,14 +96,14 @@ typedef struct _intl_data {
#define INTL_CHECK_LOCALE_LEN(locale_len) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 ); \
RETURN_NULL(); \
}
#define INTL_CHECK_LOCALE_LEN_OBJ(locale_len, object) \
if((locale_len) > INTL_MAX_LOCALE_LEN) { \
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, \
- "Locale string too long, should be no longer than 80 characters", 0 TSRMLS_CC ); \
+ "Locale string too long, should be no longer than 80 characters", 0 ); \
zval_dtor(object); \
ZVAL_NULL(object); \
RETURN_NULL(); \
diff --git a/ext/intl/intl_error.c b/ext/intl/intl_error.c
index 9474834417..046fd5302d 100644
--- a/ext/intl/intl_error.c
+++ b/ext/intl/intl_error.c
@@ -34,7 +34,7 @@ static zend_class_entry *IntlException_ce_ptr;
/* {{{ intl_error* intl_g_error_get()
* Return global error structure.
*/
-static intl_error* intl_g_error_get( TSRMLS_D )
+static intl_error* intl_g_error_get( void )
{
return &INTL_G( g_error );
}
@@ -43,9 +43,9 @@ static intl_error* intl_g_error_get( TSRMLS_D )
/* {{{ void intl_free_custom_error_msg( intl_error* err )
* Free mem.
*/
-static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC )
+static void intl_free_custom_error_msg( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
if(err->free_custom_error_message ) {
@@ -60,11 +60,11 @@ static void intl_free_custom_error_msg( intl_error* err TSRMLS_DC )
/* {{{ intl_error* intl_error_create()
* Create and initialize internals of 'intl_error'.
*/
-intl_error* intl_error_create( TSRMLS_D )
+intl_error* intl_error_create( void )
{
intl_error* err = ecalloc( 1, sizeof( intl_error ) );
- intl_error_init( err TSRMLS_CC );
+ intl_error_init( err );
return err;
}
@@ -73,9 +73,9 @@ intl_error* intl_error_create( TSRMLS_D )
/* {{{ void intl_error_init( intl_error* coll_error )
* Initialize internals of 'intl_error'.
*/
-void intl_error_init( intl_error* err TSRMLS_DC )
+void intl_error_init( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = U_ZERO_ERROR;
@@ -87,36 +87,36 @@ void intl_error_init( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_reset( intl_error* err )
* Set last error code to 0 and unset last error message
*/
-void intl_error_reset( intl_error* err TSRMLS_DC )
+void intl_error_reset( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = U_ZERO_ERROR;
- intl_free_custom_error_msg( err TSRMLS_CC );
+ intl_free_custom_error_msg( err );
}
/* }}} */
/* {{{ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
* Set last error message to msg copying it if needed.
*/
-void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
+void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg )
{
if( !msg )
return;
if( !err ) {
if( INTL_G( error_level ) )
- php_error_docref( NULL TSRMLS_CC, INTL_G( error_level ), "%s", msg );
+ php_error_docref( NULL, INTL_G( error_level ), "%s", msg );
if( INTL_G( use_exceptions ) )
- zend_throw_exception_ex( IntlException_ce_ptr, 0 TSRMLS_CC, "%s", msg );
+ zend_throw_exception_ex( IntlException_ce_ptr, 0, "%s", msg );
}
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
/* Free previous message if any */
- intl_free_custom_error_msg( err TSRMLS_CC );
+ intl_free_custom_error_msg( err );
/* Mark message copied if any */
err->free_custom_error_message = copyMsg;
@@ -129,12 +129,12 @@ void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_D
/* {{{ const char* intl_error_get_message( intl_error* err )
* Create output message in format "<intl_error_text>: <extra_user_error_text>".
*/
-zend_string * intl_error_get_message( intl_error* err TSRMLS_DC )
+zend_string * intl_error_get_message( intl_error* err )
{
const char *uErrorName = NULL;
zend_string *errMessage = 0;
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return STR_EMPTY_ALLOC();
uErrorName = u_errorName( err->code );
@@ -156,9 +156,9 @@ zend_string * intl_error_get_message( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_set_code( intl_error* err, UErrorCode err_code )
* Set last error code.
*/
-void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
+void intl_error_set_code( intl_error* err, UErrorCode err_code )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return;
err->code = err_code;
@@ -168,9 +168,9 @@ void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
/* {{{ void intl_error_get_code( intl_error* err )
* Return last error code.
*/
-UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC )
+UErrorCode intl_error_get_code( intl_error* err )
{
- if( !err && !( err = intl_g_error_get( TSRMLS_C ) ) )
+ if( !err && !( err = intl_g_error_get( ) ) )
return U_ZERO_ERROR;
return err->code;
@@ -180,67 +180,67 @@ UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC )
/* {{{ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
+void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
{
- intl_error_set_code( err, code TSRMLS_CC );
- intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_error_set_code( err, code );
+ intl_error_set_custom_msg( err, msg, copyMsg );
}
/* }}} */
/* {{{ void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
* Set error code and message.
*/
-void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
+void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg )
{
- intl_errors_set_code( err, code TSRMLS_CC );
- intl_errors_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_errors_set_code( err, code );
+ intl_errors_set_custom_msg( err, msg, copyMsg );
}
/* }}} */
/* {{{ void intl_errors_reset( intl_error* err )
*/
-void intl_errors_reset( intl_error* err TSRMLS_DC )
+void intl_errors_reset( intl_error* err )
{
if(err) {
- intl_error_reset( err TSRMLS_CC );
+ intl_error_reset( err );
}
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
}
/* }}} */
/* {{{ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
*/
-void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
+void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg )
{
if(err) {
- intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+ intl_error_set_custom_msg( err, msg, copyMsg );
}
- intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, msg, copyMsg );
}
/* }}} */
/* {{{ intl_errors_set_code( intl_error* err, UErrorCode err_code )
*/
-void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
+void intl_errors_set_code( intl_error* err, UErrorCode err_code )
{
if(err) {
- intl_error_set_code( err, err_code TSRMLS_CC );
+ intl_error_set_code( err, err_code );
}
- intl_error_set_code( NULL, err_code TSRMLS_CC );
+ intl_error_set_code( NULL, err_code );
}
/* }}} */
-void intl_register_IntlException_class( TSRMLS_D )
+void intl_register_IntlException_class( void )
{
zend_class_entry ce,
*default_exception_ce;
- default_exception_ce = zend_exception_get_default( TSRMLS_C );
+ default_exception_ce = zend_exception_get_default( );
/* Create and register 'IntlException' class. */
INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
- default_exception_ce TSRMLS_CC );
+ default_exception_ce );
IntlException_ce_ptr->create_object = default_exception_ce->create_object;
}
diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h
index b800d10dbf..02d62f0299 100644
--- a/ext/intl/intl_error.h
+++ b/ext/intl/intl_error.h
@@ -31,25 +31,25 @@ typedef struct _intl_error {
int free_custom_error_message;
} intl_error;
-intl_error* intl_error_create( TSRMLS_D );
-void intl_error_init( intl_error* err TSRMLS_DC );
-void intl_error_reset( intl_error* err TSRMLS_DC );
-void intl_error_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC );
-void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC );
-void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC );
-UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC );
-zend_string* intl_error_get_message( intl_error* err TSRMLS_DC );
+intl_error* intl_error_create( void );
+void intl_error_init( intl_error* err );
+void intl_error_reset( intl_error* err );
+void intl_error_set_code( intl_error* err, UErrorCode err_code );
+void intl_error_set_custom_msg( intl_error* err, char* msg, int copyMsg );
+void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg );
+UErrorCode intl_error_get_code( intl_error* err );
+zend_string* intl_error_get_message( intl_error* err );
// Wrappers to synchonize object's and global error structures.
-void intl_errors_reset( intl_error* err TSRMLS_DC );
-void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC );
-void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC );
-void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC );
+void intl_errors_reset( intl_error* err );
+void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg );
+void intl_errors_set_code( intl_error* err, UErrorCode err_code );
+void intl_errors_set( intl_error* err, UErrorCode code, char* msg, int copyMsg );
// Other error helpers
smart_str intl_parse_error_to_string( UParseError* pe );
// exported to be called on extension MINIT
-void intl_register_IntlException_class( TSRMLS_D );
+void intl_register_IntlException_class( void );
#endif // INTL_ERROR_H
diff --git a/ext/intl/locale/locale.c b/ext/intl/locale/locale.c
index 21c875ca5d..05141a9558 100644
--- a/ext/intl/locale/locale.c
+++ b/ext/intl/locale/locale.c
@@ -40,13 +40,13 @@ void locale_register_constants( INIT_FUNC_ARGS )
}
#define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC );
- #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x );
+ #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value );
LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE );
LOCALE_EXPOSE_CLASS_CONST( VALID_LOCALE );
- zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1 TSRMLS_CC);
+ zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1);
LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "LANG_TAG", LOC_LANG_TAG);
LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "EXTLANG_TAG", LOC_EXTLANG_TAG);
diff --git a/ext/intl/locale/locale_class.c b/ext/intl/locale/locale_class.c
index eec4699b6d..6300666c59 100644
--- a/ext/intl/locale/locale_class.c
+++ b/ext/intl/locale/locale_class.c
@@ -92,14 +92,14 @@ zend_function_entry Locale_class_functions[] = {
/* {{{ locale_register_Locale_class
* Initialize 'Locale' class
*/
-void locale_register_Locale_class( TSRMLS_D )
+void locale_register_Locale_class( void )
{
zend_class_entry ce;
/* Create and register 'Locale' class. */
INIT_CLASS_ENTRY( ce, "Locale", Locale_class_functions );
ce.create_object = NULL;
- Locale_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Locale_ce_ptr = zend_register_internal_class( &ce );
/* Declare 'Locale' class properties. */
if( !Locale_ce_ptr )
diff --git a/ext/intl/locale/locale_class.h b/ext/intl/locale/locale_class.h
index afae06c77c..1ff4df3a53 100644
--- a/ext/intl/locale/locale_class.h
+++ b/ext/intl/locale/locale_class.h
@@ -35,7 +35,7 @@ typedef struct {
} Locale_object;
-void locale_register_Locale_class( TSRMLS_D );
+void locale_register_Locale_class( void );
extern zend_class_entry *Locale_ce_ptr;
@@ -43,6 +43,6 @@ extern zend_class_entry *Locale_ce_ptr;
#define LOCALE_METHOD_INIT_VARS \
zval* object = NULL; \
- intl_error_reset( NULL TSRMLS_CC ); \
+ intl_error_reset( NULL ); \
#endif // #ifndef LOCALE_CLASS_H
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 27f917ffbb..e8f51398e6 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -211,7 +211,7 @@ static int getSingletonPos(const char* str)
Get default locale */
PHP_NAMED_FUNCTION(zif_locale_get_default)
{
- RETURN_STRING( intl_locale_get_default( TSRMLS_C ) );
+ RETURN_STRING( intl_locale_get_default( ) );
}
/* }}} */
@@ -227,10 +227,10 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
zend_string *ini_name;
char *default_locale = NULL;
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "S", &locale_name) == FAILURE)
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "S", &locale_name) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_set_default: unable to parse input params", 0 TSRMLS_CC );
+ "locale_set_default: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -385,19 +385,19 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name ,&loc_name_len ) == FAILURE) {
spprintf(&msg , 0, "locale_get_%s : unable to parse input params", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
/* Call ICU get */
@@ -422,7 +422,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
/* Error encountered while fetching the value */
if( result ==0) {
spprintf(&msg , 0, "locale_get_%s : unable to get locale %s", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
RETURN_NULL();
}
@@ -493,14 +493,14 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
char* msg = NULL;
int grOffset = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s|s",
&loc_name, &loc_name_len ,
&disp_loc_name ,&disp_loc_name_len ) == FAILURE)
{
spprintf(&msg , 0, "locale_get_display_%s : unable to parse input params", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
@@ -508,13 +508,13 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
if( strcmp(tag_name, DISP_NAME) != 0 ){
@@ -536,7 +536,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
/* Check if disp_loc_name passed , if not use default locale */
if( !disp_loc_name){
- disp_loc_name = estrdup(intl_locale_get_default(TSRMLS_C));
+ disp_loc_name = estrdup(intl_locale_get_default());
free_loc_name = 1;
}
@@ -567,7 +567,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
}
spprintf(&msg, 0, "locale_get_display_%s : unable to get locale %s", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
if( disp_name){
efree( disp_name );
@@ -596,7 +596,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
if( U_FAILURE( status ) )
{
spprintf(&msg, 0, "locale_get_display_%s :error converting display name for %s to UTF-8", tag_name , tag_name );
- intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
+ intl_error_set( NULL, status, msg , 1 );
efree(msg);
RETURN_FALSE;
}
@@ -698,19 +698,19 @@ PHP_FUNCTION( locale_get_keywords )
char* kw_value = NULL;
int32_t kw_value_len = 100;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_get_keywords: unable to parse input params", 0 TSRMLS_CC );
+ "locale_get_keywords: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
/* Get the keywords */
@@ -733,7 +733,7 @@ PHP_FUNCTION( locale_get_keywords )
kw_value = erealloc( kw_value , kw_value_len+1);
}
if (U_FAILURE(status)) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 );
if( kw_value){
efree( kw_value );
}
@@ -811,7 +811,7 @@ static void add_prefix(smart_str* loc_name, char* key_name)
* returns 1 if successful , -1 if not found ,
* 0 if array element is not a string , -2 if buffer-overflow
*/
-static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name TSRMLS_DC)
+static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name)
{
zval *ele_value;
int i = 0;
@@ -885,12 +885,12 @@ static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr,
* returns 0 if locale_compose needs to be aborted
* otherwise returns 1
*/
-static int handleAppendResult( int result, smart_str* loc_name TSRMLS_DC)
+static int handleAppendResult( int result, smart_str* loc_name)
{
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( result == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: parameter array element is not a string", 0 TSRMLS_CC );
+ "locale_compose: parameter array element is not a string", 0 );
smart_str_free(loc_name);
return 0;
}
@@ -913,13 +913,13 @@ PHP_FUNCTION(locale_compose)
HashTable* hash_arr = NULL;
int result = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "a",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "a",
&arr) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: unable to parse input params", 0 TSRMLS_CC );
+ "locale_compose: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -933,7 +933,7 @@ PHP_FUNCTION(locale_compose)
if( result == SUCCESS){
RETURN_SMART_STR(loc_name);
}
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
@@ -941,41 +941,41 @@ PHP_FUNCTION(locale_compose)
result = append_key_value(loc_name, hash_arr , LOC_LANG_TAG);
if( result == LOC_NOT_FOUND ){
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_compose: parameter array does not contain 'language' tag.", 0 TSRMLS_CC );
+ "locale_compose: parameter array does not contain 'language' tag.", 0 );
smart_str_free(loc_name);
RETURN_FALSE;
}
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Extlang */
- result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values(loc_name, hash_arr , LOC_EXTLANG_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Script */
result = append_key_value(loc_name, hash_arr , LOC_SCRIPT_TAG);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Region */
result = append_key_value( loc_name, hash_arr , LOC_REGION_TAG);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Variant */
- result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values( loc_name, hash_arr , LOC_VARIANT_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
/* Private */
- result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG TSRMLS_CC);
- if( !handleAppendResult( result, loc_name TSRMLS_CC)){
+ result = append_multiple_key_values( loc_name, hash_arr , LOC_PRIVATE_TAG);
+ if( !handleAppendResult( result, loc_name)){
RETURN_FALSE;
}
@@ -1035,7 +1035,7 @@ static char* get_private_subtags(const char* loc_name)
/* {{{ code used by locale_parse
*/
-static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC)
+static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name)
{
char* key_value = NULL;
char* cur_key_name = NULL;
@@ -1104,19 +1104,19 @@ PHP_FUNCTION(locale_parse)
size_t loc_name_len = 0;
int grOffset = 0;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_parse: unable to parse input params", 0 TSRMLS_CC );
+ "locale_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
array_init( return_value );
@@ -1127,11 +1127,11 @@ PHP_FUNCTION(locale_parse)
}
else{
/* Not grandfathered */
- add_array_entry( loc_name , return_value , LOC_LANG_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_REGION_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_VARIANT_TAG TSRMLS_CC);
- add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG TSRMLS_CC);
+ add_array_entry( loc_name , return_value , LOC_LANG_TAG);
+ add_array_entry( loc_name , return_value , LOC_SCRIPT_TAG);
+ add_array_entry( loc_name , return_value , LOC_REGION_TAG);
+ add_array_entry( loc_name , return_value , LOC_VARIANT_TAG);
+ add_array_entry( loc_name , return_value , LOC_PRIVATE_TAG);
}
}
/* }}} */
@@ -1152,19 +1152,19 @@ PHP_FUNCTION(locale_get_all_variants)
char* variant = NULL;
char* saved_ptr = NULL;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_parse: unable to parse input params", 0 TSRMLS_CC );
+ "locale_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_name_len == 0) {
- loc_name = intl_locale_get_default(TSRMLS_C);
+ loc_name = intl_locale_get_default();
}
@@ -1257,20 +1257,20 @@ PHP_FUNCTION(locale_filter_matches)
zend_bool boolCanonical = 0;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b",
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "ss|b",
&lang_tag, &lang_tag_len , &loc_range , &loc_range_len ,
&boolCanonical) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_filter_matches: unable to parse input params", 0 TSRMLS_CC );
+ "locale_filter_matches: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_range_len == 0) {
- loc_range = intl_locale_get_default(TSRMLS_C);
+ loc_range = intl_locale_get_default();
}
if( strcmp(loc_range,"*")==0){
@@ -1282,7 +1282,7 @@ PHP_FUNCTION(locale_filter_matches)
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
if( result ==0) {
intl_error_set( NULL, status,
- "locale_filter_matches : unable to canonicalize loc_range" , 0 TSRMLS_CC );
+ "locale_filter_matches : unable to canonicalize loc_range" , 0 );
RETURN_FALSE;
}
@@ -1290,7 +1290,7 @@ PHP_FUNCTION(locale_filter_matches)
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
if( result ==0) {
intl_error_set( NULL, status,
- "locale_filter_matches : unable to canonicalize lang_tag" , 0 TSRMLS_CC );
+ "locale_filter_matches : unable to canonicalize lang_tag" , 0 );
RETURN_FALSE;
}
@@ -1417,7 +1417,7 @@ static void array_cleanup( char* arr[] , int arr_size)
* returns the lookup result to lookup_loc_range_src_php
* internal function
*/
-static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC)
+static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize )
{
int i = 0;
int cur_arr_len = 0;
@@ -1438,13 +1438,13 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
/* convert the array to lowercase , also replace hyphens with the underscore and store it in cur_arr */
if(Z_TYPE_P(ele_value)!= IS_STRING) {
/* element value is not a string */
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: locale array element is not a string", 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[cur_arr_len*2] = estrndup(Z_STRVAL_P(ele_value), Z_STRLEN_P(ele_value));
result = strToMatch(Z_STRVAL_P(ele_value), cur_arr[cur_arr_len*2]);
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag", 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[cur_arr_len*2+1] = Z_STRVAL_P(ele_value);
@@ -1459,14 +1459,14 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
if(lang_tag) {
efree(lang_tag);
}
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
cur_arr[i*2] = erealloc(cur_arr[i*2], strlen(lang_tag)+1);
result = strToMatch(lang_tag, cur_arr[i*2]);
efree(lang_tag);
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
}
@@ -1478,7 +1478,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
can_loc_range = get_icu_value_internal(loc_range, LOC_CANONICALIZE_TAG, &result , 0);
if( result != 1 || can_loc_range == NULL || !can_loc_range[0]) {
/* Error */
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 TSRMLS_CC );
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize loc_range" , 0 );
if(can_loc_range) {
efree(can_loc_range);
}
@@ -1495,7 +1495,7 @@ static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int ca
efree(can_loc_range);
}
if(result == 0) {
- intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0 TSRMLS_CC);
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}
@@ -1540,16 +1540,16 @@ PHP_FUNCTION(locale_lookup)
zend_bool boolCanonical = 0;
char* result =NULL;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "as|bs", &arr, &loc_range, &loc_range_len,
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bs", &arr, &loc_range, &loc_range_len,
&boolCanonical, &fallback_loc, &fallback_loc_len) == FAILURE) {
- intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 TSRMLS_CC );
+ intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
RETURN_FALSE;
}
if(loc_range_len == 0) {
- loc_range = intl_locale_get_default(TSRMLS_C);
+ loc_range = intl_locale_get_default();
}
hash_arr = HASH_OF(arr);
@@ -1558,7 +1558,7 @@ PHP_FUNCTION(locale_lookup)
RETURN_EMPTY_STRING();
}
- result = lookup_loc_range(loc_range, hash_arr, boolCanonical TSRMLS_CC);
+ result = lookup_loc_range(loc_range, hash_arr, boolCanonical);
if(result == NULL || result[0] == '\0') {
if( fallback_loc ) {
result = estrndup(fallback_loc, fallback_loc_len);
@@ -1590,10 +1590,10 @@ PHP_FUNCTION(locale_accept_from_http)
char resultLocale[INTL_MAX_LOCALE_LEN+1];
UAcceptResult outResult;
- if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &http_accept, &http_accept_len) == FAILURE)
+ if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", &http_accept, &http_accept_len) == FAILURE)
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "locale_accept_from_http: unable to parse input parameters", 0 TSRMLS_CC );
+ "locale_accept_from_http: unable to parse input parameters", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 2ca8ed9186..a9999dc141 100644
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -35,15 +35,15 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
int spattern_len = 0;
zval* object;
MessageFormatter_object* mfo;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
object = return_value;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "ss",
&locale, &locale_len, &pattern, &pattern_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_create: unable to parse input parameters", 0 TSRMLS_CC );
+ "msgfmt_create: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -61,7 +61,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
}
if(locale_len == 0) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
@@ -71,7 +71,7 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
#endif
if ((mfo)->mf_data.orig_format) {
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
@@ -114,7 +114,7 @@ PHP_METHOD( MessageFormatter, __construct )
msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -132,11 +132,11 @@ PHP_FUNCTION( msgfmt_get_error_code )
MessageFormatter_object* mfo = NULL;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -160,11 +160,11 @@ PHP_FUNCTION( msgfmt_get_error_message )
MessageFormatter_object* mfo = NULL;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -172,7 +172,7 @@ PHP_FUNCTION( msgfmt_get_error_message )
mfo = Z_INTL_MESSAGEFORMATTER_P( object );
/* Return last error message. */
- message = intl_error_get_message( &mfo->mf_data.error TSRMLS_CC );
+ message = intl_error_get_message( &mfo->mf_data.error );
RETURN_STR(message);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index 79c04266e0..ca117c539f 100644
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -36,10 +36,10 @@ PHP_FUNCTION( msgfmt_get_pattern )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_pattern: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_pattern: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -68,11 +68,11 @@ PHP_FUNCTION( msgfmt_set_pattern )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, MessageFormatter_ce_ptr, &value, &value_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_set_pattern: unable to parse input params", 0 TSRMLS_CC);
+ "msgfmt_set_pattern: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -85,7 +85,7 @@ PHP_FUNCTION( msgfmt_set_pattern )
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -124,11 +124,11 @@ PHP_FUNCTION( msgfmt_get_locale )
MSG_FORMAT_METHOD_INIT_VARS;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, MessageFormatter_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_get_locale: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_get_locale: unable to parse input params", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 65f32bf683..9fdd07e607 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -34,31 +34,31 @@ static zend_object_handlers MessageFormatter_handlers;
*/
/* {{{ MessageFormatter_objects_dtor */
-static void MessageFormatter_object_dtor(zend_object *object TSRMLS_DC )
+static void MessageFormatter_object_dtor(zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ MessageFormatter_objects_free */
-void MessageFormatter_object_free( zend_object *object TSRMLS_DC )
+void MessageFormatter_object_free( zend_object *object )
{
MessageFormatter_object* mfo = php_intl_messageformatter_fetch_object(object);
- zend_object_std_dtor( &mfo->zo TSRMLS_CC );
+ zend_object_std_dtor( &mfo->zo );
- msgformat_data_free( &mfo->mf_data TSRMLS_CC );
+ msgformat_data_free( &mfo->mf_data );
}
/* }}} */
/* {{{ MessageFormatter_object_create */
-zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
+zend_object *MessageFormatter_object_create(zend_class_entry *ce)
{
MessageFormatter_object* intern;
intern = ecalloc( 1, sizeof(MessageFormatter_object) + sizeof(zval) * (ce->default_properties_count - 1));
- msgformat_data_init( &intern->mf_data TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ msgformat_data_init( &intern->mf_data );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &MessageFormatter_handlers;
@@ -68,16 +68,16 @@ zend_object *MessageFormatter_object_create(zend_class_entry *ce TSRMLS_DC)
/* }}} */
/* {{{ MessageFormatter_object_clone */
-zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
+zend_object *MessageFormatter_object_clone(zval *object)
{
MessageFormatter_object *mfo, *new_mfo;
zend_object *new_obj;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object));
new_mfo = php_intl_messageformatter_fetch_object(new_obj);
/* clone standard parts */
- zend_objects_clone_members(&new_mfo->zo, &mfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_mfo->zo, &mfo->zo);
/* clone formatter object */
if (MSG_FORMAT_OBJECT(mfo) != NULL) {
@@ -86,11 +86,11 @@ zend_object *MessageFormatter_object_clone(zval *object TSRMLS_DC)
if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
intl_errors_set(INTL_DATA_ERROR_P(mfo), INTL_DATA_ERROR_CODE(mfo),
- "Failed to clone MessageFormatter object", 0 TSRMLS_CC);
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to clone MessageFormatter object");
+ "Failed to clone MessageFormatter object", 0);
+ zend_throw_exception_ex(NULL, 0, "Failed to clone MessageFormatter object");
}
} else {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Cannot clone unconstructed MessageFormatter");
+ zend_throw_exception_ex(NULL, 0, "Cannot clone unconstructed MessageFormatter");
}
return new_obj;
}
@@ -150,14 +150,14 @@ static zend_function_entry MessageFormatter_class_functions[] = {
/* {{{ msgformat_register_class
* Initialize 'MessageFormatter' class
*/
-void msgformat_register_class( TSRMLS_D )
+void msgformat_register_class( void )
{
zend_class_entry ce;
/* Create and register 'MessageFormatter' class. */
INIT_CLASS_ENTRY( ce, "MessageFormatter", MessageFormatter_class_functions );
ce.create_object = MessageFormatter_object_create;
- MessageFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ MessageFormatter_ce_ptr = zend_register_internal_class( &ce );
memcpy(&MessageFormatter_handlers, zend_get_std_object_handlers(),
sizeof MessageFormatter_handlers);
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 8c2c29a7dd..a90042e58f 100644
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -37,7 +37,7 @@ static inline MessageFormatter_object *php_intl_messageformatter_fetch_object(ze
}
#define Z_INTL_MESSAGEFORMATTER_P(zv) php_intl_messageformatter_fetch_object(Z_OBJ_P(zv))
-void msgformat_register_class( TSRMLS_D );
+void msgformat_register_class( void );
extern zend_class_entry *MessageFormatter_ce_ptr;
/* Auxiliary macros */
@@ -48,7 +48,7 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
if (MSG_FORMAT_OBJECT(mfo) == NULL) { \
intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \
+ "Found unconstructed MessageFormatter", 0); \
RETURN_FALSE; \
}
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index f94920d3e8..697fba114a 100644
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -26,7 +26,7 @@
/* {{{ void msgformat_data_init( msgformat_data* mf_data )
* Initialize internals of msgformat_data.
*/
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
+void msgformat_data_init( msgformat_data* mf_data )
{
if( !mf_data )
return;
@@ -35,14 +35,14 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
mf_data->orig_format = NULL;
mf_data->arg_types = NULL;
mf_data->tz_set = 0;
- intl_error_reset( &mf_data->error TSRMLS_CC );
+ intl_error_reset( &mf_data->error );
}
/* }}} */
/* {{{ void msgformat_data_free( msgformat_data* mf_data )
* Clean up memory allocated for msgformat_data
*/
-void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
+void msgformat_data_free(msgformat_data* mf_data)
{
if (!mf_data)
return;
@@ -62,18 +62,18 @@ void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
}
mf_data->umsgf = NULL;
- intl_error_reset(&mf_data->error TSRMLS_CC);
+ intl_error_reset(&mf_data->error);
}
/* }}} */
/* {{{ msgformat_data* msgformat_data_create()
* Allocate memory for msgformat_data and initialize it with default values.
*/
-msgformat_data* msgformat_data_create( TSRMLS_D )
+msgformat_data* msgformat_data_create( void )
{
msgformat_data* mf_data = ecalloc( 1, sizeof(msgformat_data) );
- msgformat_data_init( mf_data TSRMLS_CC );
+ msgformat_data_init( mf_data );
return mf_data;
}
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index f3a594d25a..a4226664ae 100644
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -35,9 +35,9 @@ typedef struct {
int tz_set; /* if we've already the time zone in sub-formats */
} msgformat_data;
-msgformat_data* msgformat_data_create( TSRMLS_D );
-void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
-void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
+msgformat_data* msgformat_data_create( void );
+void msgformat_data_init( msgformat_data* mf_data );
+void msgformat_data_free( msgformat_data* mf_data );
#ifdef MSG_FORMAT_QUOTE_APOS
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 36cd61c685..dda72249fc 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -32,7 +32,7 @@
#endif
/* {{{ */
-static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC)
+static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value)
{
int count;
UChar* formatted = NULL;
@@ -45,7 +45,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref);
- umsg_format_helper(mfo, args_copy, &formatted, &formatted_len TSRMLS_CC);
+ umsg_format_helper(mfo, args_copy, &formatted, &formatted_len);
zend_hash_destroy(args_copy);
efree(args_copy);
@@ -74,11 +74,11 @@ PHP_FUNCTION( msgfmt_format )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oa",
&object, MessageFormatter_ce_ptr, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -86,7 +86,7 @@ PHP_FUNCTION( msgfmt_format )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
}
/* }}} */
@@ -108,23 +108,23 @@ PHP_FUNCTION( msgfmt_format_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "ssa",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "ssa",
&slocale, &slocale_len, &pattern, &pattern_len, &args ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_format_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -133,13 +133,13 @@ PHP_FUNCTION( msgfmt_format_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_format_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -151,10 +151,10 @@ PHP_FUNCTION( msgfmt_format_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_format(mfo, args, return_value TSRMLS_CC);
+ msgfmt_do_format(mfo, args, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 46ebe25a17..93c4290601 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -88,7 +88,7 @@ static void arg_types_dtor(zval *el) {
}
static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -114,7 +114,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
const Formattable::Type t = types[i];
if (zend_hash_index_update_mem(ret, (zend_ulong)i, (void*)&t, sizeof(t)) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
break;
}
}
@@ -134,7 +134,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
#ifdef HAS_MESSAGE_PATTERN
static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
const MessagePattern& mp,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
HashTable *ret;
int32_t parts_count;
@@ -144,7 +144,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
}
if (!((MessageFormat *)mfo->mf_data.umsgf)->usesNamedArguments()) {
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
}
if (mfo->mf_data.arg_types) {
@@ -189,7 +189,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
if ((storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
(void*)&bogusType, sizeof(bogusType))) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
@@ -197,7 +197,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
int32_t argNumber = name_part.getValue();
if (argNumber < 0) {
intl_errors_set(&err, U_INVALID_FORMAT_ERROR,
- "Found part with negative number", 0 TSRMLS_CC);
+ "Found part with negative number", 0);
continue;
}
if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (zend_ulong)argNumber)) == NULL) {
@@ -205,12 +205,12 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
Formattable::Type bogusType = Formattable::kObject;
if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (zend_ulong)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Write to argument types hash table failed", 0 TSRMLS_CC);
+ "Write to argument types hash table failed", 0);
continue;
}
}
} else {
- intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0 TSRMLS_CC);
+ intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0);
continue;
}
@@ -255,7 +255,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
* is broken. */
intl_errors_set(&err, U_PARSE_ERROR,
"Expected UMSGPAT_PART_TYPE_ARG_TYPE part following "
- "UMSGPAT_ARG_TYPE_SIMPLE part", 0 TSRMLS_CC);
+ "UMSGPAT_ARG_TYPE_SIMPLE part", 0);
continue;
}
} else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
@@ -272,7 +272,7 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
/* We found a different type for the same arg! */
if (*storedType != Formattable::kObject && *storedType != type) {
intl_errors_set(&err, U_ARGUMENT_TYPE_MISMATCH,
- "Inconsistent types declared for an argument", 0 TSRMLS_CC);
+ "Inconsistent types declared for an argument", 0);
continue;
}
@@ -293,27 +293,27 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
#endif
static HashTable *umsg_get_types(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
#ifdef HAS_MESSAGE_PATTERN
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
- return umsg_parse_format(mfo, mp, err TSRMLS_CC);
+ return umsg_parse_format(mfo, mp, err);
#else
if (mf->usesNamedArguments()) {
intl_errors_set(&err, U_UNSUPPORTED_ERROR,
"This extension supports named arguments only on ICU 4.8+",
- 0 TSRMLS_CC);
+ 0);
return NULL;
}
- return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+ return umsg_get_numeric_types(mfo, err);
#endif
}
static void umsg_set_timezone(MessageFormatter_object *mfo,
- intl_error& err TSRMLS_DC)
+ intl_error& err)
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
TimeZone *used_tz = NULL;
@@ -333,7 +333,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (formats == NULL) {
intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
- "Out of memory retrieving subformats", 0 TSRMLS_CC);
+ "Out of memory retrieving subformats", 0);
}
for (int i = 0; U_SUCCESS(err.code) && i < count; i++) {
@@ -346,7 +346,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
if (used_tz == NULL) {
zval nullzv, *zvptr = &nullzv;
ZVAL_NULL(zvptr);
- used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format" TSRMLS_CC);
+ used_tz = timezone_process_timezone_argument(zvptr, &err, "msgfmt_format");
if (used_tz == NULL) {
continue;
}
@@ -363,7 +363,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
HashTable *args,
UChar **formatted,
- int *formatted_len TSRMLS_DC)
+ int *formatted_len)
{
int arg_count = zend_hash_num_elements(args);
std::vector<Formattable> fargs;
@@ -376,9 +376,9 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
return;
}
- types = umsg_get_types(mfo, err TSRMLS_CC);
+ types = umsg_get_types(mfo, err);
- umsg_set_timezone(mfo, err TSRMLS_CC);
+ umsg_set_timezone(mfo, err);
fargs.resize(arg_count);
farg_names.resize(arg_count);
@@ -403,7 +403,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
/* includes case where index < 0 because it's exposed as unsigned */
if (num_index > (zend_ulong)INT32_MAX) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found negative or too large array key", 0 TSRMLS_CC);
+ "Found negative or too large array key", 0);
continue;
}
@@ -419,7 +419,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0,
"Invalid UTF-8 data in argument key: '%s'", str_index->val);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
continue;
}
@@ -453,7 +453,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
char *message;
spprintf(&message, 0, "Invalid UTF-8 data in string argument: "
"'%s'", Z_STRVAL_P(elem));
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(message);
delete text;
continue;
@@ -470,7 +470,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
d = (double)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
d = (Z_TYPE_P(elem) == IS_DOUBLE)
? Z_DVAL_P(elem)
: (double)Z_LVAL_P(elem);
@@ -487,7 +487,7 @@ retry_klong:
Z_DVAL_P(elem) < (double)INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "32 bit integer argument", 0 TSRMLS_CC);
+ "32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_DVAL_P(elem);
}
@@ -496,13 +496,13 @@ retry_klong:
Z_LVAL_P(elem) < INT32_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP integer with absolute value too large "
- "for 32 bit integer argument", 0 TSRMLS_CC);
+ "for 32 bit integer argument", 0);
} else {
tInt32 = (int32_t)Z_LVAL_P(elem);
}
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_klong;
}
formattable.setLong(tInt32);
@@ -517,7 +517,7 @@ retry_kint64:
Z_DVAL_P(elem) < (double)U_INT64_MIN) {
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
"Found PHP float with absolute value too large for "
- "64 bit integer argument", 0 TSRMLS_CC);
+ "64 bit integer argument", 0);
} else {
tInt64 = (int64_t)Z_DVAL_P(elem);
}
@@ -526,7 +526,7 @@ retry_kint64:
tInt64 = (int64_t)Z_LVAL_P(elem);
} else {
SEPARATE_ZVAL_IF_NOT_REF(elem);
- convert_scalar_to_number(elem TSRMLS_CC);
+ convert_scalar_to_number(elem);
goto retry_kint64;
}
formattable.setInt64(tInt64);
@@ -534,7 +534,7 @@ retry_kint64:
}
case Formattable::kDate:
{
- double dd = intl_zval_to_millis(elem, &err, "msgfmt_format" TSRMLS_CC);
+ double dd = intl_zval_to_millis(elem, &err, "msgfmt_format");
if (U_FAILURE(err.code)) {
char *message, *key_char;
int key_len;
@@ -543,7 +543,7 @@ retry_kint64:
&status) == SUCCESS) {
spprintf(&message, 0, "The argument for key '%s' "
"cannot be used as a date or time", key_char);
- intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+ intl_errors_set(&err, err.code, message, 1);
efree(key_char);
efree(message);
}
@@ -554,7 +554,7 @@ retry_kint64:
}
default:
intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
- "Found unsupported argument type", 0 TSRMLS_CC);
+ "Found unsupported argument type", 0);
break;
}
} else {
@@ -589,7 +589,7 @@ retry_kint64:
"value given for the argument with key '%s' "
"is available", key_char);
intl_errors_set(&err,
- U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(key_char);
efree(message);
}
@@ -612,7 +612,7 @@ retry_kint64:
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Call to ICU MessageFormat::format() has failed", 0 TSRMLS_CC);
+ "Call to ICU MessageFormat::format() has failed", 0);
return;
}
@@ -621,7 +621,7 @@ retry_kint64:
resultStr.extract(*formatted, *formatted_len+1, err.code);
if (U_FAILURE(err.code)) {
intl_errors_set(&err, err.code,
- "Error copying format() result", 0 TSRMLS_CC);
+ "Error copying format() result", 0);
return;
}
}
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 41d179f8d0..df05259574 100644
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -19,7 +19,7 @@
int32_t umsg_format_arg_count(UMessageFormat *fmt);
void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args,
- UChar **formatted, int *formatted_len TSRMLS_DC);
+ UChar **formatted, int *formatted_len);
void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args,
UChar *source, int source_len, UErrorCode *status);
#endif // MSG_FORMAT_HELPERS_H
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index add2f901eb..1474ff6ea8 100644
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -28,7 +28,7 @@
#include "intl_convert.h"
/* {{{ */
-static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value TSRMLS_DC)
+static void msgfmt_do_parse(MessageFormatter_object *mfo, char *source, size_t src_len, zval *return_value)
{
zval *fargs;
int count = 0;
@@ -66,11 +66,11 @@ PHP_FUNCTION( msgfmt_parse )
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Os",
&object, MessageFormatter_ce_ptr, &source, &source_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -78,7 +78,7 @@ PHP_FUNCTION( msgfmt_parse )
/* Fetch the object. */
MSG_FORMAT_METHOD_FETCH_OBJECT;
- msgfmt_do_parse(mfo, source, source_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, source_len, return_value);
}
/* }}} */
@@ -101,23 +101,23 @@ PHP_FUNCTION( msgfmt_parse_message )
MessageFormatter_object *mfo = &mf;
/* Parse parameters. */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sss",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "sss",
&slocale, &slocale_len, &pattern, &pattern_len, &source, &src_len ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: unable to parse input params", 0 TSRMLS_CC );
+ "msgfmt_parse_message: unable to parse input params", 0 );
RETURN_FALSE;
}
- msgformat_data_init(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_init(&mfo->mf_data);
if(pattern && pattern_len) {
intl_convert_utf8_to_utf16(&spattern, &spattern_len, pattern, pattern_len, &INTL_DATA_ERROR_CODE(mfo));
if( U_FAILURE(INTL_DATA_ERROR_CODE((mfo))) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_parse_message: error converting pattern to UTF-16", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to UTF-16", 0 );
RETURN_FALSE;
}
} else {
@@ -126,13 +126,13 @@ PHP_FUNCTION( msgfmt_parse_message )
}
if(slocale_len == 0) {
- slocale = intl_locale_get_default(TSRMLS_C);
+ slocale = intl_locale_get_default();
}
#ifdef MSG_FORMAT_QUOTE_APOS
if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
- "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
+ "msgfmt_parse_message: error converting pattern to quote-friendly format", 0 );
RETURN_FALSE;
}
#endif
@@ -144,10 +144,10 @@ PHP_FUNCTION( msgfmt_parse_message )
}
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
- msgfmt_do_parse(mfo, source, src_len, return_value TSRMLS_CC);
+ msgfmt_do_parse(mfo, source, src_len, return_value);
/* drop the temporary formatter */
- msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+ msgformat_data_free(&mfo->mf_data);
}
/* }}} */
diff --git a/ext/intl/normalizer/normalizer.c b/ext/intl/normalizer/normalizer.c
index 18c3cedcaf..3a0d526b77 100644
--- a/ext/intl/normalizer/normalizer.c
+++ b/ext/intl/normalizer/normalizer.c
@@ -38,8 +38,8 @@ void normalizer_register_constants( INIT_FUNC_ARGS )
}
#define NORMALIZER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
- #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC );
- #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
+ #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x );
+ #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value );
/* Normalization form constants */
NORMALIZER_EXPOSE_CLASS_CONST( NONE );
diff --git a/ext/intl/normalizer/normalizer_class.c b/ext/intl/normalizer/normalizer_class.c
index ccd8be3b29..93a5624663 100644
--- a/ext/intl/normalizer/normalizer_class.c
+++ b/ext/intl/normalizer/normalizer_class.c
@@ -51,14 +51,14 @@ zend_function_entry Normalizer_class_functions[] = {
/* {{{ normalizer_register_Normalizer_class
* Initialize 'Normalizer' class
*/
-void normalizer_register_Normalizer_class( TSRMLS_D )
+void normalizer_register_Normalizer_class( void )
{
zend_class_entry ce;
/* Create and register 'Normalizer' class. */
INIT_CLASS_ENTRY( ce, "Normalizer", Normalizer_class_functions );
ce.create_object = NULL;
- Normalizer_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Normalizer_ce_ptr = zend_register_internal_class( &ce );
/* Declare 'Normalizer' class properties. */
if( !Normalizer_ce_ptr )
diff --git a/ext/intl/normalizer/normalizer_class.h b/ext/intl/normalizer/normalizer_class.h
index 3ce37fae88..de5a168a45 100644
--- a/ext/intl/normalizer/normalizer_class.h
+++ b/ext/intl/normalizer/normalizer_class.h
@@ -38,6 +38,6 @@ typedef struct {
#define NORMALIZER_ERROR_CODE(co) INTL_ERROR_CODE(NORMALIZER_ERROR(co))
#define NORMALIZER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(NORMALIZER_ERROR(co)))
-void normalizer_register_Normalizer_class( TSRMLS_D );
+void normalizer_register_Normalizer_class( void );
extern zend_class_entry *Normalizer_ce_ptr;
#endif // #ifndef NORMALIZER_CLASS_H
diff --git a/ext/intl/normalizer/normalizer_normalize.c b/ext/intl/normalizer/normalizer_normalize.c
index d3ac07024b..97163a98c4 100644
--- a/ext/intl/normalizer/normalizer_normalize.c
+++ b/ext/intl/normalizer/normalizer_normalize.c
@@ -50,14 +50,14 @@ PHP_FUNCTION( normalizer_normalize )
int32_t size_needed;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l",
&input, &input_len, &form ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: unable to parse input params", 0 TSRMLS_CC );
+ "normalizer_normalize: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -78,7 +78,7 @@ PHP_FUNCTION( normalizer_normalize )
break;
default:
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC );
+ "normalizer_normalize: illegal normalization form", 0 );
RETURN_FALSE;
}
@@ -92,10 +92,10 @@ PHP_FUNCTION( normalizer_normalize )
if( U_FAILURE( status ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 );
if (uinput) {
efree( uinput );
}
@@ -136,7 +136,7 @@ PHP_FUNCTION( normalizer_normalize )
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
- intl_error_set_custom_msg( NULL,"Error normalizing string", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL,"Error normalizing string", 0 );
efree( uret_buf );
efree( uinput );
RETURN_FALSE;
@@ -154,7 +154,7 @@ PHP_FUNCTION( normalizer_normalize )
if( U_FAILURE( status ) )
{
intl_error_set( NULL, status,
- "normalizer_normalize: error converting normalized text UTF-8", 0 TSRMLS_CC );
+ "normalizer_normalize: error converting normalized text UTF-8", 0 );
RETURN_FALSE;
}
@@ -183,14 +183,14 @@ PHP_FUNCTION( normalizer_is_normalized )
UBool uret = FALSE;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
/* Parse parameters. */
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "s|l",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "s|l",
&input, &input_len, &form) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_is_normalized: unable to parse input params", 0 TSRMLS_CC );
+ "normalizer_is_normalized: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -205,7 +205,7 @@ PHP_FUNCTION( normalizer_is_normalized )
break;
default:
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "normalizer_normalize: illegal normalization form", 0 TSRMLS_CC );
+ "normalizer_normalize: illegal normalization form", 0 );
RETURN_FALSE;
}
@@ -220,10 +220,10 @@ PHP_FUNCTION( normalizer_is_normalized )
if( U_FAILURE( status ) )
{
/* Set global error code. */
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
/* Set error messages. */
- intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 );
if (uinput) {
efree( uinput );
}
@@ -239,7 +239,7 @@ PHP_FUNCTION( normalizer_is_normalized )
/* Bail out if an unexpected error occurred. */
if( U_FAILURE(status) ) {
/* Set error messages. */
- intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL,"Error testing if string is the given normalization form.", 0 );
RETURN_FALSE;
}
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 15f058d2b4..2ac1888061 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -116,7 +116,7 @@
ZEND_DECLARE_MODULE_GLOBALS( intl )
-const char *intl_locale_get_default( TSRMLS_D )
+const char *intl_locale_get_default( void )
{
if( INTL_G(default_locale) == NULL ) {
return uloc_getDefault();
@@ -923,53 +923,53 @@ PHP_MINIT_FUNCTION( intl )
#endif
/* Register 'Collator' PHP class */
- collator_register_Collator_class( TSRMLS_C );
+ collator_register_Collator_class( );
/* Expose Collator constants to PHP scripts */
collator_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'NumberFormatter' PHP class */
- formatter_register_class( TSRMLS_C );
+ formatter_register_class( );
/* Expose NumberFormatter constants to PHP scripts */
formatter_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'Normalizer' PHP class */
- normalizer_register_Normalizer_class( TSRMLS_C );
+ normalizer_register_Normalizer_class( );
/* Expose Normalizer constants to PHP scripts */
normalizer_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'Locale' PHP class */
- locale_register_Locale_class( TSRMLS_C );
+ locale_register_Locale_class( );
/* Expose Locale constants to PHP scripts */
locale_register_constants( INIT_FUNC_ARGS_PASSTHRU );
- msgformat_register_class(TSRMLS_C);
+ msgformat_register_class();
grapheme_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'DateFormat' PHP class */
- dateformat_register_IntlDateFormatter_class( TSRMLS_C );
+ dateformat_register_IntlDateFormatter_class( );
/* Expose DateFormat constants to PHP scripts */
dateformat_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'ResourceBundle' PHP class */
- resourcebundle_register_class( TSRMLS_C);
+ resourcebundle_register_class( );
/* Register 'Transliterator' PHP class */
- transliterator_register_Transliterator_class( TSRMLS_C );
+ transliterator_register_Transliterator_class( );
/* Register Transliterator constants */
transliterator_register_constants( INIT_FUNC_ARGS_PASSTHRU );
/* Register 'IntlTimeZone' PHP class */
- timezone_register_IntlTimeZone_class( TSRMLS_C );
+ timezone_register_IntlTimeZone_class( );
/* Register 'IntlCalendar' PHP class */
- calendar_register_IntlCalendar_class( TSRMLS_C );
+ calendar_register_IntlCalendar_class( );
/* Expose ICU error codes to PHP scripts. */
intl_expose_icu_error_codes( INIT_FUNC_ARGS_PASSTHRU );
@@ -979,26 +979,26 @@ PHP_MINIT_FUNCTION( intl )
#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
/* Register 'Spoofchecker' PHP class */
- spoofchecker_register_Spoofchecker_class( TSRMLS_C );
+ spoofchecker_register_Spoofchecker_class( );
/* Expose Spoofchecker constants to PHP scripts */
spoofchecker_register_constants( INIT_FUNC_ARGS_PASSTHRU );
#endif
/* Register 'IntlException' PHP class */
- intl_register_IntlException_class( TSRMLS_C );
+ intl_register_IntlException_class( );
/* Register 'IntlIterator' PHP class */
- intl_register_IntlIterator_class( TSRMLS_C );
+ intl_register_IntlIterator_class( );
/* Register 'BreakIterator' class */
- breakiterator_register_BreakIterator_class( TSRMLS_C );
+ breakiterator_register_BreakIterator_class( );
/* Register 'IntlPartsIterator' class */
- breakiterator_register_IntlPartsIterator_class( TSRMLS_C );
+ breakiterator_register_IntlPartsIterator_class( );
/* Global error handling. */
- intl_error_init( NULL TSRMLS_CC );
+ intl_error_init( NULL );
/* 'Converter' class for codepage conversions */
php_converter_minit(INIT_FUNC_ARGS_PASSTHRU);
@@ -1042,11 +1042,11 @@ PHP_RSHUTDOWN_FUNCTION( intl )
ZVAL_UNDEF(&INTL_G(current_collator));
}
if (INTL_G(grapheme_iterator)) {
- grapheme_close_global_iterator( TSRMLS_C );
+ grapheme_close_global_iterator( );
INTL_G(grapheme_iterator) = NULL;
}
- intl_error_reset( NULL TSRMLS_CC);
+ intl_error_reset( NULL);
return SUCCESS;
}
/* }}} */
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 265cdb7b9e..822ea02183 100644
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -72,7 +72,7 @@ PHP_RINIT_FUNCTION(intl);
PHP_RSHUTDOWN_FUNCTION(intl);
PHP_MINFO_FUNCTION(intl);
-const char *intl_locale_get_default( TSRMLS_D );
+const char *intl_locale_get_default( void );
#define PHP_INTL_VERSION "1.1.0"
diff --git a/ext/intl/resourcebundle/resourcebundle.c b/ext/intl/resourcebundle/resourcebundle.c
index 9b6b734ed6..62a268c07f 100644
--- a/ext/intl/resourcebundle/resourcebundle.c
+++ b/ext/intl/resourcebundle/resourcebundle.c
@@ -24,7 +24,7 @@
#include "resourcebundle/resourcebundle_class.h"
/* {{{ ResourceBundle_extract_value */
-void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source TSRMLS_DC )
+void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *source )
{
UResType restype;
const UChar* ufield;
@@ -71,11 +71,11 @@ void resourcebundle_extract_value( zval *return_value, ResourceBundle_object *so
newrb = Z_INTL_RESOURCEBUNDLE_P(return_value);
newrb->me = source->child;
source->child = NULL;
- intl_errors_reset(INTL_DATA_ERROR_P(source) TSRMLS_CC);
+ intl_errors_reset(INTL_DATA_ERROR_P(source));
break;
default:
- intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0 TSRMLS_CC);
+ intl_errors_set(INTL_DATA_ERROR_P(source), U_ILLEGAL_ARGUMENT_ERROR, "Unknown resource type", 0);
RETURN_FALSE;
break;
}
diff --git a/ext/intl/resourcebundle/resourcebundle.h b/ext/intl/resourcebundle/resourcebundle.h
index e5aa9f092b..46a6ad5766 100644
--- a/ext/intl/resourcebundle/resourcebundle.h
+++ b/ext/intl/resourcebundle/resourcebundle.h
@@ -23,6 +23,6 @@
#include "resourcebundle/resourcebundle_class.h"
-void resourcebundle_extract_value( zval *target, ResourceBundle_object *source TSRMLS_DC);
+void resourcebundle_extract_value( zval *target, ResourceBundle_object *source);
#endif // #ifndef RESOURCEBUNDLE_CLASS_H
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 0fbf7931d4..67e2bae855 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -35,12 +35,12 @@ zend_class_entry *ResourceBundle_ce_ptr = NULL;
static zend_object_handlers ResourceBundle_object_handlers;
/* {{{ ResourceBundle_object_dtor */
-static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC )
+static void ResourceBundle_object_destroy( zend_object *object )
{
ResourceBundle_object *rb = php_intl_resourcebundle_fetch_object(object);
// only free local errors
- intl_error_reset( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
+ intl_error_reset( INTL_DATA_ERROR_P(rb) );
if (rb->me) {
ures_close( rb->me );
@@ -49,21 +49,21 @@ static void ResourceBundle_object_destroy( zend_object *object TSRMLS_DC )
ures_close( rb->child );
}
- //???zend_object_std_dtor( object TSRMLS_CC );
+ //???zend_object_std_dtor( object );
}
/* }}} */
/* {{{ ResourceBundle_object_create */
-static zend_object *ResourceBundle_object_create( zend_class_entry *ce TSRMLS_DC )
+static zend_object *ResourceBundle_object_create( zend_class_entry *ce )
{
ResourceBundle_object *rb;
rb = ecalloc( 1, sizeof(ResourceBundle_object) + sizeof(zval) * (ce->default_properties_count - 1) );
- zend_object_std_init( &rb->zend, ce TSRMLS_CC );
+ zend_object_std_init( &rb->zend, ce );
object_properties_init( &rb->zend, ce);
- intl_error_init( INTL_DATA_ERROR_P(rb) TSRMLS_CC );
+ intl_error_init( INTL_DATA_ERROR_P(rb) );
rb->me = NULL;
rb->child = NULL;
@@ -85,13 +85,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
zval *object = return_value;
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P( object );
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s!s!|b",
&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_ctor: unable to parse input parameters", 0 TSRMLS_CC );
+ "resourcebundle_ctor: unable to parse input parameters", 0 );
Z_OBJ_P(return_value) = NULL;
return;
}
@@ -99,7 +99,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
if (locale == NULL) {
- locale = intl_locale_get_default(TSRMLS_C);
+ locale = intl_locale_get_default();
}
if (fallback) {
@@ -113,13 +113,13 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
char *pbuf;
- intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
+ intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb));
spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
"'%s' without fallback from %s to %s",
bundlename ? bundlename : "(default data)", locale,
ures_getLocaleByType(
rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
- intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
+ intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1);
efree(pbuf);
Z_OBJ_P(return_value) = NULL;
}
@@ -145,7 +145,7 @@ PHP_METHOD( ResourceBundle, __construct )
resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this) TSRMLS_CC);
+ zend_object_store_ctor_failed(Z_OBJ(orig_this));
zval_dtor(&orig_this);
ZEND_CTOR_MAKE_NULL();
}
@@ -166,7 +166,7 @@ PHP_FUNCTION( resourcebundle_create )
/* }}} */
/* {{{ resourcebundle_array_fetch */
-static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC)
+static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback)
{
int32_t meindex = 0;
char * mekey = NULL;
@@ -174,7 +174,7 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
char *pbuf;
ResourceBundle_object *rb;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
RESOURCEBUNDLE_METHOD_FETCH_OBJECT;
if(Z_TYPE_P(offset) == IS_LONG) {
@@ -186,18 +186,18 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
rb->child = ures_getByKey(rb->me, mekey, rb->child, &INTL_DATA_ERROR_CODE(rb) );
} else {
intl_errors_set(INTL_DATA_ERROR_P(rb), U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get: index should be integer or string", 0 TSRMLS_CC);
+ "resourcebundle_get: index should be integer or string", 0);
RETURN_NULL();
}
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE(rb) );
if (U_FAILURE(INTL_DATA_ERROR_CODE(rb))) {
if (is_numeric) {
spprintf( &pbuf, 0, "Cannot load resource element %d", meindex );
} else {
spprintf( &pbuf, 0, "Cannot load resource element '%s'", mekey );
}
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 );
efree(pbuf);
RETURN_NULL();
}
@@ -210,23 +210,23 @@ static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_
} else {
spprintf( &pbuf, 0, "Cannot load element '%s' without fallback from to %s", mekey, locale );
}
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 );
efree(pbuf);
RETURN_NULL();
}
- resourcebundle_extract_value( return_value, rb TSRMLS_CC );
+ resourcebundle_extract_value( return_value, rb );
}
/* }}} */
/* {{{ resourcebundle_array_get */
-zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+zval *resourcebundle_array_get(zval *object, zval *offset, int type, zval *rv)
{
if(offset == NULL) {
php_error( E_ERROR, "Cannot apply [] to ResourceBundle object" );
}
ZVAL_NULL(rv);
- resourcebundle_array_fetch(object, offset, rv, 1 TSRMLS_CC);
+ resourcebundle_array_fetch(object, offset, rv, 1);
return rv;
}
/* }}} */
@@ -248,25 +248,25 @@ PHP_FUNCTION( resourcebundle_get )
zval * offset;
zval * object;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oz|b", &object, ResourceBundle_ce_ptr, &offset, &fallback ) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_get: unable to parse input params", 0);
RETURN_FALSE;
}
- resourcebundle_array_fetch(object, offset, return_value, fallback TSRMLS_CC);
+ resourcebundle_array_fetch(object, offset, return_value, fallback);
}
/* }}} */
/* {{{ resourcebundle_array_count */
-int resourcebundle_array_count(zval *object, zend_long *count TSRMLS_DC)
+int resourcebundle_array_count(zval *object, zend_long *count)
{
ResourceBundle_object *rb;
RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK;
if (rb->me == NULL) {
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR,
- "Found unconstructed ResourceBundle", 0 TSRMLS_CC);
+ "Found unconstructed ResourceBundle", 0);
return 0;
}
@@ -290,9 +290,9 @@ PHP_FUNCTION( resourcebundle_count )
int32_t len;
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) {
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O", &object, ResourceBundle_ce_ptr ) == FAILURE ) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_count: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_count: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -321,12 +321,12 @@ PHP_FUNCTION( resourcebundle_locales )
UEnumeration *icuenum;
UErrorCode icuerror = U_ZERO_ERROR;
- intl_errors_reset( NULL TSRMLS_CC );
+ intl_errors_reset( NULL );
- if( zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &bundlename, &bundlename_len ) == FAILURE )
+ if( zend_parse_parameters(ZEND_NUM_ARGS(), "s", &bundlename, &bundlename_len ) == FAILURE )
{
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_locales: unable to parse input params", 0 TSRMLS_CC);
+ "resourcebundle_locales: unable to parse input params", 0);
RETURN_FALSE;
}
@@ -362,11 +362,11 @@ PHP_FUNCTION( resourcebundle_get_error_code )
{
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, ResourceBundle_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "resourcebundle_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -390,16 +390,16 @@ PHP_FUNCTION( resourcebundle_get_error_message )
zend_string* message = NULL;
RESOURCEBUNDLE_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, ResourceBundle_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "resourcebundle_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "resourcebundle_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
rb = Z_INTL_RESOURCEBUNDLE_P( object );
- message = intl_error_get_message(INTL_DATA_ERROR_P(rb) TSRMLS_CC);
+ message = intl_error_get_message(INTL_DATA_ERROR_P(rb));
RETURN_STR(message);
}
/* }}} */
@@ -422,7 +422,7 @@ static zend_function_entry ResourceBundle_class_functions[] = {
/* {{{ resourcebundle_register_class
* Initialize 'ResourceBundle' class
*/
-void resourcebundle_register_class( TSRMLS_D )
+void resourcebundle_register_class( void )
{
zend_class_entry ce;
@@ -431,7 +431,7 @@ void resourcebundle_register_class( TSRMLS_D )
ce.create_object = ResourceBundle_object_create;
ce.get_iterator = resourcebundle_get_iterator;
- ResourceBundle_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ ResourceBundle_ce_ptr = zend_register_internal_class( &ce );
if( !ResourceBundle_ce_ptr )
{
@@ -446,7 +446,7 @@ void resourcebundle_register_class( TSRMLS_D )
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
- zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(ResourceBundle_ce_ptr, 1, zend_ce_traversable);
}
/* }}} */
diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h
index 403b6beb17..0ac3635ba8 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.h
+++ b/ext/intl/resourcebundle/resourcebundle_class.h
@@ -43,14 +43,14 @@ static inline ResourceBundle_object *php_intl_resourcebundle_fetch_object(zend_o
INTL_METHOD_FETCH_OBJECT(INTL_RESOURCEBUNDLE, rb); \
if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \
+ "Found unconstructed ResourceBundle", 0); \
RETURN_FALSE; \
}
#define RESOURCEBUNDLE_OBJECT(rb) (rb)->me
-void resourcebundle_register_class( TSRMLS_D );
+void resourcebundle_register_class( void );
extern zend_class_entry *ResourceBundle_ce_ptr;
PHP_FUNCTION( resourcebundle_create );
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c
index cf38c6b676..8243e69268 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.c
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.c
@@ -29,7 +29,7 @@
*/
/* {{{ resourcebundle_iterator_read */
-static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRMLS_DC )
+static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator )
{
UErrorCode icuerror = U_ZERO_ERROR;
ResourceBundle_object *rb = iterator->subject;
@@ -41,17 +41,17 @@ static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator TSRM
if (iterator->is_table) {
iterator->currentkey = estrdup( ures_getKey( rb->child ) );
}
- resourcebundle_extract_value( &iterator->current, rb TSRMLS_CC );
+ resourcebundle_extract_value( &iterator->current, rb );
}
else {
- // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0 TSRMLS_CC);
+ // zend_throw_exception( spl_ce_OutOfRangeException, "Running past end of ResourceBundle", 0);
ZVAL_UNDEF(&iterator->current);
}
}
/* }}} */
/* {{{ resourcebundle_iterator_invalidate */
-static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_invalidate( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
@@ -67,19 +67,19 @@ static void resourcebundle_iterator_invalidate( zend_object_iterator *iter TSRML
/* }}} */
/* {{{ resourcebundle_iterator_dtor */
-static void resourcebundle_iterator_dtor( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_dtor( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
zval *object = &iterator->intern.data;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
zval_ptr_dtor(object);
}
/* }}} */
/* {{{ resourcebundle_iterator_has_more */
-static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_DC )
+static int resourcebundle_iterator_has_more( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
return (iterator->i < iterator->length) ? SUCCESS : FAILURE;
@@ -87,23 +87,23 @@ static int resourcebundle_iterator_has_more( zend_object_iterator *iter TSRMLS_D
/* }}} */
/* {{{ resourcebundle_iterator_current */
-static zval *resourcebundle_iterator_current( zend_object_iterator *iter TSRMLS_DC )
+static zval *resourcebundle_iterator_current( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
if (Z_ISUNDEF(iterator->current)) {
- resourcebundle_iterator_read( iterator TSRMLS_CC);
+ resourcebundle_iterator_read( iterator);
}
return &iterator->current;
}
/* }}} */
/* {{{ resourcebundle_iterator_key */
-static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key TSRMLS_DC )
+static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
if (Z_ISUNDEF(iterator->current)) {
- resourcebundle_iterator_read( iterator TSRMLS_CC);
+ resourcebundle_iterator_read( iterator);
}
if (iterator->is_table) {
@@ -115,22 +115,22 @@ static void resourcebundle_iterator_key( zend_object_iterator *iter, zval *key T
/* }}} */
/* {{{ resourcebundle_iterator_step */
-static void resourcebundle_iterator_step( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_step( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
iterator->i++;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
}
/* }}} */
/* {{{ resourcebundle_iterator_has_reset */
-static void resourcebundle_iterator_reset( zend_object_iterator *iter TSRMLS_DC )
+static void resourcebundle_iterator_reset( zend_object_iterator *iter )
{
ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter;
iterator->i = 0;
- resourcebundle_iterator_invalidate( iter TSRMLS_CC );
+ resourcebundle_iterator_invalidate( iter );
}
/* }}} */
@@ -147,7 +147,7 @@ static zend_object_iterator_funcs resourcebundle_iterator_funcs = {
/* }}} */
/* {{{ resourcebundle_get_iterator */
-zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC )
+zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref )
{
ResourceBundle_object *rb = Z_INTL_RESOURCEBUNDLE_P(object );
ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) );
@@ -156,7 +156,7 @@ zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *o
php_error( E_ERROR, "ResourceBundle does not support writable iterators" );
}
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &resourcebundle_iterator_funcs;
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.h b/ext/intl/resourcebundle/resourcebundle_iterator.h
index b28fa91638..f27b76ad8b 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.h
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.h
@@ -31,6 +31,6 @@ typedef struct {
zend_long i;
} ResourceBundle_iterator;
-zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref TSRMLS_DC );
+zend_object_iterator *resourcebundle_get_iterator( zend_class_entry *ce, zval *object, int byref );
#endif // #ifndef RESOURCEBUNDLE_ITERATOR_H
diff --git a/ext/intl/spoofchecker/spoofchecker.c b/ext/intl/spoofchecker/spoofchecker.c
index 0a22875dcf..d61aea2e13 100644
--- a/ext/intl/spoofchecker/spoofchecker.c
+++ b/ext/intl/spoofchecker/spoofchecker.c
@@ -35,7 +35,7 @@ void spoofchecker_register_constants(INIT_FUNC_ARGS)
return;
}
- #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC);
+ #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x);
SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT_CONFUSABLE)
SPOOFCHECKER_EXPOSE_CLASS_CONST(MIXED_SCRIPT_CONFUSABLE)
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 5fb6ffb90c..84549ced83 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -30,32 +30,32 @@ static zend_object_handlers Spoofchecker_handlers;
*/
/* {{{ Spoofchecker_objects_dtor */
-static void Spoofchecker_objects_dtor(zend_object *object TSRMLS_DC)
+static void Spoofchecker_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ Spoofchecker_objects_free */
-void Spoofchecker_objects_free(zend_object *object TSRMLS_DC)
+void Spoofchecker_objects_free(zend_object *object)
{
Spoofchecker_object* co = php_intl_spoofchecker_fetch_object(object);
- zend_object_std_dtor(&co->zo TSRMLS_CC);
+ zend_object_std_dtor(&co->zo);
- spoofchecker_object_destroy(co TSRMLS_CC);
+ spoofchecker_object_destroy(co);
}
/* }}} */
/* {{{ Spoofchecker_object_create */
zend_object *Spoofchecker_object_create(
- zend_class_entry *ce TSRMLS_DC)
+ zend_class_entry *ce)
{
Spoofchecker_object* intern;
intern = ecalloc(1, sizeof(Spoofchecker_object) + sizeof(zval) * (ce->default_properties_count - 1));
- intl_error_init(SPOOFCHECKER_ERROR_P(intern) TSRMLS_CC);
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ intl_error_init(SPOOFCHECKER_ERROR_P(intern));
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &Spoofchecker_handlers;
@@ -107,24 +107,24 @@ zend_function_entry Spoofchecker_class_functions[] = {
};
/* }}} */
-static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */
+static zend_object *spoofchecker_clone_obj(zval *object) /* {{{ */
{
zend_object *new_obj_val;
Spoofchecker_object *sfo, *new_sfo;
sfo = Z_INTL_SPOOFCHECKER_P(object);
- intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC);
+ intl_error_reset(SPOOFCHECKER_ERROR_P(sfo));
- new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object));
new_sfo = php_intl_spoofchecker_fetch_object(new_obj_val);
/* clone standard parts */
- zend_objects_clone_members(&new_sfo->zo, &sfo->zo TSRMLS_CC);
+ zend_objects_clone_members(&new_sfo->zo, &sfo->zo);
/* clone internal object */
new_sfo->uspoof = uspoof_clone(sfo->uspoof, SPOOFCHECKER_ERROR_CODE_P(new_sfo));
if(U_FAILURE(SPOOFCHECKER_ERROR_CODE(new_sfo))) {
/* set up error in case error handler is interested */
- intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 TSRMLS_CC );
- Spoofchecker_objects_dtor(&new_sfo->zo TSRMLS_CC); /* free new object */
+ intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), "Failed to clone SpoofChecker object", 0 );
+ Spoofchecker_objects_dtor(&new_sfo->zo); /* free new object */
zend_error(E_ERROR, "Failed to clone SpoofChecker object");
}
return new_obj_val;
@@ -134,14 +134,14 @@ static zend_object *spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */
/* {{{ spoofchecker_register_Spoofchecker_class
* Initialize 'Spoofchecker' class
*/
-void spoofchecker_register_Spoofchecker_class(TSRMLS_D)
+void spoofchecker_register_Spoofchecker_class(void)
{
zend_class_entry ce;
/* Create and register 'Spoofchecker' class. */
INIT_CLASS_ENTRY(ce, "Spoofchecker", Spoofchecker_class_functions);
ce.create_object = Spoofchecker_object_create;
- Spoofchecker_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ Spoofchecker_ce_ptr = zend_register_internal_class(&ce);
memcpy(&Spoofchecker_handlers, zend_get_std_object_handlers(),
sizeof Spoofchecker_handlers);
@@ -163,20 +163,20 @@ void spoofchecker_register_Spoofchecker_class(TSRMLS_D)
* Initialize internals of Spoofchecker_object.
* Must be called before any other call to 'spoofchecker_object_...' functions.
*/
-void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC)
+void spoofchecker_object_init(Spoofchecker_object* co)
{
if (!co) {
return;
}
- intl_error_init(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC);
+ intl_error_init(SPOOFCHECKER_ERROR_P(co));
}
/* }}} */
/* {{{ void spoofchecker_object_destroy( Spoofchecker_object* co )
* Clean up mem allocted by internals of Spoofchecker_object
*/
-void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC)
+void spoofchecker_object_destroy(Spoofchecker_object* co)
{
if (!co) {
return;
@@ -187,7 +187,7 @@ void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC)
co->uspoof = NULL;
}
- intl_error_reset(SPOOFCHECKER_ERROR_P(co) TSRMLS_CC);
+ intl_error_reset(SPOOFCHECKER_ERROR_P(co));
}
/* }}} */
diff --git a/ext/intl/spoofchecker/spoofchecker_class.h b/ext/intl/spoofchecker/spoofchecker_class.h
index 847b0a97b5..7c5864b82f 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.h
+++ b/ext/intl/spoofchecker/spoofchecker_class.h
@@ -47,10 +47,10 @@ static inline Spoofchecker_object *php_intl_spoofchecker_fetch_object(zend_objec
#define SPOOFCHECKER_ERROR_CODE(co) INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co))
#define SPOOFCHECKER_ERROR_CODE_P(co) &(INTL_ERROR_CODE(SPOOFCHECKER_ERROR(co)))
-void spoofchecker_register_Spoofchecker_class(TSRMLS_D);
+void spoofchecker_register_Spoofchecker_class(void);
-void spoofchecker_object_init(Spoofchecker_object* co TSRMLS_DC);
-void spoofchecker_object_destroy(Spoofchecker_object* co TSRMLS_DC);
+void spoofchecker_object_init(Spoofchecker_object* co);
+void spoofchecker_object_destroy(Spoofchecker_object* co);
extern zend_class_entry *Spoofchecker_ce_ptr;
@@ -59,22 +59,22 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
#define SPOOFCHECKER_METHOD_INIT_VARS \
zval* object = getThis(); \
Spoofchecker_object* co = NULL; \
- intl_error_reset(NULL TSRMLS_CC); \
+ intl_error_reset(NULL); \
#define SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_SPOOFCHECKER, co)
#define SPOOFCHECKER_METHOD_FETCH_OBJECT \
SPOOFCHECKER_METHOD_FETCH_OBJECT_NO_CHECK; \
if (co->uspoof == NULL) { \
intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR, \
- "Found unconstructed Spoofchecker", 0 TSRMLS_CC); \
+ "Found unconstructed Spoofchecker", 0); \
RETURN_FALSE; \
}
// Macro to check return value of a ucol_* function call.
#define SPOOFCHECKER_CHECK_STATUS(co, msg) \
- intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); \
+ intl_error_set_code(NULL, SPOOFCHECKER_ERROR_CODE(co)); \
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { \
- intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0 TSRMLS_CC); \
+ intl_errors_set_custom_msg(SPOOFCHECKER_ERROR_P(co), msg, 0); \
RETURN_FALSE; \
} \
diff --git a/ext/intl/spoofchecker/spoofchecker_main.c b/ext/intl/spoofchecker/spoofchecker_main.c
index 959a0c568f..fb0f1549a2 100644
--- a/ext/intl/spoofchecker/spoofchecker_main.c
+++ b/ext/intl/spoofchecker/spoofchecker_main.c
@@ -32,7 +32,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &text, &text_len, &error_code)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &text, &text_len, &error_code)) {
return;
}
@@ -41,7 +41,7 @@ PHP_METHOD(Spoofchecker, isSuspicious)
ret = uspoof_checkUTF8(co->uspoof, text, text_len, NULL, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
RETURN_TRUE;
}
@@ -64,7 +64,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
zval *error_code = NULL;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &s1, &s1_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &s1, &s1_len,
&s2, &s2_len, &error_code)) {
return;
}
@@ -74,7 +74,7 @@ PHP_METHOD(Spoofchecker, areConfusable)
ret = uspoof_areConfusableUTF8(co->uspoof, s1, s1_len, s2, s2_len, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
RETURN_TRUE;
}
@@ -95,7 +95,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales)
size_t locales_len;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &locales, &locales_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &locales, &locales_len)) {
return;
}
@@ -104,7 +104,7 @@ PHP_METHOD(Spoofchecker, setAllowedLocales)
uspoof_setAllowedLocales(co->uspoof, locales, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
return;
}
}
@@ -118,7 +118,7 @@ PHP_METHOD(Spoofchecker, setChecks)
zend_long checks;
SPOOFCHECKER_METHOD_INIT_VARS;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &checks)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &checks)) {
return;
}
@@ -127,7 +127,7 @@ PHP_METHOD(Spoofchecker, setChecks)
uspoof_setChecks(co->uspoof, checks, SPOOFCHECKER_ERROR_CODE_P(co));
if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
+ php_error_docref(NULL, E_WARNING, "(%d) %s", SPOOFCHECKER_ERROR_CODE(co), u_errorName(SPOOFCHECKER_ERROR_CODE(co)));
}
}
/* }}} */
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index d2aaa12344..6818d0d9d8 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -45,7 +45,7 @@ U_CDECL_END
/* }}} */
/* {{{ timezone_object_construct */
-U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC)
+U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int owned)
{
TimeZone_object *to;
@@ -60,7 +60,7 @@ U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int o
* Convert from TimeZone to DateTimeZone object */
U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
intl_error *outside_error,
- const char *func, zval *ret TSRMLS_DC)
+ const char *func, zval *ret)
{
UnicodeString id;
char *message = NULL;
@@ -71,7 +71,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
if (id.isBogus()) {
spprintf(&message, 0, "%s: could not obtain TimeZone id", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
+ message, 1);
goto error;
}
@@ -92,7 +92,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
if (intl_charFromString(id, &str, &str_len, &INTL_ERROR_CODE(*outside_error)) == FAILURE) {
spprintf(&message, 0, "%s: could not convert id to UTF-8", func);
intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error),
- message, 1 TSRMLS_CC);
+ message, 1);
goto error;
}
ZVAL_STRINGL(&arg, str, str_len);
@@ -103,8 +103,8 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
spprintf(&message, 0,
"%s: DateTimeZone constructor threw exception", func);
intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
- message, 1 TSRMLS_CC);
- zend_object_store_ctor_failed(Z_OBJ_P(ret) TSRMLS_CC);
+ message, 1);
+ zend_object_store_ctor_failed(Z_OBJ_P(ret));
zval_ptr_dtor(&arg);
goto error;
}
@@ -130,14 +130,14 @@ error:
* TimeZone argument processor. outside_error may be NULL (for static functions/constructors) */
U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
intl_error *outside_error,
- const char *func TSRMLS_DC)
+ const char *func)
{
zval local_zv_tz;
char *message = NULL;
TimeZone *timeZone;
if (zv_timezone == NULL || Z_TYPE_P(zv_timezone) == IS_NULL) {
- timelib_tzinfo *tzinfo = get_timezone_info(TSRMLS_C);
+ timelib_tzinfo *tzinfo = get_timezone_info();
ZVAL_STRING(&local_zv_tz, tzinfo->name);
zv_timezone = &local_zv_tz;
} else {
@@ -145,13 +145,13 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
}
if (Z_TYPE_P(zv_timezone) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(zv_timezone), TimeZone_ce_ptr)) {
TimeZone_object *to = Z_INTL_TIMEZONE_P(zv_timezone);
if (to->utimezone == NULL) {
spprintf(&message, 0, "%s: passed IntlTimeZone is not "
"properly constructed", func);
if (message) {
- intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -161,20 +161,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
if (timeZone == NULL) {
spprintf(&message, 0, "%s: could not clone TimeZone", func);
if (message) {
- intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
return NULL;
}
} else if (Z_TYPE_P(zv_timezone) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce() TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(zv_timezone), php_date_get_timezone_ce())) {
php_timezone_obj *tzobj = Z_PHPTIMEZONE_P(zv_timezone);
zval_dtor(&local_zv_tz);
return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
- outside_error, func TSRMLS_CC);
+ outside_error, func);
} else {
UnicodeString id,
gottenId;
@@ -185,7 +185,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
spprintf(&message, 0, "%s: Time zone identifier given is not a "
"valid UTF-8 string", func);
if (message) {
- intl_errors_set(outside_error, status, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, status, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -195,7 +195,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
if (timeZone == NULL) {
spprintf(&message, 0, "%s: could not create time zone", func);
if (message) {
- intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -205,7 +205,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
spprintf(&message, 0, "%s: no such time zone: '%s'",
func, Z_STRVAL_P(zv_timezone));
if (message) {
- intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+ intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1);
efree(message);
}
zval_dtor(&local_zv_tz);
@@ -221,20 +221,20 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
/* }}} */
/* {{{ clone handler for TimeZone */
-static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
+static zend_object *TimeZone_clone_obj(zval *object)
{
TimeZone_object *to_orig,
*to_new;
zend_object *ret_val;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
to_orig = Z_INTL_TIMEZONE_P(object);
- intl_error_reset(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC);
+ intl_error_reset(TIMEZONE_ERROR_P(to_orig));
- ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
+ ret_val = TimeZone_ce_ptr->create_object(Z_OBJCE_P(object));
to_new = php_intl_timezone_fetch_object(ret_val);
- zend_objects_clone_members(&to_new->zo, &to_orig->zo TSRMLS_CC);
+ zend_objects_clone_members(&to_new->zo, &to_orig->zo);
if (to_orig->utimezone != NULL) {
TimeZone *newTimeZone;
@@ -244,17 +244,17 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
if (!newTimeZone) {
zend_string *err_msg;
intl_errors_set_code(TIMEZONE_ERROR_P(to_orig),
- U_MEMORY_ALLOCATION_ERROR TSRMLS_CC);
+ U_MEMORY_ALLOCATION_ERROR);
intl_errors_set_custom_msg(TIMEZONE_ERROR_P(to_orig),
- "Could not clone IntlTimeZone", 0 TSRMLS_CC);
- err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig) TSRMLS_CC);
- zend_throw_exception(NULL, err_msg->val, 0 TSRMLS_CC);
+ "Could not clone IntlTimeZone", 0);
+ err_msg = intl_error_get_message(TIMEZONE_ERROR_P(to_orig));
+ zend_throw_exception(NULL, err_msg->val, 0);
zend_string_free(err_msg);
} else {
to_new->utimezone = newTimeZone;
}
} else {
- zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0 TSRMLS_CC);
+ zend_throw_exception(NULL, "Cannot clone unconstructed IntlTimeZone", 0);
}
return ret_val;
@@ -263,7 +263,7 @@ static zend_object *TimeZone_clone_obj(zval *object TSRMLS_DC)
/* {{{ compare_objects handler for TimeZone
* Can't be used for >, >=, <, <= comparisons */
-static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
+static int TimeZone_compare_objects(zval *object1, zval *object2)
{
TimeZone_object *to1,
*to2;
@@ -272,7 +272,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
if (to1->utimezone == NULL || to2->utimezone == NULL) {
zend_throw_exception(NULL, "Comparison with at least one unconstructed "
- "IntlTimeZone operand", 0 TSRMLS_CC);
+ "IntlTimeZone operand", 0);
/* intentionally not returning */
} else {
if (*to1->utimezone == *to2->utimezone) {
@@ -285,7 +285,7 @@ static int TimeZone_compare_objects(zval *object1, zval *object2 TSRMLS_DC)
/* }}} */
/* {{{ get_debug_info handler for TimeZone */
-static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp)
{
zval zv;
TimeZone_object *to;
@@ -343,23 +343,23 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ void TimeZone_object_init(TimeZone_object* to)
* Initialize internals of TImeZone_object not specific to zend standard objects.
*/
-static void TimeZone_object_init(TimeZone_object *to TSRMLS_DC)
+static void TimeZone_object_init(TimeZone_object *to)
{
- intl_error_init(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ intl_error_init(TIMEZONE_ERROR_P(to));
to->utimezone = NULL;
to->should_delete = 0;
}
/* }}} */
/* {{{ TimeZone_objects_dtor */
-static void TimeZone_objects_dtor(zend_object *object TSRMLS_DC)
+static void TimeZone_objects_dtor(zend_object *object)
{
- zend_objects_destroy_object(object TSRMLS_CC);
+ zend_objects_destroy_object(object);
}
/* }}} */
/* {{{ TimeZone_objects_free */
-static void TimeZone_objects_free(zend_object *object TSRMLS_DC)
+static void TimeZone_objects_free(zend_object *object)
{
TimeZone_object* to = php_intl_timezone_fetch_object(object);
@@ -367,22 +367,22 @@ static void TimeZone_objects_free(zend_object *object TSRMLS_DC)
delete to->utimezone;
to->utimezone = NULL;
}
- intl_error_reset(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ intl_error_reset(TIMEZONE_ERROR_P(to));
- zend_object_std_dtor(&to->zo TSRMLS_CC);
+ zend_object_std_dtor(&to->zo);
}
/* }}} */
/* {{{ TimeZone_object_create */
-static zend_object *TimeZone_object_create(zend_class_entry *ce TSRMLS_DC)
+static zend_object *TimeZone_object_create(zend_class_entry *ce)
{
TimeZone_object* intern;
intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
- TimeZone_object_init(intern TSRMLS_CC);
+ TimeZone_object_init(intern);
intern->zo.handlers = &TimeZone_handlers;
@@ -487,17 +487,17 @@ static zend_function_entry TimeZone_class_functions[] = {
/* {{{ timezone_register_IntlTimeZone_class
* Initialize 'IntlTimeZone' class
*/
-U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D)
+U_CFUNC void timezone_register_IntlTimeZone_class(void)
{
zend_class_entry ce;
/* Create and register 'IntlTimeZone' class. */
INIT_CLASS_ENTRY(ce, "IntlTimeZone", TimeZone_class_functions);
ce.create_object = TimeZone_object_create;
- TimeZone_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
+ TimeZone_ce_ptr = zend_register_internal_class(&ce);
if (!TimeZone_ce_ptr) {
//can't happen now without bigger problems before
- php_error_docref0(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref0(NULL, E_ERROR,
"IntlTimeZone: class registration has failed.");
return;
}
@@ -515,7 +515,7 @@ U_CFUNC void timezone_register_IntlTimeZone_class(TSRMLS_D)
/* Declare 'IntlTimeZone' class constants */
#define TIMEZONE_DECL_LONG_CONST(name, val) \
zend_declare_class_constant_long(TimeZone_ce_ptr, name, sizeof(name) - 1, \
- val TSRMLS_CC)
+ val)
TIMEZONE_DECL_LONG_CONST("DISPLAY_SHORT", TimeZone::SHORT);
TIMEZONE_DECL_LONG_CONST("DISPLAY_LONG", TimeZone::LONG);
diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h
index 94b781b332..0667c78994 100644
--- a/ext/intl/timezone/timezone_class.h
+++ b/ext/intl/timezone/timezone_class.h
@@ -60,16 +60,16 @@ static inline TimeZone_object *php_intl_timezone_fetch_object(zend_object *obj)
#define TIMEZONE_METHOD_FETCH_OBJECT\
TIMEZONE_METHOD_FETCH_OBJECT_NO_CHECK; \
if (to->utimezone == NULL) { \
- intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0 TSRMLS_CC); \
+ intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0); \
RETURN_FALSE; \
}
-zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret TSRMLS_DC);
-TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func TSRMLS_DC);
+zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret);
+TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func);
-void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC);
+void timezone_object_construct(const TimeZone *zone, zval *object, int owned);
-void timezone_register_IntlTimeZone_class(TSRMLS_D);
+void timezone_register_IntlTimeZone_class(void);
extern zend_class_entry *TimeZone_ce_ptr;
extern zend_object_handlers TimeZone_handlers;
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index 033b216cdf..98ae6f97aa 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -41,19 +41,19 @@ U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
{
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator",
- 0 TSRMLS_CC );
+ 0 );
}
U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
{
char *str_id;
size_t str_id_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_time_zone: bad arguments", 0);
RETURN_NULL();
}
@@ -61,13 +61,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
UnicodeString id = UnicodeString();
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_create_time_zone: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_create_time_zone: could not convert time zone id to UTF-16", 0);
RETURN_NULL();
}
//guaranteed non-null; GMT if timezone cannot be understood
TimeZone *tz = TimeZone::createTimeZone(id);
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
@@ -75,12 +75,12 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
zval *zv_timezone;
TimeZone *tz;
php_timezone_obj *tzobj;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O",
&zv_timezone, php_date_get_timezone_ce()) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_from_date_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_from_date_time_zone: bad arguments", 0);
RETURN_NULL();
}
@@ -88,58 +88,58 @@ U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
if (!tzobj->initialized) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_from_date_time_zone: DateTimeZone object is unconstructed",
- 0 TSRMLS_CC);
+ 0);
RETURN_NULL();
}
tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL,
- "intltz_from_date_time_zone" TSRMLS_CC);
+ "intltz_from_date_time_zone");
if (tz == NULL) {
RETURN_NULL();
}
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_create_default)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_default: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_default: bad arguments", 0);
RETURN_NULL();
}
TimeZone *tz = TimeZone::createDefault();
- timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+ timezone_object_construct(tz, return_value, 1);
}
U_CFUNC PHP_FUNCTION(intltz_get_gmt)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_gmt: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_gmt: bad arguments", 0);
RETURN_NULL();
}
- timezone_object_construct(TimeZone::getGMT(), return_value, 0 TSRMLS_CC);
+ timezone_object_construct(TimeZone::getGMT(), return_value, 0);
}
#if U_ICU_VERSION_MAJOR_NUM >= 49
U_CFUNC PHP_FUNCTION(intltz_get_unknown)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_unknown: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_unknown: bad arguments", 0);
RETURN_NULL();
}
- timezone_object_construct(&TimeZone::getUnknown(), return_value, 0 TSRMLS_CC);
+ timezone_object_construct(&TimeZone::getUnknown(), return_value, 0);
}
#endif
@@ -147,13 +147,13 @@ U_CFUNC PHP_FUNCTION(intltz_create_enumeration)
{
zval *arg = NULL;
StringEnumeration *se = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
/* double indirection to have the zend engine destroy the new zval that
* results from separation */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_enumeration: bad arguments", 0);
RETURN_FALSE;
}
@@ -164,7 +164,7 @@ int_offset:
if (Z_LVAL_P(arg) < (zend_long)INT32_MIN ||
Z_LVAL_P(arg) > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: value is out of range", 0 TSRMLS_CC);
+ "intltz_create_enumeration: value is out of range", 0);
RETURN_FALSE;
} else {
se = TimeZone::createEnumeration((int32_t) Z_LVAL_P(arg));
@@ -193,15 +193,15 @@ double_offset:
se = TimeZone::createEnumeration(Z_STRVAL_P(arg));
} else {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: invalid argument type", 0 TSRMLS_CC);
+ "intltz_create_enumeration: invalid argument type", 0);
RETURN_FALSE;
}
if (se) {
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
} else {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_enumeration: error obtaining enumeration", 0 TSRMLS_CC);
+ "intltz_create_enumeration: error obtaining enumeration", 0);
RETVAL_FALSE;
}
}
@@ -210,12 +210,12 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
{
char *str_id;
size_t str_id_len;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_count_equivalent_ids: bad arguments", 0 TSRMLS_CC);
+ "intltz_count_equivalent_ids: bad arguments", 0);
RETURN_FALSE;
}
@@ -223,7 +223,7 @@ U_CFUNC PHP_FUNCTION(intltz_count_equivalent_ids)
UnicodeString id = UnicodeString();
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_count_equivalent_ids: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -241,7 +241,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
int32_t offset,
*offsetp = NULL;
int arg3isnull = 0;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
/* must come before zpp because zpp would convert the arg in the stack to 0 */
if (ZEND_NUM_ARGS() == 3) {
@@ -250,24 +250,24 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
!= FAILURE && Z_TYPE_P(zvoffset) == IS_NULL;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s!l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l",
&zoneType, &region, &region_len, &offset_arg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: bad arguments", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: bad arguments", 0);
RETURN_FALSE;
}
if (zoneType != UCAL_ZONE_TYPE_ANY && zoneType != UCAL_ZONE_TYPE_CANONICAL
&& zoneType != UCAL_ZONE_TYPE_CANONICAL_LOCATION) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: bad zone type", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: bad zone type", 0);
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 3) {
if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_create_time_zone_id_enumeration: offset out of bounds", 0 TSRMLS_CC);
+ "intltz_create_time_zone_id_enumeration: offset out of bounds", 0);
RETURN_FALSE;
}
@@ -284,7 +284,7 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
INTL_CHECK_STATUS(uec, "intltz_create_time_zone_id_enumeration: "
"Error obtaining time zone id enumeration")
- IntlIterator_from_StringEnumeration(se, return_value TSRMLS_CC);
+ IntlIterator_from_StringEnumeration(se, return_value);
}
#endif
@@ -293,12 +293,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
char *str_id;
size_t str_id_len;
zval *is_systemid = NULL;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z",
&str_id, &str_id_len, &is_systemid) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_canonical_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_canonical_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -306,7 +306,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_canonical_id)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_canonical_id: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -337,12 +337,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
char *str_id;
size_t str_id_len;
char outbuf[3];
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&str_id, &str_id_len) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_region: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_region: bad arguments", 0);
RETURN_FALSE;
}
@@ -350,7 +350,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_region: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_region: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -363,11 +363,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_region)
U_CFUNC PHP_FUNCTION(intltz_get_tz_data_version)
{
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_tz_data_version: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_tz_data_version: bad arguments", 0);
RETURN_FALSE;
}
@@ -384,13 +384,13 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
char *str_id;
size_t str_id_len;
zend_long index;
- intl_error_reset(NULL TSRMLS_CC);
+ intl_error_reset(NULL);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl",
&str_id, &str_id_len, &index) == FAILURE ||
index < (zend_long)INT32_MIN || index > (zend_long)INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_equivalent_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_equivalent_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -398,7 +398,7 @@ U_CFUNC PHP_FUNCTION(intltz_get_equivalent_id)
UnicodeString id;
if (intl_stringFromChar(id, str_id, str_id_len, &status) == FAILURE) {
intl_error_set(NULL, status,
- "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0 TSRMLS_CC);
+ "intltz_get_equivalent_id: could not convert time zone id to UTF-16", 0);
RETURN_FALSE;
}
@@ -418,10 +418,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_id)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_id: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_id: bad arguments", 0);
RETURN_FALSE;
}
@@ -446,10 +446,10 @@ U_CFUNC PHP_FUNCTION(intltz_use_daylight_time)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_use_daylight_time: bad arguments", 0 TSRMLS_CC);
+ "intltz_use_daylight_time: bad arguments", 0);
RETURN_FALSE;
}
@@ -468,11 +468,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_offset)
dstOffset;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Odbz/z/", &object, TimeZone_ce_ptr, &date, &local, &rawOffsetArg,
&dstOffsetArg) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_offset: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_offset: bad arguments", 0);
RETURN_FALSE;
}
@@ -497,10 +497,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_raw_offset)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_raw_offset: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_raw_offset: bad arguments", 0);
RETURN_FALSE;
}
@@ -515,18 +515,18 @@ U_CFUNC PHP_FUNCTION(intltz_has_same_rules)
TimeZone_object *other_to;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, TimeZone_ce_ptr, &other_object, TimeZone_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_has_same_rules: bad arguments", 0 TSRMLS_CC);
+ "intltz_has_same_rules: bad arguments", 0);
RETURN_FALSE;
}
TIMEZONE_METHOD_FETCH_OBJECT;
other_to = Z_INTL_TIMEZONE_P(other_object);
if (other_to->utimezone == NULL) {
intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0 TSRMLS_CC);
+ "intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0);
RETURN_FALSE;
}
@@ -550,11 +550,11 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
size_t dummy = 0;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O|bls!", &object, TimeZone_ce_ptr, &daylight, &display_type,
&locale_str, &dummy) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_display_name: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_display_name: bad arguments", 0);
RETURN_FALSE;
}
@@ -565,12 +565,12 @@ U_CFUNC PHP_FUNCTION(intltz_get_display_name)
}
if (!found) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_display_name: wrong display type", 0 TSRMLS_CC);
+ "intltz_get_display_name: wrong display type", 0);
RETURN_FALSE;
}
if (!locale_str) {
- locale_str = intl_locale_get_default(TSRMLS_C);
+ locale_str = intl_locale_get_default();
}
TIMEZONE_METHOD_FETCH_OBJECT;
@@ -594,10 +594,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings)
{
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_dst_savings: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_dst_savings: bad arguments", 0);
RETURN_FALSE;
}
@@ -611,17 +611,17 @@ U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone)
zval tmp;
TIMEZONE_METHOD_INIT_VARS;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"O", &object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_to_date_time_zone: bad arguments", 0 TSRMLS_CC);
+ "intltz_to_date_time_zone: bad arguments", 0);
RETURN_FALSE;
}
TIMEZONE_METHOD_FETCH_OBJECT;
zval *ret = timezone_convert_to_datetimezone(to->utimezone,
- &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp TSRMLS_CC);
+ &TIMEZONE_ERROR(to), "intltz_to_date_time_zone", &tmp);
if (ret) {
RETURN_ZVAL(ret, 1, 1);
@@ -634,10 +634,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_code)
{
TIMEZONE_METHOD_INIT_VARS
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_error_code: bad arguments", 0 TSRMLS_CC);
+ "intltz_get_error_code: bad arguments", 0);
RETURN_FALSE;
}
@@ -654,10 +654,10 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message)
zend_string* message = NULL;
TIMEZONE_METHOD_INIT_VARS
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&object, TimeZone_ce_ptr) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intltz_get_error_message: bad arguments", 0 TSRMLS_CC );
+ "intltz_get_error_message: bad arguments", 0 );
RETURN_FALSE;
}
@@ -668,6 +668,6 @@ U_CFUNC PHP_FUNCTION(intltz_get_error_message)
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message(TIMEZONE_ERROR_P(to) TSRMLS_CC);
+ message = intl_error_get_message(TIMEZONE_ERROR_P(to));
RETURN_STR(message);
}
diff --git a/ext/intl/transliterator/transliterator.c b/ext/intl/transliterator/transliterator.c
index fda183b85a..e7f2ffd72c 100644
--- a/ext/intl/transliterator/transliterator.c
+++ b/ext/intl/transliterator/transliterator.c
@@ -36,8 +36,8 @@ void transliterator_register_constants( INIT_FUNC_ARGS )
}
#define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_LONG_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS )
- #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x TSRMLS_CC );
- #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );*/
+ #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x );
+ #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value );*/
/* Normalization form constants */
TRANSLITERATOR_EXPOSE_CLASS_CONST( FORWARD );
diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c
index 647ece8ba0..4b799d1802 100644
--- a/ext/intl/transliterator/transliterator_class.c
+++ b/ext/intl/transliterator/transliterator_class.c
@@ -27,12 +27,12 @@ zend_class_entry *Transliterator_ce_ptr = NULL;
zend_object_handlers Transliterator_handlers;
-/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status TSRMLS_DC )
+/* {{{ int transliterator_object_construct( zval *object, UTransliterator *utrans, UErrorCode *status )
* Initialize internals of Transliterator_object.
*/
int transliterator_object_construct( zval *object,
UTransliterator *utrans,
- UErrorCode *status TSRMLS_DC )
+ UErrorCode *status )
{
const UChar *ustr_id;
int32_t ustr_id_len;
@@ -56,7 +56,7 @@ int transliterator_object_construct( zval *object,
}
zend_update_property_stringl(Transliterator_ce_ptr, object,
- "id", sizeof( "id" ) - 1, str_id, str_id_len TSRMLS_CC );
+ "id", sizeof( "id" ) - 1, str_id, str_id_len );
efree( str_id );
return SUCCESS;
}
@@ -69,19 +69,19 @@ int transliterator_object_construct( zval *object,
/* {{{ void transliterator_object_init( Transliterator_object* to )
* Initialize internals of Transliterator_object.
*/
-static void transliterator_object_init( Transliterator_object* to TSRMLS_DC )
+static void transliterator_object_init( Transliterator_object* to )
{
if( !to )
return;
- intl_error_init( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_init( TRANSLITERATOR_ERROR_P( to ) );
}
/* }}} */
/* {{{ void transliterator_object_destroy( Transliterator_object* to )
* Clean up mem allocted by internals of Transliterator_object
*/
-static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC )
+static void transliterator_object_destroy( Transliterator_object* to )
{
if( !to )
return;
@@ -92,40 +92,40 @@ static void transliterator_object_destroy( Transliterator_object* to TSRMLS_DC )
to->utrans = NULL;
}
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
}
/* }}} */
/* {{{ Transliterator_objects_dtor */
static void Transliterator_objects_dtor(
- zend_object *object TSRMLS_DC )
+ zend_object *object )
{
- zend_objects_destroy_object( object TSRMLS_CC );
+ zend_objects_destroy_object( object );
}
/* }}} */
/* {{{ Transliterator_objects_free */
-static void Transliterator_objects_free( zend_object *object TSRMLS_DC )
+static void Transliterator_objects_free( zend_object *object )
{
Transliterator_object* to = php_intl_transliterator_fetch_object(object);
- zend_object_std_dtor( &to->zo TSRMLS_CC );
+ zend_object_std_dtor( &to->zo );
- transliterator_object_destroy( to TSRMLS_CC );
+ transliterator_object_destroy( to );
}
/* }}} */
/* {{{ Transliterator_object_create */
static zend_object *Transliterator_object_create(
- zend_class_entry *ce TSRMLS_DC )
+ zend_class_entry *ce )
{
Transliterator_object* intern;
intern = ecalloc( 1, sizeof( Transliterator_object ) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ zend_object_std_init( &intern->zo, ce );
object_properties_init( &intern->zo, ce );
- transliterator_object_init( intern TSRMLS_CC );
+ transliterator_object_init( intern );
intern->zo.handlers = &Transliterator_handlers;
@@ -138,19 +138,19 @@ static zend_object *Transliterator_object_create(
*/
/* {{{ clone handler for Transliterator */
-static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
+static zend_object *Transliterator_clone_obj( zval *object )
{
Transliterator_object *to_orig,
*to_new;
zend_object *ret_val;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
to_orig = Z_INTL_TRANSLITERATOR_P( object );
- intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC );
- ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC );
+ intl_error_reset( INTL_DATA_ERROR_P( to_orig ) );
+ ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) );
to_new = php_intl_transliterator_fetch_object( ret_val );
- zend_objects_clone_members( &to_new->zo, &to_orig->zo TSRMLS_CC );
+ zend_objects_clone_members( &to_new->zo, &to_orig->zo );
if( to_orig->utrans != NULL )
{
@@ -165,7 +165,7 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
ZVAL_OBJ(&tempz, ret_val);
transliterator_object_construct( &tempz, utrans,
- TRANSLITERATOR_ERROR_CODE_P( to_orig ) TSRMLS_CC );
+ TRANSLITERATOR_ERROR_CODE_P( to_orig ) );
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to_orig ) ) )
{
@@ -173,16 +173,16 @@ static zend_object *Transliterator_clone_obj( zval *object TSRMLS_DC )
err:
if( utrans != NULL )
- transliterator_object_destroy( to_new TSRMLS_CC );
+ transliterator_object_destroy( to_new );
/* set the error anyway, in case in the future we decide not to
* throw an error. It also helps build the error message */
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to_orig ) );
intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to_orig ),
- "Could not clone transliterator", 0 TSRMLS_CC );
+ "Could not clone transliterator", 0 );
- err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) TSRMLS_CC );
- php_error_docref( NULL TSRMLS_CC, E_ERROR, "%s", err_msg->val );
+ err_msg = intl_error_get_message( TRANSLITERATOR_ERROR_P( to_orig ) );
+ php_error_docref( NULL, E_ERROR, "%s", err_msg->val );
zend_string_free( err_msg ); /* if it's changed into a warning */
/* do not destroy tempz; we need to return something */
}
@@ -190,7 +190,7 @@ err:
else
{
/* We shouldn't have unconstructed objects in the first place */
- php_error_docref( NULL TSRMLS_CC, E_WARNING,
+ php_error_docref( NULL, E_WARNING,
"Cloning unconstructed transliterator." );
}
@@ -216,7 +216,7 @@ err:
}
/* {{{ get_property_ptr_ptr handler */
-static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot TSRMLS_DC )
+static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, int type, void **cache_slot )
{
zval *retval;
@@ -229,7 +229,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in
}
else
{
- retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot TSRMLS_CC );
+ retval = std_object_handlers.get_property_ptr_ptr( object, member, type, cache_slot );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -239,7 +239,7 @@ static zval *Transliterator_get_property_ptr_ptr( zval *object, zval *member, in
/* }}} */
/* {{{ read_property handler */
-static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC )
+static zval *Transliterator_read_property( zval *object, zval *member, int type, void **cache_slot, zval *rv )
{
zval *retval;
@@ -249,12 +249,12 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
retval = &EG( uninitialized_zval );
}
else
{
- retval = std_object_handlers.read_property( object, member, type, cache_slot, rv TSRMLS_CC );
+ retval = std_object_handlers.read_property( object, member, type, cache_slot, rv );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -266,7 +266,7 @@ static zval *Transliterator_read_property( zval *object, zval *member, int type,
/* {{{ write_property handler */
static void Transliterator_write_property( zval *object, zval *member, zval *value,
- void **cache_slot TSRMLS_DC )
+ void **cache_slot )
{
TRANSLITERATOR_PROPERTY_HANDLER_PROLOG;
@@ -274,11 +274,11 @@ static void Transliterator_write_property( zval *object, zval *member, zval *val
( zend_binary_strcmp( "id", sizeof( "id" ) - 1,
Z_STRVAL_P( member ), Z_STRLEN_P( member ) ) == 0 ) )
{
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "The property \"id\" is read-only" );
+ php_error_docref0( NULL, E_WARNING, "The property \"id\" is read-only" );
}
else
{
- std_object_handlers.write_property( object, member, value, cache_slot TSRMLS_CC );
+ std_object_handlers.write_property( object, member, value, cache_slot );
}
TRANSLITERATOR_PROPERTY_HANDLER_EPILOG;
@@ -339,14 +339,14 @@ zend_function_entry Transliterator_class_functions[] = {
/* {{{ transliterator_register_Transliterator_class
* Initialize 'Transliterator' class
*/
-void transliterator_register_Transliterator_class( TSRMLS_D )
+void transliterator_register_Transliterator_class( void )
{
zend_class_entry ce;
/* Create and register 'Transliterator' class. */
INIT_CLASS_ENTRY( ce, "Transliterator", Transliterator_class_functions );
ce.create_object = Transliterator_object_create;
- Transliterator_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
+ Transliterator_ce_ptr = zend_register_internal_class( &ce );
memcpy( &Transliterator_handlers, zend_get_std_object_handlers(),
sizeof Transliterator_handlers );
Transliterator_handlers.offset = XtOffsetOf(Transliterator_object, zo);
@@ -366,7 +366,7 @@ void transliterator_register_Transliterator_class( TSRMLS_D )
return;
}
zend_declare_property_null( Transliterator_ce_ptr,
- "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC TSRMLS_CC );
+ "id", sizeof( "id" ) - 1, ZEND_ACC_PUBLIC );
/* constants are declared in transliterator_register_constants, called from MINIT */
diff --git a/ext/intl/transliterator/transliterator_class.h b/ext/intl/transliterator/transliterator_class.h
index f70e86995f..83e99b6f73 100644
--- a/ext/intl/transliterator/transliterator_class.h
+++ b/ext/intl/transliterator/transliterator_class.h
@@ -54,15 +54,15 @@ static inline Transliterator_object *php_intl_transliterator_fetch_object(zend_o
TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
if( to->utrans == NULL ) \
{ \
- intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 TSRMLS_CC ); \
+ intl_errors_set( &to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed transliterator", 0 ); \
RETURN_FALSE; \
}
int transliterator_object_construct( zval *object,
UTransliterator *utrans,
- UErrorCode *status TSRMLS_DC );
+ UErrorCode *status );
-void transliterator_register_Transliterator_class( TSRMLS_D );
+void transliterator_register_Transliterator_class( void );
extern zend_class_entry *Transliterator_ce_ptr;
extern zend_object_handlers Transliterator_handlers;
diff --git a/ext/intl/transliterator/transliterator_methods.c b/ext/intl/transliterator/transliterator_methods.c
index e79aeb1621..66db8bf522 100644
--- a/ext/intl/transliterator/transliterator_methods.c
+++ b/ext/intl/transliterator/transliterator_methods.c
@@ -27,7 +27,7 @@
#include <zend_exceptions.h>
-static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object TSRMLS_DC )
+static int create_transliterator( char *str_id, int str_id_len, zend_long direction, zval *object )
{
Transliterator_object *to;
UChar *ustr_id = NULL;
@@ -35,12 +35,12 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
UTransliterator *utrans;
UParseError parse_error = {0, -1};
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create: invalid direction", 0 TSRMLS_CC );
+ "transliterator_create: invalid direction", 0 );
return FAILURE;
}
@@ -51,8 +51,8 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
intl_convert_utf8_to_utf16( &ustr_id, &ustr_id_len, str_id, str_id_len, TRANSLITERATOR_ERROR_CODE_P( to ) );
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
- intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
+ intl_error_set_custom_msg( NULL, "String conversion of id to UTF-16 failed", 0 );
zval_dtor( object );
return FAILURE;
}
@@ -67,29 +67,29 @@ static int create_transliterator( char *str_id, int str_id_len, zend_long direct
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
char *buf = NULL;
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
spprintf( &buf, 0, "transliterator_create: unable to open ICU transliterator"
" with id \"%s\"", str_id );
if( buf == NULL ) {
intl_error_set_custom_msg( NULL,
- "transliterator_create: unable to open ICU transliterator", 0 TSRMLS_CC );
+ "transliterator_create: unable to open ICU transliterator", 0 );
}
else
{
- intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 TSRMLS_CC );
+ intl_error_set_custom_msg( NULL, buf, /* copy message */ 1 );
efree( buf );
}
zval_dtor( object );
return FAILURE;
}
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
intl_error_set_custom_msg( NULL,
- "transliterator_create: internal constructor call failed", 0 TSRMLS_CC );
+ "transliterator_create: internal constructor call failed", 0 );
zval_dtor( object );
return FAILURE;
}
@@ -112,16 +112,16 @@ PHP_FUNCTION( transliterator_create )
(void) to; /* unused */
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l",
&str_id, &str_id_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create: bad arguments", 0 );
RETURN_NULL();
}
object = return_value;
- res = create_transliterator( str_id, str_id_len, direction, object TSRMLS_CC );
+ res = create_transliterator( str_id, str_id_len, direction, object );
if( res == FAILURE )
RETURN_NULL();
@@ -146,18 +146,18 @@ PHP_FUNCTION( transliterator_create_from_rules )
0x61, 0x6E, 0x73, 0x50, 0x48, 0x50, 0}; /* RulesTransPHP */
TRANSLITERATOR_METHOD_INIT_VARS;
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|l",
&str_rules, &str_rules_len, &direction ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_from_rules: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create_from_rules: bad arguments", 0 );
RETURN_NULL();
}
if( ( direction != TRANSLITERATOR_FORWARD ) && (direction != TRANSLITERATOR_REVERSE ) )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_from_rules: invalid direction", 0 TSRMLS_CC );
+ "transliterator_create_from_rules: invalid direction", 0 );
RETURN_NULL();
}
@@ -178,7 +178,7 @@ PHP_FUNCTION( transliterator_create_from_rules )
efree( ustr_rules );
}
- intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, INTL_DATA_ERROR_CODE( to ) );
if( U_FAILURE( INTL_DATA_ERROR_CODE( to ) ) )
{
char *msg = NULL;
@@ -189,13 +189,13 @@ PHP_FUNCTION( transliterator_create_from_rules )
smart_str_free( &parse_error_str );
if( msg != NULL )
{
- intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 TSRMLS_CC );
+ intl_errors_set_custom_msg( INTL_DATA_ERROR_P( to ), msg, 1 );
efree( msg );
}
zval_dtor( return_value );
RETURN_NULL();
}
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
INTL_CTOR_CHECK_STATUS( to, "transliterator_create_from_rules: internal constructor call failed" );
}
@@ -211,11 +211,11 @@ PHP_FUNCTION( transliterator_create_inverse )
UTransliterator *utrans;
TRANSLITERATOR_METHOD_INIT_VARS;
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_create_inverse: bad arguments", 0 TSRMLS_CC );
+ "transliterator_create_inverse: bad arguments", 0 );
RETURN_NULL();
}
@@ -229,7 +229,7 @@ PHP_FUNCTION( transliterator_create_inverse )
utrans = utrans_openInverse( to_orig->utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
INTL_CTOR_CHECK_STATUS( to, "transliterator_create_inverse: could not create "
"inverse ICU transliterator" );
- transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) TSRMLS_CC );
+ transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */
INTL_CTOR_CHECK_STATUS( to, "transliterator_create: internal constructor call failed" );
}
@@ -246,7 +246,7 @@ PHP_FUNCTION( transliterator_list_ids )
int32_t elem_len;
UErrorCode status = U_ZERO_ERROR;
- intl_error_reset( NULL TSRMLS_CC );
+ intl_error_reset( NULL );
if( zend_parse_parameters_none() == FAILURE )
{
@@ -254,7 +254,7 @@ PHP_FUNCTION( transliterator_list_ids )
* null on bad parameter types, except on constructors and factory
* methods */
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_list_ids: bad arguments", 0 TSRMLS_CC );
+ "transliterator_list_ids: bad arguments", 0 );
RETURN_FALSE;
}
@@ -284,13 +284,13 @@ PHP_FUNCTION( transliterator_list_ids )
}
uenum_close( en );
- intl_error_set_code( NULL, status TSRMLS_CC );
+ intl_error_set_code( NULL, status );
if( U_FAILURE( status ) )
{
zval_dtor( return_value );
RETVAL_FALSE;
intl_error_set_custom_msg( NULL, "transliterator_list_ids: "
- "Failed to build array of registered transliterators", 0 TSRMLS_CC );
+ "Failed to build array of registered transliterators", 0 );
}
}
/* }}} */
@@ -320,16 +320,16 @@ PHP_FUNCTION( transliterator_transliterate )
{
/* in non-OOP version, accept both a transliterator and a string */
zval *arg1;
- if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "zs|ll",
+ if( zend_parse_parameters( ZEND_NUM_ARGS(), "zs|ll",
&arg1, &str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_transliterate: bad arguments", 0 TSRMLS_CC );
+ "transliterator_transliterate: bad arguments", 0 );
RETURN_FALSE;
}
if( Z_TYPE_P( arg1 ) == IS_OBJECT &&
- instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr TSRMLS_CC ) )
+ instanceof_function( Z_OBJCE_P( arg1 ), Transliterator_ce_ptr ) )
{
object = arg1;
}
@@ -343,11 +343,11 @@ PHP_FUNCTION( transliterator_transliterate )
}
object = &tmp_object;
res = create_transliterator( Z_STRVAL_P( arg1 ), Z_STRLEN_P( arg1 ),
- TRANSLITERATOR_FORWARD, object TSRMLS_CC );
+ TRANSLITERATOR_FORWARD, object );
if( res == FAILURE )
{
- zend_string *message = intl_error_get_message( NULL TSRMLS_CC );
- php_error_docref0( NULL TSRMLS_CC, E_WARNING, "Could not create "
+ zend_string *message = intl_error_get_message( NULL );
+ php_error_docref0( NULL, E_WARNING, "Could not create "
"transliterator with ID \"%s\" (%s)", Z_STRVAL_P( arg1 ), message->val );
zend_string_free( message );
/* don't set U_ILLEGAL_ARGUMENT_ERROR to allow fetching of inner error */
@@ -355,11 +355,11 @@ PHP_FUNCTION( transliterator_transliterate )
}
}
}
- else if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|ll",
+ else if( zend_parse_parameters( ZEND_NUM_ARGS(), "s|ll",
&str, &str_len, &start, &limit ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_transliterate: bad arguments", 0 TSRMLS_CC );
+ "transliterator_transliterate: bad arguments", 0 );
RETURN_FALSE;
}
@@ -367,7 +367,7 @@ PHP_FUNCTION( transliterator_transliterate )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"end\" argument should be "
- "either non-negative or -1", 0 TSRMLS_CC );
+ "either non-negative or -1", 0 );
RETURN_FALSE;
}
@@ -375,7 +375,7 @@ PHP_FUNCTION( transliterator_transliterate )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"transliterator_transliterate: \"start\" argument should be "
- "non-negative and not bigger than \"end\" (if defined)", 0 TSRMLS_CC );
+ "non-negative and not bigger than \"end\" (if defined)", 0 );
RETURN_FALSE;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION( transliterator_transliterate )
if(msg != NULL )
{
intl_errors_set( TRANSLITERATOR_ERROR_P( to ), U_ILLEGAL_ARGUMENT_ERROR,
- msg, 1 TSRMLS_CC );
+ msg, 1 );
efree( msg );
}
RETVAL_FALSE;
@@ -424,20 +424,20 @@ PHP_FUNCTION( transliterator_transliterate )
uresult = safe_emalloc( uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) );
capacity = uresult_len + 1;
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
}
else if(TRANSLITERATOR_ERROR_CODE( to ) == U_STRING_NOT_TERMINATED_WARNING )
{
uresult = safe_erealloc( uresult, uresult_len, sizeof( UChar ), 1 * sizeof( UChar ) );
- intl_error_reset( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ intl_error_reset( TRANSLITERATOR_ERROR_P( to ) );
break;
}
else if( U_FAILURE( TRANSLITERATOR_ERROR_CODE( to ) ) )
{
- intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) TSRMLS_CC );
+ intl_error_set_code( NULL, TRANSLITERATOR_ERROR_CODE( to ) );
intl_errors_set_custom_msg( TRANSLITERATOR_ERROR_P( to ),
- "transliterator_transliterate: transliteration failed", 0 TSRMLS_CC );
+ "transliterator_transliterate: transliteration failed", 0 );
goto cleanup;
}
else
@@ -472,7 +472,7 @@ PHP_METHOD( Transliterator, __construct )
/* this constructor shouldn't be called as it's private */
zend_throw_exception( NULL,
"An object of this type cannot be created with the new operator.",
- 0 TSRMLS_CC );
+ 0 );
}
/* {{{ proto int transliterator_get_error_code( Transliterator trans )
@@ -483,11 +483,11 @@ PHP_FUNCTION( transliterator_get_error_code )
{
TRANSLITERATOR_METHOD_INIT_VARS
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_get_error_code: unable to parse input params", 0 TSRMLS_CC );
+ "transliterator_get_error_code: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -511,11 +511,11 @@ PHP_FUNCTION( transliterator_get_error_message )
zend_string* message = NULL;
TRANSLITERATOR_METHOD_INIT_VARS
- if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "O",
&object, Transliterator_ce_ptr ) == FAILURE )
{
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "transliterator_get_error_message: unable to parse input params", 0 TSRMLS_CC );
+ "transliterator_get_error_message: unable to parse input params", 0 );
RETURN_FALSE;
}
@@ -527,7 +527,7 @@ PHP_FUNCTION( transliterator_get_error_message )
RETURN_FALSE;
/* Return last error message. */
- message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) TSRMLS_CC );
+ message = intl_error_get_message( TRANSLITERATOR_ERROR_P( to ) );
RETURN_STR( message );
}
/* }}} */
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index d78ec35a2e..2e4f258b1e 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -291,7 +291,7 @@ static int dehexchar(char c)
}
-static void json_create_zval(zval *z, smart_str *buf, int type, int options TSRMLS_DC)
+static void json_create_zval(zval *z, smart_str *buf, int type, int options)
{
if (type == IS_LONG)
{
@@ -393,11 +393,11 @@ static void utf16_to_utf8(smart_str *buf, unsigned short utf16)
}
}
-static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key, zval *zv TSRMLS_DC)
+static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key, zval *zv)
{
zend_bool empty_key = !key->s || key->s->len == 0;
if (!assoc) {
- add_property_zval_ex(target, empty_key ? "_empty_" : key->s->val, empty_key ? sizeof("_empty_")-1 : key->s->len, zv TSRMLS_CC);
+ add_property_zval_ex(target, empty_key ? "_empty_" : key->s->val, empty_key ? sizeof("_empty_")-1 : key->s->len, zv);
if (Z_REFCOUNTED_P(zv)) Z_DELREF_P(zv);
} else {
add_assoc_zval_ex(target, empty_key ? "" : key->s->val, empty_key ? 0 : key->s->len, zv);
@@ -407,7 +407,7 @@ static inline void add_assoc_or_property(int assoc, zval *target, smart_str *key
}
}
-static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int assoc TSRMLS_DC)
+static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int assoc)
{
zval *root = &jp->the_zstack[up];
zval *child = &jp->the_zstack[cur];
@@ -419,7 +419,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
}
else if (up_mode == MODE_OBJECT)
{
- add_assoc_or_property(assoc, root, key, child TSRMLS_CC);
+ add_assoc_or_property(assoc, root, key, child);
}
}
@@ -444,7 +444,7 @@ static void attach_zval(JSON_parser jp, int up, int cur, smart_str *key, int ass
machine with a stack.
*/
int
-parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC)
+parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options)
{
int next_char; /* the next character */
int next_class; /* the next character class */
@@ -557,9 +557,9 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
zval mval;
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
- add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval TSRMLS_CC);
+ add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval);
if (buf.s) { buf.s->len = 0; }
JSON_RESET_TYPE();
@@ -580,7 +580,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
zval mval;
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
add_next_index_zval(&jp->the_zstack[jp->top], &mval);
buf.s->len = 0;
JSON_RESET_TYPE();
@@ -615,7 +615,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
}
if (jp->top > 1) {
- attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC);
+ attach_zval(jp, jp->top - 1, jp->top, &key, assoc);
}
JSON_RESET_TYPE();
@@ -640,7 +640,7 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
}
if (jp->top > 1) {
- attach_zval(jp, jp->top - 1, jp->top, &key, assoc TSRMLS_CC);
+ attach_zval(jp, jp->top - 1, jp->top, &key, assoc);
}
JSON_RESET_TYPE();
@@ -689,14 +689,14 @@ parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length,
jp->stack[jp->top] == MODE_ARRAY))
{
smart_str_0(&buf);
- json_create_zval(&mval, &buf, type, options TSRMLS_CC);
+ json_create_zval(&mval, &buf, type, options);
}
switch (jp->stack[jp->top]) {
case MODE_OBJECT:
if (pop(jp, MODE_OBJECT) && push(jp, MODE_KEY)) {
if (type != -1) {
- add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval TSRMLS_CC);
+ add_assoc_or_property(assoc, &jp->the_zstack[jp->top], &key, &mval);
}
jp->state = KE;
}
diff --git a/ext/json/JSON_parser.h b/ext/json/JSON_parser.h
index da47f4078f..91081e8bf6 100644
--- a/ext/json/JSON_parser.h
+++ b/ext/json/JSON_parser.h
@@ -32,12 +32,12 @@ enum error_codes {
};
extern JSON_parser new_JSON_parser(int depth);
-extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC);
+extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options);
extern int free_JSON_parser(JSON_parser jp);
-static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC)
+static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc)
{
- return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC);
+ return parse_JSON_ex(jp, z, utf16_json, length, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0);
}
#endif
diff --git a/ext/json/json.c b/ext/json/json.c
index 91bedcace9..481ab756ed 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -91,7 +91,7 @@ static PHP_MINIT_FUNCTION(json)
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "JsonSerializable", json_serializable_interface);
- php_json_serializable_ce = zend_register_internal_interface(&ce TSRMLS_CC);
+ php_json_serializable_ce = zend_register_internal_interface(&ce);
REGISTER_LONG_CONSTANT("JSON_HEX_TAG", PHP_JSON_HEX_TAG, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("JSON_HEX_AMP", PHP_JSON_HEX_AMP, CONST_CS | CONST_PERSISTENT);
@@ -173,9 +173,9 @@ static PHP_MINFO_FUNCTION(json)
}
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, size_t len, int options TSRMLS_DC);
+static void json_escape_string(smart_str *buf, char *s, size_t len, int options);
-static int json_determine_array_type(zval *val TSRMLS_DC) /* {{{ */
+static int json_determine_array_type(zval *val) /* {{{ */
{
int i;
HashTable *myht = HASH_OF(val);
@@ -204,7 +204,7 @@ static int json_determine_array_type(zval *val TSRMLS_DC) /* {{{ */
/* {{{ Pretty printing support functions */
-static inline void json_pretty_print_char(smart_str *buf, int options, char c TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_char(smart_str *buf, int options, char c) /* {{{ */
{
if (options & PHP_JSON_PRETTY_PRINT) {
smart_str_appendc(buf, c);
@@ -212,7 +212,7 @@ static inline void json_pretty_print_char(smart_str *buf, int options, char c TS
}
/* }}} */
-static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_DC) /* {{{ */
+static inline void json_pretty_print_indent(smart_str *buf, int options) /* {{{ */
{
int i;
@@ -226,14 +226,14 @@ static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_D
/* }}} */
-static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+static void json_encode_array(smart_str *buf, zval *val, int options) /* {{{ */
{
int i, r, need_comma = 0;
HashTable *myht;
if (Z_TYPE_P(val) == IS_ARRAY) {
myht = HASH_OF(val);
- r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val TSRMLS_CC);
+ r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val);
} else {
myht = Z_OBJPROP_P(val);
r = PHP_JSON_OUTPUT_OBJECT;
@@ -275,9 +275,9 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
- php_json_encode(buf, data, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
+ php_json_encode(buf, data, options);
} else if (r == PHP_JSON_OUTPUT_OBJECT) {
if (key) {
if (key->val[0] == '\0' && Z_TYPE_P(val) == IS_OBJECT) {
@@ -294,15 +294,15 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
- json_escape_string(buf, key->val, key->len, options & ~PHP_JSON_NUMERIC_CHECK TSRMLS_CC);
+ json_escape_string(buf, key->val, key->len, options & ~PHP_JSON_NUMERIC_CHECK);
smart_str_appendc(buf, ':');
- json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
+ json_pretty_print_char(buf, options, ' ');
- php_json_encode(buf, data, options TSRMLS_CC);
+ php_json_encode(buf, data, options);
} else {
if (need_comma) {
smart_str_appendc(buf, ',');
@@ -310,17 +310,17 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
need_comma = 1;
}
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
smart_str_appendc(buf, '"');
smart_str_append_long(buf, (zend_long) index);
smart_str_appendc(buf, '"');
smart_str_appendc(buf, ':');
- json_pretty_print_char(buf, options, ' ' TSRMLS_CC);
+ json_pretty_print_char(buf, options, ' ');
- php_json_encode(buf, data, options TSRMLS_CC);
+ php_json_encode(buf, data, options);
}
}
@@ -337,8 +337,8 @@ static void json_encode_array(smart_str *buf, zval *val, int options TSRMLS_DC)
/* Only keep closing bracket on same line for empty arrays/objects */
if (need_comma) {
- json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
- json_pretty_print_indent(buf, options TSRMLS_CC);
+ json_pretty_print_char(buf, options, '\n');
+ json_pretty_print_indent(buf, options);
}
if (r == PHP_JSON_OUTPUT_ARRAY) {
@@ -386,7 +386,7 @@ static int json_utf8_to_utf16(unsigned short *utf16, char utf8[], int len) /* {{
}
/* }}} */
-static void json_escape_string(smart_str *buf, char *s, size_t len, int options TSRMLS_DC) /* {{{ */
+static void json_escape_string(smart_str *buf, char *s, size_t len, int options) /* {{{ */
{
int status;
unsigned int us, next_us = 0;
@@ -556,7 +556,7 @@ static void json_escape_string(smart_str *buf, char *s, size_t len, int options
}
/* }}} */
-static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+static void json_encode_serializable_object(smart_str *buf, zval *val, int options) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(val);
zval retval, fname;
@@ -576,8 +576,8 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
ZVAL_STRING(&fname, "jsonSerialize");
- if (FAILURE == call_user_function_ex(EG(function_table), val, &fname, &retval, 0, NULL, 1, NULL TSRMLS_CC) || Z_TYPE(retval) == IS_UNDEF) {
- zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name->val);
+ if (FAILURE == call_user_function_ex(EG(function_table), val, &fname, &retval, 0, NULL, 1, NULL) || Z_TYPE(retval) == IS_UNDEF) {
+ zend_throw_exception_ex(NULL, 0, "Failed calling %s::jsonSerialize()", ce->name->val);
smart_str_appendl(buf, "null", sizeof("null") - 1);
zval_ptr_dtor(&fname);
return;
@@ -594,10 +594,10 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
if ((Z_TYPE(retval) == IS_OBJECT) &&
(Z_OBJ_HANDLE(retval) == Z_OBJ_HANDLE_P(val))) {
/* Handle the case where jsonSerialize does: return $this; by going straight to encode array */
- json_encode_array(buf, &retval, options TSRMLS_CC);
+ json_encode_array(buf, &retval, options);
} else {
/* All other types, encode as normal */
- php_json_encode(buf, &retval, options TSRMLS_CC);
+ php_json_encode(buf, &retval, options);
}
zval_ptr_dtor(&retval);
@@ -605,7 +605,7 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
}
/* }}} */
-PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options) /* {{{ */
{
again:
switch (Z_TYPE_P(val))
@@ -643,17 +643,17 @@ again:
break;
case IS_STRING:
- json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options TSRMLS_CC);
+ json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options);
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce TSRMLS_CC)) {
- json_encode_serializable_object(buf, val, options TSRMLS_CC);
+ if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce)) {
+ json_encode_serializable_object(buf, val, options);
break;
}
/* fallthrough -- Non-serializable object */
case IS_ARRAY:
- json_encode_array(buf, val, options TSRMLS_CC);
+ json_encode_array(buf, val, options);
break;
case IS_REFERENCE:
@@ -670,7 +670,7 @@ again:
}
/* }}} */
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth) /* {{{ */
{
size_t utf16_len;
unsigned short *utf16;
@@ -688,13 +688,13 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_l
}
if (depth <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Depth must be greater than zero");
efree(utf16);
RETURN_NULL();
}
jp = new_JSON_parser(depth);
- if (!parse_JSON_ex(jp, return_value, utf16, utf16_len, options TSRMLS_CC)) {
+ if (!parse_JSON_ex(jp, return_value, utf16, utf16_len, options)) {
double d;
int type, overflow_info;
zend_long p;
@@ -780,7 +780,7 @@ static PHP_FUNCTION(json_encode)
zend_long options = 0;
zend_long depth = JSON_PARSER_DEFAULT_DEPTH;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &parameter, &options, &depth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &parameter, &options, &depth) == FAILURE) {
return;
}
@@ -788,7 +788,7 @@ static PHP_FUNCTION(json_encode)
JSON_G(encode_max_depth) = depth;
- php_json_encode(&buf, parameter, options TSRMLS_CC);
+ php_json_encode(&buf, parameter, options);
if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && !(options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) {
smart_str_free(&buf);
@@ -810,7 +810,7 @@ static PHP_FUNCTION(json_decode)
zend_long depth = JSON_PARSER_DEFAULT_DEPTH;
zend_long options = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
return;
}
@@ -827,7 +827,7 @@ static PHP_FUNCTION(json_decode)
options &= ~PHP_JSON_OBJECT_AS_ARRAY;
}
- php_json_decode_ex(return_value, str, str_len, options, depth TSRMLS_CC);
+ php_json_decode_ex(return_value, str, str_len, options, depth);
}
/* }}} */
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 64ad811bc7..62eca734a2 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -52,8 +52,8 @@ ZEND_TSRMLS_CACHE_EXTERN;
# define JSON_G(v) (json_globals.v)
#endif
-PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth TSRMLS_DC);
+PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options);
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth);
extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
@@ -77,9 +77,9 @@ extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
#define PHP_JSON_OBJECT_AS_ARRAY (1<<0)
#define PHP_JSON_BIGINT_AS_STRING (1<<1)
-static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth TSRMLS_DC)
+static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth)
{
- php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth TSRMLS_CC);
+ php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth);
}
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index f74de699ee..5fea1ce26e 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -92,7 +92,7 @@ static int le_link, le_result, le_result_entry;
ZEND_GET_MODULE(ldap)
#endif
-static void _close_ldap_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _close_ldap_link(zend_resource *rsrc) /* {{{ */
{
ldap_linkdata *ld = (ldap_linkdata *)rsrc->ptr;
@@ -105,14 +105,14 @@ static void _close_ldap_link(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _free_ldap_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _free_ldap_result(zend_resource *rsrc) /* {{{ */
{
LDAPMessage *result = (LDAPMessage *)rsrc->ptr;
ldap_msgfree(result);
}
/* }}} */
-static void _free_ldap_result_entry(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void _free_ldap_result_entry(zend_resource *rsrc) /* {{{ */
{
ldap_resultentry *entry = (ldap_resultentry *)rsrc->ptr;
@@ -310,7 +310,7 @@ PHP_FUNCTION(ldap_connect)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) {
RETURN_FALSE;
}
@@ -318,13 +318,13 @@ PHP_FUNCTION(ldap_connect)
ssl = 1;
}
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &host, &hostlen, &port) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sl", &host, &hostlen, &port) != SUCCESS) {
RETURN_FALSE;
}
#endif
if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
RETURN_FALSE;
}
@@ -337,7 +337,7 @@ PHP_FUNCTION(ldap_connect)
rc = ldap_initialize(&ldap, host);
if (rc != LDAP_SUCCESS) {
efree(ld);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create session handle: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Could not create session handle: %s", ldap_err2string(rc));
RETURN_FALSE;
}
} else {
@@ -355,7 +355,7 @@ PHP_FUNCTION(ldap_connect)
if (ssl) {
if (ldap_init_SSL(&ldap->ld_sb, wallet, walletpasswd, authmode)) {
efree(ld);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL init failed");
+ php_error_docref(NULL, E_WARNING, "SSL init failed");
RETURN_FALSE;
}
}
@@ -415,7 +415,7 @@ PHP_FUNCTION(ldap_bind)
ldap_linkdata *ld;
int rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
RETURN_FALSE;
}
@@ -423,18 +423,18 @@ PHP_FUNCTION(ldap_bind)
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
+ php_error_docref(NULL, E_WARNING, "DN contains a null byte");
RETURN_FALSE;
}
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
_set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
+ php_error_docref(NULL, E_WARNING, "Password contains a null byte");
RETURN_FALSE;
}
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -543,7 +543,7 @@ PHP_FUNCTION(ldap_sasl_bind)
size_t rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, authz_id_len, props_len;
php_ldap_bictx *ctx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|sssssss", &link, &binddn, &dn_len, &passwd, &passwd_len, &sasl_mech, &mech_len, &sasl_realm, &realm_len, &sasl_authc_id, &authc_id_len, &sasl_authz_id, &authz_id_len, &props, &props_len) != SUCCESS) {
RETURN_FALSE;
}
@@ -557,7 +557,7 @@ PHP_FUNCTION(ldap_sasl_bind)
rc = ldap_sasl_interactive_bind_s(ld->link, binddn, ctx->mech, NULL, NULL, LDAP_SASL_QUIET, _php_sasl_interact, ctx);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -574,7 +574,7 @@ PHP_FUNCTION(ldap_unbind)
zval *link;
ldap_linkdata *ld;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
RETURN_FALSE;
}
@@ -637,7 +637,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
int old_ldap_sizelimit = -1, old_ldap_timelimit = -1, old_ldap_deref = -1;
int num_attribs = 0, ret = 1, i, errno, argcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argcount TSRMLS_CC, "zzz|allll", &link, &base_dn, &filter, &attrs, &attrsonly,
+ if (zend_parse_parameters(argcount, "zzz|allll", &link, &base_dn, &filter, &attrs, &attrsonly,
&sizelimit, &timelimit, &deref) == FAILURE) {
return;
}
@@ -658,7 +658,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
for (i = 0; i<num_attribs; i++) {
if ((attr = zend_hash_index_find(Z_ARRVAL_P(attrs), i)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array initialization wrong");
+ php_error_docref(NULL, E_WARNING, "Array initialization wrong");
ret = 0;
goto cleanup;
}
@@ -680,7 +680,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
nlinks = zend_hash_num_elements(Z_ARRVAL_P(link));
if (nlinks == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No links in link array");
+ php_error_docref(NULL, E_WARNING, "No links in link array");
ret = 0;
goto cleanup;
}
@@ -688,7 +688,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
if (Z_TYPE_P(base_dn) == IS_ARRAY) {
nbases = zend_hash_num_elements(Z_ARRVAL_P(base_dn));
if (nbases != nlinks) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Base must either be a string, or an array with the same number of elements as the links array");
+ php_error_docref(NULL, E_WARNING, "Base must either be a string, or an array with the same number of elements as the links array");
ret = 0;
goto cleanup;
}
@@ -706,7 +706,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
if (Z_TYPE_P(filter) == IS_ARRAY) {
nfilters = zend_hash_num_elements(Z_ARRVAL_P(filter));
if (nfilters != nlinks) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter must either be a string, or an array with the same number of elements as the links array");
+ php_error_docref(NULL, E_WARNING, "Filter must either be a string, or an array with the same number of elements as the links array");
ret = 0;
goto cleanup;
}
@@ -724,7 +724,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
for (i=0; i<nlinks; i++) {
entry = zend_hash_get_current_data(Z_ARRVAL_P(link));
- ld = (ldap_linkdata *) zend_fetch_resource(entry TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(entry, -1, "ldap link", NULL, 1, le_link);
if (ld == NULL) {
ret = 0;
goto cleanup_parallel;
@@ -782,7 +782,7 @@ cleanup_parallel:
ldap_base_dn = Z_STRVAL_P(base_dn);
}
- ld = (ldap_linkdata *) zend_fetch_resource(link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(link, -1, "ldap link", NULL, 1, le_link);
if (ld == NULL) {
ret = 0;
goto cleanup;
@@ -802,15 +802,15 @@ cleanup_parallel:
&& errno != LDAP_REFERRAL
#endif
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Search: %s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "Search: %s", ldap_err2string(errno));
ret = 0;
} else {
if (errno == LDAP_SIZELIMIT_EXCEEDED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Sizelimit exceeded");
+ php_error_docref(NULL, E_WARNING, "Partial search results returned: Sizelimit exceeded");
}
#ifdef LDAP_ADMINLIMIT_EXCEEDED
else if (errno == LDAP_ADMINLIMIT_EXCEEDED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Partial search results returned: Adminlimit exceeded");
+ php_error_docref(NULL, E_WARNING, "Partial search results returned: Adminlimit exceeded");
}
#endif
@@ -863,7 +863,7 @@ PHP_FUNCTION(ldap_free_result)
zval *result;
LDAPMessage *ldap_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) != SUCCESS) {
return;
}
@@ -882,7 +882,7 @@ PHP_FUNCTION(ldap_count_entries)
ldap_linkdata *ld;
LDAPMessage *ldap_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -902,7 +902,7 @@ PHP_FUNCTION(ldap_first_entry)
ldap_resultentry *resultentry;
LDAPMessage *ldap_result, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -930,7 +930,7 @@ PHP_FUNCTION(ldap_next_entry)
ldap_resultentry *resultentry, *resultentry_next;
LDAPMessage *entry_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -965,7 +965,7 @@ PHP_FUNCTION(ldap_get_entries)
struct berval **ldap_value;
char *dn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -1052,7 +1052,7 @@ PHP_FUNCTION(ldap_first_attribute)
char *attribute;
zend_long dummy_ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
return;
}
@@ -1080,7 +1080,7 @@ PHP_FUNCTION(ldap_next_attribute)
char *attribute;
zend_long dummy_ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|l", &link, &result_entry, &dummy_ber) != SUCCESS) {
return;
}
@@ -1088,7 +1088,7 @@ PHP_FUNCTION(ldap_next_attribute)
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry);
if (resultentry->ber == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "called before calling ldap_first_attribute() or no attributes found in result entry");
+ php_error_docref(NULL, E_WARNING, "called before calling ldap_first_attribute() or no attributes found in result entry");
RETURN_FALSE;
}
@@ -1122,7 +1122,7 @@ PHP_FUNCTION(ldap_get_attributes)
int i, num_values, num_attrib;
BerElement *ber;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -1175,7 +1175,7 @@ PHP_FUNCTION(ldap_get_values_len)
int i, num_values;
size_t attr_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result_entry, &attr, &attr_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result_entry, &attr, &attr_len) != SUCCESS) {
return;
}
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(ldap_get_values_len)
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, "ldap result entry", le_result_entry);
if ((ldap_value_len = ldap_get_values_len(ld->link, resultentry->data, attr)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link)));
+ php_error_docref(NULL, E_WARNING, "Cannot get the value(s) of attribute %s", ldap_err2string(_get_lderrno(ld->link)));
RETURN_FALSE;
}
@@ -1209,7 +1209,7 @@ PHP_FUNCTION(ldap_get_dn)
ldap_resultentry *resultentry;
char *text;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -1239,7 +1239,7 @@ PHP_FUNCTION(ldap_explode_dn)
int i, count;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &dn, &dn_len, &with_attrib) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &dn, &dn_len, &with_attrib) != SUCCESS) {
return;
}
@@ -1270,7 +1270,7 @@ PHP_FUNCTION(ldap_dn2ufn)
char *dn, *ufn;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dn, &dn_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &dn, &dn_len) != SUCCESS) {
return;
}
@@ -1305,7 +1305,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
zend_ulong index;
int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
return;
}
@@ -1331,7 +1331,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
if (zend_hash_get_current_key(Z_ARRVAL_P(entry), &attribute, &index, 0) == HASH_KEY_IS_STRING) {
ldap_mods[i]->mod_type = estrndup(attribute->val, attribute->len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown attribute in the data");
+ php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
/* Free allocated memory */
while (i >= 0) {
if (ldap_mods[i]->mod_type) {
@@ -1365,7 +1365,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
} else {
for (j = 0; j < num_values; j++) {
if ((ivalue = zend_hash_index_find(Z_ARRVAL_P(value), j)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Value array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "Value array must have consecutive indices 0, 1, ...");
num_berval[i] = j;
num_attribs = i + 1;
RETVAL_FALSE;
@@ -1385,12 +1385,12 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
/* check flag to see if do_mod was called to perform full add , gerrit thomson */
if (is_full_add == 1) {
if ((i = ldap_add_s(ld->link, dn, ldap_mods)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Add: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Add: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
} else {
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modify: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
}
@@ -1456,14 +1456,14 @@ PHP_FUNCTION(ldap_delete)
int rc;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &link, &dn, &dn_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link, &dn, &dn_len) != SUCCESS) {
return;
}
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
if ((rc = ldap_delete_s(ld->link, dn)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delete: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Delete: %s", ldap_err2string(rc));
RETURN_FALSE;
}
@@ -1553,7 +1553,7 @@ PHP_FUNCTION(ldap_modify_batch)
);
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) {
return;
}
@@ -1569,14 +1569,14 @@ PHP_FUNCTION(ldap_modify_batch)
/* make sure the DN contains no NUL bytes */
if (_ldap_strlen_max(dn, dn_len) != dn_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN must not contain NUL bytes");
+ php_error_docref(NULL, E_WARNING, "DN must not contain NUL bytes");
RETURN_FALSE;
}
/* make sure the top level is a normal array */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(mods));
if (zend_hash_get_current_key_type(Z_ARRVAL_P(mods)) != HASH_KEY_IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must not be string-indexed");
+ php_error_docref(NULL, E_WARNING, "Modifications array must not be string-indexed");
RETURN_FALSE;
}
@@ -1585,14 +1585,14 @@ PHP_FUNCTION(ldap_modify_batch)
for (i = 0; i < num_mods; i++) {
/* is the numbering consecutive? */
if ((fetched = zend_hash_index_find(Z_ARRVAL_P(mods), i)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "Modifications array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
mod = fetched;
/* is it an array? */
if (Z_TYPE_P(mod) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be an array itself");
+ php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be an array itself");
RETURN_FALSE;
}
@@ -1603,7 +1603,7 @@ PHP_FUNCTION(ldap_modify_batch)
for (j = 0; j < num_modprops; j++) {
/* are the keys strings? */
if (zend_hash_get_current_key(Z_ARRVAL_P(mod), &modkey, &tmpUlong, 0) != HASH_KEY_IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be string-indexed");
+ php_error_docref(NULL, E_WARNING, "Each entry of modifications array must be string-indexed");
RETURN_FALSE;
}
@@ -1613,7 +1613,7 @@ PHP_FUNCTION(ldap_modify_batch)
!_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE) &&
!_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
+ php_error_docref(NULL, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'");
RETURN_FALSE;
}
@@ -1623,18 +1623,18 @@ PHP_FUNCTION(ldap_modify_batch)
/* does the value type match the key? */
if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_ATTRIB)) {
if (Z_TYPE_P(modinfo) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string");
RETURN_FALSE;
}
if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
RETURN_FALSE;
}
}
else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_MODTYPE)) {
if (Z_TYPE_P(modinfo) != IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long");
RETURN_FALSE;
}
@@ -1646,27 +1646,27 @@ PHP_FUNCTION(ldap_modify_batch)
modtype != LDAP_MODIFY_BATCH_REPLACE &&
modtype != LDAP_MODIFY_BATCH_REMOVE_ALL
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants");
+ php_error_docref(NULL, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants");
RETURN_FALSE;
}
/* if it's REMOVE_ALL, there must not be a values array; otherwise, there must */
if (modtype == LDAP_MODIFY_BATCH_REMOVE_ALL) {
if (zend_hash_str_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided");
+ php_error_docref(NULL, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided");
RETURN_FALSE;
}
}
else {
if (!zend_hash_str_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided");
+ php_error_docref(NULL, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided");
RETURN_FALSE;
}
}
}
else if (_ldap_str_equal_to_const(modkey->val, modkey->len, LDAP_MODIFY_BATCH_VALUES)) {
if (Z_TYPE_P(modinfo) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array");
RETURN_FALSE;
}
@@ -1674,27 +1674,27 @@ PHP_FUNCTION(ldap_modify_batch)
zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo));
num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo));
if (num_modvals == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element");
RETURN_FALSE;
}
/* are its keys integers? */
if (zend_hash_get_current_key_type(Z_ARRVAL_P(modinfo)) != HASH_KEY_IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed");
RETURN_FALSE;
}
/* are the keys consecutive? */
for (k = 0; k < num_modvals; k++) {
if ((fetched = zend_hash_index_find(Z_ARRVAL_P(modinfo), k)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ...");
+ php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ...");
RETURN_FALSE;
}
modval = fetched;
/* is the data element a string? */
if (Z_TYPE_P(modval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string");
+ php_error_docref(NULL, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string");
RETURN_FALSE;
}
}
@@ -1735,7 +1735,7 @@ PHP_FUNCTION(ldap_modify_batch)
oper = LDAP_MOD_REPLACE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown and uncaught modification type.");
+ php_error_docref(NULL, E_ERROR, "Unknown and uncaught modification type.");
RETURN_FALSE;
}
@@ -1776,7 +1776,7 @@ PHP_FUNCTION(ldap_modify_batch)
/* perform (finally) */
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
+ php_error_docref(NULL, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
@@ -1817,7 +1817,7 @@ PHP_FUNCTION(ldap_errno)
zval *link;
ldap_linkdata *ld;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -1833,7 +1833,7 @@ PHP_FUNCTION(ldap_err2str)
{
zend_long perrno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &perrno) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &perrno) != SUCCESS) {
return;
}
@@ -1849,7 +1849,7 @@ PHP_FUNCTION(ldap_error)
ldap_linkdata *ld;
int ld_errno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -1871,7 +1871,7 @@ PHP_FUNCTION(ldap_compare)
ldap_linkdata *ld;
int errno;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len) != SUCCESS) {
return;
}
@@ -1889,7 +1889,7 @@ PHP_FUNCTION(ldap_compare)
break;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Compare: %s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "Compare: %s", ldap_err2string(errno));
RETURN_LONG(-1);
}
/* }}} */
@@ -1904,19 +1904,19 @@ PHP_FUNCTION(ldap_sort)
size_t sflen;
zend_resource *le;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link);
if ((le = zend_hash_index_find_ptr(&EG(regular_list), Z_RES_HANDLE_P(result))) == NULL || le->type != le_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied resource is not a valid ldap result resource");
+ php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource");
RETURN_FALSE;
}
if (ldap_sort_entries(ld->link, (LDAPMessage **) &le->ptr, sflen ? sortfilter : NULL, strcmp) != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ldap_err2string(errno));
+ php_error_docref(NULL, E_WARNING, "%s", ldap_err2string(errno));
RETURN_FALSE;
}
@@ -1933,7 +1933,7 @@ PHP_FUNCTION(ldap_get_option)
ldap_linkdata *ld;
zend_long option;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz/", &link, &option, &retval) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz/", &link, &option, &retval) != SUCCESS) {
return;
}
@@ -2038,7 +2038,7 @@ PHP_FUNCTION(ldap_set_option)
LDAP *ldap;
zend_long option;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlz", &link, &option, &newval) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zlz", &link, &option, &newval) != SUCCESS) {
return;
}
@@ -2138,7 +2138,7 @@ PHP_FUNCTION(ldap_set_option)
char error=0;
if ((Z_TYPE_P(newval) != IS_ARRAY) || !(ncontrols = zend_hash_num_elements(Z_ARRVAL_P(newval)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expected non-empty array value for this option");
+ php_error_docref(NULL, E_WARNING, "Expected non-empty array value for this option");
RETURN_FALSE;
}
ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
@@ -2146,12 +2146,12 @@ PHP_FUNCTION(ldap_set_option)
ctrlp = ctrls;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(newval), ctrlval) {
if (Z_TYPE_P(ctrlval) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array value must contain only arrays, where each array is a control");
+ php_error_docref(NULL, E_WARNING, "The array value must contain only arrays, where each array is a control");
error = 1;
break;
}
if ((val = zend_hash_str_find(Z_ARRVAL_P(ctrlval), "oid", sizeof("oid") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Control must have an oid key");
+ php_error_docref(NULL, E_WARNING, "Control must have an oid key");
error = 1;
break;
}
@@ -2208,7 +2208,7 @@ PHP_FUNCTION(ldap_parse_result)
char *lmatcheddn, *lerrmsg;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz/|z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/|z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals) != SUCCESS) {
return;
}
@@ -2222,7 +2222,7 @@ PHP_FUNCTION(ldap_parse_result)
NULL /* &serverctrls */,
0);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc));
RETURN_FALSE;
}
@@ -2273,7 +2273,7 @@ PHP_FUNCTION(ldap_first_reference)
ldap_resultentry *resultentry;
LDAPMessage *ldap_result, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result) != SUCCESS) {
return;
}
@@ -2301,7 +2301,7 @@ PHP_FUNCTION(ldap_next_reference)
ldap_resultentry *resultentry, *resultentry_next;
LDAPMessage *entry_next;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, &result_entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &link, &result_entry) != SUCCESS) {
return;
}
@@ -2330,7 +2330,7 @@ PHP_FUNCTION(ldap_parse_reference)
ldap_resultentry *resultentry;
char **lreferrals, **refp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz/", &link, &result_entry, &referrals) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/", &link, &result_entry, &referrals) != SUCCESS) {
return;
}
@@ -2367,7 +2367,7 @@ PHP_FUNCTION(ldap_rename)
size_t dn_len, newrdn_len, newparent_len;
zend_bool deleteoldrdn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsssb", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsssb", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn) != SUCCESS) {
return;
}
@@ -2381,7 +2381,7 @@ PHP_FUNCTION(ldap_rename)
rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, NULL, NULL);
#else
if (newparent_len != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN");
+ php_error_docref(NULL, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN");
RETURN_FALSE;
}
/* could support old APIs but need check for ldap_modrdn2()/ldap_modrdn() */
@@ -2404,7 +2404,7 @@ PHP_FUNCTION(ldap_start_tls)
ldap_linkdata *ld;
int rc, protocol = LDAP_VERSION3;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &link) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &link) != SUCCESS) {
return;
}
@@ -2413,7 +2413,7 @@ PHP_FUNCTION(ldap_start_tls)
if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) != LDAP_SUCCESS) ||
((rc = ldap_start_tls_s(ld->link, NULL, NULL)) != LDAP_SUCCESS)
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to start TLS: %s", ldap_err2string(rc));
+ php_error_docref(NULL, E_WARNING,"Unable to start TLS: %s", ldap_err2string(rc));
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -2433,25 +2433,24 @@ int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req, ber_int_t msgi
zval cb_args[2];
zval cb_retval;
zval *cb_link = (zval *) params;
- TSRMLS_FETCH();
- ld = (ldap_linkdata *) zend_fetch_resource(cb_link TSRMLS_CC, -1, "ldap link", NULL, 1, le_link);
+ ld = (ldap_linkdata *) zend_fetch_resource(cb_link, -1, "ldap link", NULL, 1, le_link);
/* link exists and callback set? */
if (ld == NULL || Z_ISUNDEF(ld->rebindproc)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link not found or no callback set");
+ php_error_docref(NULL, E_WARNING, "Link not found or no callback set");
return LDAP_OTHER;
}
/* callback */
ZVAL_COPY_VALUE(&cb_args[0], cb_link);
ZVAL_STRING(&cb_args[1], url);
- if (call_user_function_ex(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL TSRMLS_CC) == SUCCESS && !Z_ISUNDEF(cb_retval)) {
+ if (call_user_function_ex(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL) == SUCCESS && !Z_ISUNDEF(cb_retval)) {
convert_to_long_ex(&cb_retval);
retval = Z_LVAL(cb_retval);
zval_ptr_dtor(&cb_retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "rebind_proc PHP callback failed");
+ php_error_docref(NULL, E_WARNING, "rebind_proc PHP callback failed");
retval = LDAP_OTHER;
}
zval_ptr_dtor(&cb_args[1]);
@@ -2467,7 +2466,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
ldap_linkdata *ld;
zend_string *callback_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &link, &callback) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &link, &callback) != SUCCESS) {
RETURN_FALSE;
}
@@ -2484,8 +2483,8 @@ PHP_FUNCTION(ldap_set_rebind_proc)
}
/* callable? */
- if (!zend_is_callable(callback, 0, &callback_name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Two arguments expected for '%s' to be a valid callback", callback_name->val);
+ if (!zend_is_callable(callback, 0, &callback_name)) {
+ php_error_docref(NULL, E_WARNING, "Two arguments expected for '%s' to be a valid callback", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
}
@@ -2549,7 +2548,7 @@ PHP_FUNCTION(ldap_escape)
zend_long flags = 0;
zend_bool map[256] = {0}, havecharlist = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sl", &value, &valuelen, &ignores, &ignoreslen, &flags) != SUCCESS) {
return;
}
@@ -2591,7 +2590,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
char *value;
int result, ldap_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) != SUCCESS) {
return;
}
@@ -2609,7 +2608,7 @@ static void php_ldap_do_translate(INTERNAL_FUNCTION_PARAMETERS, int way)
RETVAL_STRINGL(value, value_len);
free(value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Conversion from iso-8859-1 to t61 failed: %s", ldap_err2string(result));
+ php_error_docref(NULL, E_WARNING, "Conversion from iso-8859-1 to t61 failed: %s", ldap_err2string(result));
RETVAL_FALSE;
}
}
@@ -2649,7 +2648,7 @@ PHP_FUNCTION(ldap_control_paged_result)
LDAPControl ctrl, *ctrlsp[2];
int rc, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|bs", &link, &pagesize, &iscritical, &cookie, &cookie_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|bs", &link, &pagesize, &iscritical, &cookie, &cookie_len) != SUCCESS) {
return;
}
@@ -2662,7 +2661,7 @@ PHP_FUNCTION(ldap_control_paged_result)
ber = ber_alloc_t(LBER_USE_DER);
if (ber == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to alloc BER encoding resources for paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to alloc BER encoding resources for paged results control");
RETURN_FALSE;
}
@@ -2679,13 +2678,13 @@ PHP_FUNCTION(ldap_control_paged_result)
}
if (ber_printf(ber, "{iO}", (int)pagesize, &lcookie) == LBER_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to BER printf paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to BER printf paged results control");
RETVAL_FALSE;
goto lcpr_error_out;
}
rc = ber_flatten2(ber, &ctrl.ldctl_value, 0);
if (rc == LBER_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to BER encode paged results control");
+ php_error_docref(NULL, E_WARNING, "Unable to BER encode paged results control");
RETVAL_FALSE;
goto lcpr_error_out;
}
@@ -2699,7 +2698,7 @@ PHP_FUNCTION(ldap_control_paged_result)
rc = ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, ctrlsp);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set paged results control: %s (%d)", ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Unable to set paged results control: %s (%d)", ldap_err2string(rc), rc);
RETVAL_FALSE;
goto lcpr_error_out;
}
@@ -2739,7 +2738,7 @@ PHP_FUNCTION(ldap_control_paged_result_response)
ber_tag_t tag;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|z/z/", &link, &result, &cookie, &estimated) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|z/z/", &link, &result, &cookie, &estimated) != SUCCESS) {
return;
}
@@ -2756,31 +2755,31 @@ PHP_FUNCTION(ldap_control_paged_result_response)
0);
if (rc != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse result: %s (%d)", ldap_err2string(rc), rc);
+ php_error_docref(NULL, E_WARNING, "Unable to parse result: %s (%d)", ldap_err2string(rc), rc);
RETURN_FALSE;
}
if (lerrcode != LDAP_SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result is: %s (%d)", ldap_err2string(lerrcode), lerrcode);
+ php_error_docref(NULL, E_WARNING, "Result is: %s (%d)", ldap_err2string(lerrcode), lerrcode);
RETURN_FALSE;
}
if (lserverctrls == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No server controls in result");
+ php_error_docref(NULL, E_WARNING, "No server controls in result");
RETURN_FALSE;
}
lctrl = ldap_find_control(LDAP_CONTROL_PAGEDRESULTS, lserverctrls);
if (lctrl == NULL) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No paged results control response in result");
+ php_error_docref(NULL, E_WARNING, "No paged results control response in result");
RETURN_FALSE;
}
ber = ber_init(&lctrl->ldctl_value);
if (ber == NULL) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to alloc BER decoding resources for paged results control response");
+ php_error_docref(NULL, E_WARNING, "Unable to alloc BER decoding resources for paged results control response");
RETURN_FALSE;
}
@@ -2789,13 +2788,13 @@ PHP_FUNCTION(ldap_control_paged_result_response)
if (tag == LBER_ERROR) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode paged results control response");
+ php_error_docref(NULL, E_WARNING, "Unable to decode paged results control response");
RETURN_FALSE;
}
if (lestimated < 0) {
ldap_controls_free(lserverctrls);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid paged results control response value");
+ php_error_docref(NULL, E_WARNING, "Invalid paged results control response value");
RETURN_FALSE;
}
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index ad12e3464d..07502433f8 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -155,16 +155,16 @@ zend_module_entry libxml_module_entry = {
/* }}} */
/* {{{ internal functions for interoperability */
-static int php_libxml_clear_object(php_libxml_node_object *object TSRMLS_DC)
+static int php_libxml_clear_object(php_libxml_node_object *object)
{
if (object->properties) {
object->properties = NULL;
}
- php_libxml_decrement_node_ptr(object TSRMLS_CC);
- return php_libxml_decrement_doc_ref(object TSRMLS_CC);
+ php_libxml_decrement_node_ptr(object);
+ return php_libxml_decrement_doc_ref(object);
}
-static int php_libxml_unregister_node(xmlNodePtr nodep TSRMLS_DC)
+static int php_libxml_unregister_node(xmlNodePtr nodep)
{
php_libxml_node_object *wrapper;
@@ -173,7 +173,7 @@ static int php_libxml_unregister_node(xmlNodePtr nodep TSRMLS_DC)
if (nodeptr != NULL) {
wrapper = nodeptr->_private;
if (wrapper) {
- php_libxml_clear_object(wrapper TSRMLS_CC);
+ php_libxml_clear_object(wrapper);
} else {
if (nodeptr->node != NULL && nodeptr->node->type != XML_DOCUMENT_NODE) {
nodeptr->node->_private = NULL;
@@ -224,7 +224,7 @@ static void php_libxml_node_free(xmlNodePtr node)
}
}
-static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
+static void php_libxml_node_free_list(xmlNodePtr node)
{
xmlNodePtr curnode;
@@ -238,7 +238,7 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
case XML_ENTITY_DECL:
break;
case XML_ENTITY_REF_NODE:
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
break;
case XML_ATTRIBUTE_NODE:
if ((node->doc != NULL) && (((xmlAttrPtr) node)->atype == XML_ATTRIBUTE_ID)) {
@@ -249,16 +249,16 @@ static void php_libxml_node_free_list(xmlNodePtr node TSRMLS_DC)
case XML_DOCUMENT_TYPE_NODE:
case XML_NAMESPACE_DECL:
case XML_TEXT_NODE:
- php_libxml_node_free_list(node->children TSRMLS_CC);
+ php_libxml_node_free_list(node->children);
break;
default:
- php_libxml_node_free_list(node->children TSRMLS_CC);
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list(node->children);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
}
curnode = node->next;
xmlUnlinkNode(node);
- if (php_libxml_unregister_node(node TSRMLS_CC) == 0) {
+ if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_node_free(node);
@@ -308,7 +308,6 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
int isescaped=0;
xmlURI *uri;
- TSRMLS_FETCH();
uri = xmlParseURI(filename);
if (uri && (uri->scheme == NULL ||
@@ -333,9 +332,9 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
that the streams layer puts out at times, but for libxml we
may try to open files that don't exist, but it is not a failure
in xml processing (eg. DTD files) */
- wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 0);
if (wrapper && read_only && wrapper->wops->url_stat) {
- if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) {
+ if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL) == -1) {
if (isescaped) {
xmlFree(resolved_path);
}
@@ -364,19 +363,16 @@ static void *php_libxml_streams_IO_open_write_wrapper(const char *filename)
static int php_libxml_streams_IO_read(void *context, char *buffer, int len)
{
- TSRMLS_FETCH();
return php_stream_read((php_stream*)context, buffer, len);
}
static int php_libxml_streams_IO_write(void *context, const char *buffer, int len)
{
- TSRMLS_FETCH();
return php_stream_write((php_stream*)context, buffer, len);
}
static int php_libxml_streams_IO_close(void *context)
{
- TSRMLS_FETCH();
return php_stream_close((php_stream*)context);
}
@@ -385,7 +381,6 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
xmlParserInputBufferPtr ret;
void *context = NULL;
- TSRMLS_FETCH();
if (LIBXML(entity_loader_disabled)) {
return NULL;
@@ -469,7 +464,6 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
xmlError error_copy;
int ret;
- TSRMLS_FETCH();
memset(&error_copy, 0, sizeof(xmlError));
@@ -497,7 +491,7 @@ static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
}
}
-static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSRMLS_DC)
+static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg)
{
xmlParserCtxtPtr parser;
@@ -505,19 +499,19 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSR
if (parser != NULL && parser->input != NULL) {
if (parser->input->filename) {
- php_error_docref(NULL TSRMLS_CC, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line);
+ php_error_docref(NULL, level, "%s in %s, line: %d", msg, parser->input->filename, parser->input->line);
} else {
- php_error_docref(NULL TSRMLS_CC, level, "%s in Entity, line: %d", msg, parser->input->line);
+ php_error_docref(NULL, level, "%s in Entity, line: %d", msg, parser->input->line);
}
}
}
-void php_libxml_issue_error(int level, const char *msg TSRMLS_DC)
+void php_libxml_issue_error(int level, const char *msg)
{
if (LIBXML(error_list)) {
_php_list_set_error_structure(NULL, msg);
} else {
- php_error_docref(NULL TSRMLS_CC, level, "%s", msg);
+ php_error_docref(NULL, level, "%s", msg);
}
}
@@ -526,7 +520,6 @@ static void php_libxml_internal_error_handler(int error_type, void *ctx, const c
char *buf;
int len, len_iter, output = 0;
- TSRMLS_FETCH();
len = vspprintf(&buf, 0, *msg, ap);
len_iter = len;
@@ -547,13 +540,13 @@ static void php_libxml_internal_error_handler(int error_type, void *ctx, const c
} else {
switch (error_type) {
case PHP_LIBXML_CTX_ERROR:
- php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).s->val TSRMLS_CC);
+ php_libxml_ctx_error_level(E_WARNING, ctx, LIBXML(error_buffer).s->val);
break;
case PHP_LIBXML_CTX_WARNING:
- php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).s->val TSRMLS_CC);
+ php_libxml_ctx_error_level(E_NOTICE, ctx, LIBXML(error_buffer).s->val);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", LIBXML(error_buffer).s->val);
+ php_error_docref(NULL, E_WARNING, "%s", LIBXML(error_buffer).s->val);
}
}
smart_str_free(&LIBXML(error_buffer));
@@ -569,7 +562,6 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
zval params[3];
int status;
zend_fcall_info *fci;
- TSRMLS_FETCH();
fci = &LIBXML(entity_loader).fci;
@@ -611,7 +603,7 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
fci->param_count = sizeof(params)/sizeof(*params);
fci->no_separation = 1;
- status = zend_call_function(fci, &LIBXML(entity_loader).fcc TSRMLS_CC);
+ status = zend_call_function(fci, &LIBXML(entity_loader).fcc);
if (status != SUCCESS || Z_ISUNDEF(retval)) {
php_libxml_ctx_error(context,
"Call to user entity loader callback '%s' has failed",
@@ -686,7 +678,6 @@ is_string:
static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
const char *ID, xmlParserCtxtPtr context)
{
- TSRMLS_FETCH();
/* Check whether we're running in a PHP context, since the entity loader
* we've defined is an application level (true global) setting.
@@ -769,7 +760,7 @@ PHP_LIBXML_API void php_libxml_shutdown(void)
}
}
-PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext)
{
if (oldcontext) {
ZVAL_COPY_VALUE(oldcontext, &LIBXML(stream_context));
@@ -832,7 +823,7 @@ static PHP_MINIT_FUNCTION(libxml)
REGISTER_LONG_CONSTANT("LIBXML_ERR_FATAL", XML_ERR_FATAL, CONST_CS | CONST_PERSISTENT);
INIT_CLASS_ENTRY(ce, "LibXMLError", NULL);
- libxmlerror_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ libxmlerror_class_entry = zend_register_internal_class(&ce);
if (sapi_module.name) {
static const char * const supported_sapis[] = {
@@ -895,7 +886,6 @@ static PHP_MSHUTDOWN_FUNCTION(libxml)
static int php_libxml_post_deactivate(void)
{
- TSRMLS_FETCH();
/* reset libxml generic error handling */
if (_php_libxml_per_request_initialization) {
xmlSetGenericErrorFunc(NULL, NULL);
@@ -936,7 +926,7 @@ static PHP_FUNCTION(libxml_set_streams_context)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg) == FAILURE) {
return;
}
if (!Z_ISUNDEF(LIBXML(stream_context))) {
@@ -954,7 +944,7 @@ static PHP_FUNCTION(libxml_use_internal_errors)
xmlStructuredErrorFunc current_handler;
zend_bool use_errors=0, retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &use_errors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &use_errors) == FAILURE) {
return;
}
@@ -1036,20 +1026,20 @@ static PHP_FUNCTION(libxml_get_errors)
zval z_error;
object_init_ex(&z_error, libxmlerror_class_entry);
- add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level TSRMLS_CC);
- add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code TSRMLS_CC);
- add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 TSRMLS_CC);
+ add_property_long_ex(&z_error, "level", sizeof("level") - 1, error->level);
+ add_property_long_ex(&z_error, "code", sizeof("code") - 1, error->code);
+ add_property_long_ex(&z_error, "column", sizeof("column") - 1, error->int2 );
if (error->message) {
- add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message TSRMLS_CC);
+ add_property_string_ex(&z_error, "message", sizeof("message") - 1, error->message);
} else {
- add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0 TSRMLS_CC);
+ add_property_stringl_ex(&z_error, "message", sizeof("message") - 1, "", 0);
}
if (error->file) {
- add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file TSRMLS_CC);
+ add_property_string_ex(&z_error, "file", sizeof("file") - 1, error->file);
} else {
- add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0 TSRMLS_CC);
+ add_property_stringl_ex(&z_error, "file", sizeof("file") - 1, "", 0);
}
- add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line TSRMLS_CC);
+ add_property_long_ex(&z_error, "line", sizeof("line") - 1, error->line);
add_next_index_zval(return_value, &z_error);
error = zend_llist_get_next(LIBXML(error_list));
@@ -1069,7 +1059,7 @@ static PHP_FUNCTION(libxml_clear_errors)
}
/* }}} */
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC) /* {{{ */
+PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable) /* {{{ */
{
zend_bool old = LIBXML(entity_loader_disabled);
@@ -1083,11 +1073,11 @@ static PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &disable) == FAILURE) {
return;
}
- RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC));
+ RETURN_BOOL(php_libxml_disable_entity_loader(disable));
}
/* }}} */
@@ -1097,7 +1087,7 @@ static PHP_FUNCTION(libxml_set_external_entity_loader)
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!", &fci, &fcc)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc)
== FAILURE) {
return;
}
@@ -1156,7 +1146,7 @@ zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node ex
return zend_hash_add_mem(&php_libxml_exports, ce->name, &export_hnd, sizeof(export_hnd));
}
-PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
+PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object)
{
zend_class_entry *ce = NULL;
xmlNodePtr node = NULL;
@@ -1168,13 +1158,13 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
ce = ce->parent;
}
if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name))) {
- node = export_hnd->export_func(object TSRMLS_CC);
+ node = export_hnd->export_func(object);
}
}
return node;
}
-PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data)
{
int ret_refcount = -1;
@@ -1183,7 +1173,7 @@ PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object,
if (object->node->node == node) {
return object->node->refcount;
} else {
- php_libxml_decrement_node_ptr(object TSRMLS_CC);
+ php_libxml_decrement_node_ptr(object);
}
}
if (node->_private != NULL) {
@@ -1206,7 +1196,7 @@ PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object,
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object)
{
int ret_refcount = -1;
php_libxml_node_ptr *obj_node;
@@ -1226,7 +1216,7 @@ PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp)
{
int ret_refcount = -1;
@@ -1244,7 +1234,7 @@ PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object,
return ret_refcount;
}
-PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object)
{
int ret_refcount = -1;
@@ -1269,7 +1259,7 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object T
return ret_refcount;
}
-PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node)
{
if (!node) {
return;
@@ -1281,7 +1271,7 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
break;
default:
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
- php_libxml_node_free_list((xmlNodePtr) node->children TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->children);
switch (node->type) {
/* Skip property freeing for the following types */
case XML_ATTRIBUTE_DECL:
@@ -1293,19 +1283,19 @@ PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC)
case XML_TEXT_NODE:
break;
default:
- php_libxml_node_free_list((xmlNodePtr) node->properties TSRMLS_CC);
+ php_libxml_node_free_list((xmlNodePtr) node->properties);
}
- if (php_libxml_unregister_node(node TSRMLS_CC) == 0) {
+ if (php_libxml_unregister_node(node) == 0) {
node->doc = NULL;
}
php_libxml_node_free(node);
} else {
- php_libxml_unregister_node(node TSRMLS_CC);
+ php_libxml_unregister_node(node);
}
}
}
-PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC)
+PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object)
{
int ret_refcount = -1;
xmlNodePtr nodep;
@@ -1314,9 +1304,9 @@ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *o
if (object != NULL && object->node != NULL) {
obj_node = (php_libxml_node_ptr *) object->node;
nodep = object->node->node;
- ret_refcount = php_libxml_decrement_node_ptr(object TSRMLS_CC);
+ ret_refcount = php_libxml_decrement_node_ptr(object);
if (ret_refcount == 0) {
- php_libxml_node_free_resource(nodep TSRMLS_CC);
+ php_libxml_node_free_resource(nodep);
} else {
if (obj_node && object == obj_node->_private) {
obj_node->_private = NULL;
@@ -1325,7 +1315,7 @@ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *o
}
if (object != NULL && object->document != NULL) {
/* Safe to call as if the resource were freed then doc pointer is NULL */
- php_libxml_decrement_doc_ref(object TSRMLS_CC);
+ php_libxml_decrement_doc_ref(object);
}
}
/* }}} */
diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h
index ed5a5a70db..9bd2170540 100644
--- a/ext/libxml/php_libxml.h
+++ b/ext/libxml/php_libxml.h
@@ -88,25 +88,25 @@ static inline php_libxml_node_object *php_libxml_node_fetch_object(zend_object *
#define Z_LIBXML_NODE_P(zv) php_libxml_node_fetch_object(Z_OBJ_P((zv)))
-typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC);
+typedef void * (*php_libxml_export_node) (zval *object);
-PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC);
-PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object TSRMLS_DC);
-PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC);
+PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data);
+PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object);
+PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp);
+PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object);
+PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object);
PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
/* When an explicit freeing of node and children is required */
-PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node);
/* When object dtor is called as node may still be referenced */
-PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object);
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...);
PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
-PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext TSRMLS_DC);
-PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
-PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext);
+PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg);
+PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize(void);
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
index 56c364d867..f9d34fbfab 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
@@ -238,7 +238,7 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
CK((*filter->output_function)(c, filter->data));
}
filter->status = 0;
- /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/
+ /*php_error_docref("ref.mbstring", E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/
} else {
/* named entity */
buffer[filter->status] = 0;
@@ -254,12 +254,12 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
/* decoded */
CK((*filter->output_function)(ent, filter->data));
filter->status = 0;
- /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE,"mbstring decoded '%s'=%d", buffer, ent);*/
+ /*php_error_docref("ref.mbstring", E_NOTICE,"mbstring decoded '%s'=%d", buffer, ent);*/
} else {
/* failure */
buffer[filter->status++] = ';';
buffer[filter->status] = 0;
- /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer); */
+ /* php_error_docref("ref.mbstring", E_WARNING, "mbstring cannot decode '%s'", buffer); */
mbfl_filt_conv_html_dec_flush(filter);
}
}
@@ -273,7 +273,7 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter)
if (c=='&')
filter->status--;
buffer[filter->status] = 0;
- /* php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring cannot decode '%s'", buffer)l */
+ /* php_error_docref("ref.mbstring", E_WARNING, "mbstring cannot decode '%s'", buffer)l */
mbfl_filt_conv_html_dec_flush(filter);
if (c=='&')
{
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index a50768f6d0..86cbba4ded 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -62,11 +62,11 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
if (arg != PARSE_STRING) {
char *value = MBSTRG(internal_encoding_name);
- _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC);
+ _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0);
}
if (!MBSTRG(encoding_translation)) {
- php_default_treat_data(arg, str, destArray TSRMLS_CC);
+ php_default_treat_data(arg, str, destArray);
return;
}
@@ -93,7 +93,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
}
if (arg == PARSE_POST) {
- sapi_handle_post(&v_array TSRMLS_CC);
+ sapi_handle_post(&v_array);
return;
}
@@ -159,7 +159,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
MBSTRG(illegalchars) = 0;
- detected = _php_mb_encoding_handler_ex(&info, &v_array, res TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, &v_array, res);
MBSTRG(http_input_identify) = detected;
if (detected) {
@@ -190,7 +190,7 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
/* }}} */
/* {{{ mbfl_no_encoding _php_mb_encoding_handler_ex() */
-const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC)
+const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res)
{
char *var, *val;
const char *s1, *s2;
@@ -254,7 +254,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
if (n > (PG(max_input_vars) * 2)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ php_error_docref(NULL, E_WARNING, "Input variables exceeded %pd. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
goto out;
}
@@ -284,7 +284,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
if (!from_encoding) {
if (info->report_errors) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
}
from_encoding = &mbfl_encoding_pass;
}
@@ -298,7 +298,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
} else {
if (info->report_errors) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
}
goto out;
}
@@ -329,9 +329,9 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
n++;
/* we need val to be emalloc()ed */
val = estrndup(val, val_len);
- if (sapi_module.input_filter(info->data_type, var, &val, val_len, &new_val_len TSRMLS_CC)) {
+ if (sapi_module.input_filter(info->data_type, var, &val, val_len, &new_val_len)) {
/* add variable to symbol table */
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
+ php_register_variable_safe(var, val, new_val_len, array_ptr);
}
efree(val);
@@ -377,7 +377,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
php_stream_rewind(SG(request_info).request_body);
post_data_str = php_stream_copy_to_mem(SG(request_info).request_body, PHP_STREAM_COPY_ALL, 0);
- detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str->val TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str->val);
zend_string_release(post_data_str);
MBSTRG(http_input_identify) = detected;
diff --git a/ext/mbstring/mb_gpc.h b/ext/mbstring/mb_gpc.h
index 091d8e2d9b..c45c8250cc 100644
--- a/ext/mbstring/mb_gpc.h
+++ b/ext/mbstring/mb_gpc.h
@@ -47,7 +47,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler);
MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data);
int _php_mb_enable_encoding_translation(int flag);
-const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res TSRMLS_DC);
+const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_info_t *info, zval *arg, char *res);
/* }}} */
#endif /* HAVE_MBSTRING */
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 4cc73423d8..1e7cb5bd73 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -96,13 +96,13 @@ ZEND_DECLARE_MODULE_GLOBALS(mbstring)
static PHP_GINIT_FUNCTION(mbstring);
static PHP_GSHUTDOWN_FUNCTION(mbstring);
-static void php_mb_populate_current_detect_order_list(TSRMLS_D);
+static void php_mb_populate_current_detect_order_list(void);
-static int php_mb_encoding_translation(TSRMLS_D);
+static int php_mb_encoding_translation(void);
-static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size TSRMLS_DC);
+static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size);
-static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding TSRMLS_DC);
+static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding);
/* }}} */
@@ -603,7 +603,7 @@ ZEND_TSRMLS_CACHE_DEFINE;
ZEND_GET_MODULE(mbstring)
#endif
-static char *get_internal_encoding(TSRMLS_D) {
+static char *get_internal_encoding(void) {
if (PG(internal_encoding) && PG(internal_encoding)[0]) {
return PG(internal_encoding);
} else if (SG(default_charset)) {
@@ -612,7 +612,7 @@ static char *get_internal_encoding(TSRMLS_D) {
return "";
}
-static char *get_input_encoding(TSRMLS_D) {
+static char *get_input_encoding(void) {
if (PG(input_encoding) && PG(input_encoding)[0]) {
return PG(input_encoding);
} else if (SG(default_charset)) {
@@ -621,7 +621,7 @@ static char *get_input_encoding(TSRMLS_D) {
return "";
}
-static char *get_output_encoding(TSRMLS_D) {
+static char *get_output_encoding(void) {
if (PG(output_encoding) && PG(output_encoding)[0]) {
return PG(output_encoding);
} else if (SG(default_charset)) {
@@ -692,7 +692,7 @@ static sapi_post_entry mbstr_post_entries[] = {
* of parsed encodings.
*/
static int
-php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_encoding ***return_list, size_t *return_size, int persistent)
{
int size, bauto, ret = SUCCESS;
size_t n;
@@ -811,7 +811,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
* of parsed encodings.
*/
static int
-php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, size_t *return_size, int persistent)
{
zval *hash_entry;
HashTable *target_hash;
@@ -885,7 +885,7 @@ php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, siz
/* }}} */
/* {{{ zend_multibyte interface */
-static const zend_encoding* php_mb_zend_encoding_fetcher(const char *encoding_name TSRMLS_DC)
+static const zend_encoding* php_mb_zend_encoding_fetcher(const char *encoding_name)
{
return (const zend_encoding*)mbfl_name2encoding(encoding_name);
}
@@ -907,7 +907,7 @@ static int php_mb_zend_encoding_lexer_compatibility_checker(const zend_encoding
return 0;
}
-static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *arg_string, size_t arg_length, const zend_encoding **list, size_t list_size TSRMLS_DC)
+static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *arg_string, size_t arg_length, const zend_encoding **list, size_t list_size)
{
mbfl_string string;
@@ -923,7 +923,7 @@ static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *a
return (const zend_encoding *) mbfl_identify_encoding2(&string, (const mbfl_encoding **)list, list_size, 0);
}
-static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC)
+static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from)
{
mbfl_string string, result;
mbfl_buffer_converter *convd;
@@ -967,17 +967,17 @@ static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_leng
return loc;
}
-static int php_mb_zend_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC)
+static int php_mb_zend_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent)
{
- return php_mb_parse_encoding_list(encoding_list, encoding_list_len, (const mbfl_encoding ***)return_list, return_size, persistent TSRMLS_CC);
+ return php_mb_parse_encoding_list(encoding_list, encoding_list_len, (const mbfl_encoding ***)return_list, return_size, persistent);
}
-static const zend_encoding *php_mb_zend_internal_encoding_getter(TSRMLS_D)
+static const zend_encoding *php_mb_zend_internal_encoding_getter(void)
{
return (const zend_encoding *)MBSTRG(internal_encoding);
}
-static int php_mb_zend_internal_encoding_setter(const zend_encoding *encoding TSRMLS_DC)
+static int php_mb_zend_internal_encoding_setter(const zend_encoding *encoding)
{
MBSTRG(internal_encoding) = (const mbfl_encoding *)encoding;
return SUCCESS;
@@ -996,13 +996,13 @@ static zend_multibyte_functions php_mb_zend_multibyte_functions = {
};
/* }}} */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC);
+static void *_php_mb_compile_regex(const char *pattern);
static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len);
static void _php_mb_free_regex(void *opaque);
#if HAVE_ONIG
/* {{{ _php_mb_compile_regex */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
+static void *_php_mb_compile_regex(const char *pattern)
{
php_mb_regex_t *retval;
OnigErrorInfo err_info;
@@ -1015,7 +1015,7 @@ static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
ONIG_ENCODING_ASCII, &OnigSyntaxPerl, &err_info))) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err_code, err_info);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", pattern, err_str);
+ php_error_docref(NULL, E_WARNING, "%s: %s", pattern, err_str);
retval = NULL;
}
return retval;
@@ -1039,7 +1039,7 @@ static void _php_mb_free_regex(void *opaque)
/* }}} */
#elif HAVE_PCRE || HAVE_BUNDLED_PCRE
/* {{{ _php_mb_compile_regex */
-static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
+static void *_php_mb_compile_regex(const char *pattern)
{
pcre *retval;
const char *err_str;
@@ -1047,7 +1047,7 @@ static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC)
if (!(retval = pcre_compile(pattern,
PCRE_CASELESS, &err_str, &err_offset, NULL))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (offset=%d): %s", pattern, err_offset, err_str);
+ php_error_docref(NULL, E_WARNING, "%s (offset=%d): %s", pattern, err_offset, err_str);
}
return retval;
}
@@ -1088,7 +1088,7 @@ static int php_mb_nls_get_default_detect_order_list(enum mbfl_no_language lang,
}
/* }}} */
-static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, int len, char quote TSRMLS_DC)
+static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, int len, char quote)
{
char *result = emalloc(len + 2);
char *resp = result;
@@ -1111,7 +1111,7 @@ static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *
return result;
}
-static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, char stop TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line, char stop) /* {{{ */
{
char *pos = *line, quote;
char *res;
@@ -1151,7 +1151,7 @@ static char *php_mb_rfc1867_getword(const zend_encoding *encoding, char **line,
}
/* }}} */
-static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *str TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *str) /* {{{ */
{
while (*str && isspace(*(unsigned char *)str)) {
++str;
@@ -1165,19 +1165,19 @@ static char *php_mb_rfc1867_getword_conf(const zend_encoding *encoding, char *st
char quote = *str;
str++;
- return php_mb_rfc1867_substring_conf(encoding, str, strlen(str), quote TSRMLS_CC);
+ return php_mb_rfc1867_substring_conf(encoding, str, strlen(str), quote);
} else {
char *strend = str;
while (*strend && !isspace(*(unsigned char *)strend)) {
++strend;
}
- return php_mb_rfc1867_substring_conf(encoding, str, strend - str, 0 TSRMLS_CC);
+ return php_mb_rfc1867_substring_conf(encoding, str, strend - str, 0);
}
}
/* }}} */
-static char *php_mb_rfc1867_basename(const zend_encoding *encoding, char *filename TSRMLS_DC) /* {{{ */
+static char *php_mb_rfc1867_basename(const zend_encoding *encoding, char *filename) /* {{{ */
{
char *s, *s2;
const size_t filename_len = strlen(filename);
@@ -1238,7 +1238,7 @@ static PHP_INI_MH(OnUpdate_mbstring_detect_order)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1)) {
return FAILURE;
}
@@ -1261,7 +1261,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
if (MBSTRG(http_input_list)) {
pefree(MBSTRG(http_input_list), 1);
}
- if (SUCCESS == php_mb_parse_encoding_list(get_input_encoding(TSRMLS_C), strlen(get_input_encoding(TSRMLS_C))+1, &list, &size, 1 TSRMLS_CC)) {
+ if (SUCCESS == php_mb_parse_encoding_list(get_input_encoding(), strlen(get_input_encoding())+1, &list, &size, 1)) {
MBSTRG(http_input_list) = list;
MBSTRG(http_input_list_size) = size;
return SUCCESS;
@@ -1271,7 +1271,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
return SUCCESS;
}
- if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(new_value->val, new_value->len, &list, &size, 1)) {
return FAILURE;
}
@@ -1282,7 +1282,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
MBSTRG(http_input_list_size) = size;
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_input is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.http_input is deprecated");
}
return SUCCESS;
@@ -1295,7 +1295,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
const mbfl_encoding *encoding;
if (new_value == NULL || new_value->len == 0) {
- encoding = mbfl_name2encoding(get_output_encoding(TSRMLS_C));
+ encoding = mbfl_name2encoding(get_output_encoding());
if (!encoding) {
MBSTRG(http_output_encoding) = &mbfl_encoding_pass;
MBSTRG(current_http_output_encoding) = &mbfl_encoding_pass;
@@ -1313,7 +1313,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
MBSTRG(current_http_output_encoding) = encoding;
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_output is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.http_output is deprecated");
}
return SUCCESS;
@@ -1321,7 +1321,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
/* }}} */
/* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length)
{
const mbfl_encoding *encoding;
@@ -1334,12 +1334,12 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
#if HAVE_MBREGEX
{
const char *enc_name = new_value;
- if (FAILURE == php_mb_regex_set_default_mbctype(enc_name TSRMLS_CC)) {
+ if (FAILURE == php_mb_regex_set_default_mbctype(enc_name)) {
/* falls back to UTF-8 if an unknown encoding name is given */
enc_name = "UTF-8";
- php_mb_regex_set_default_mbctype(enc_name TSRMLS_CC);
+ php_mb_regex_set_default_mbctype(enc_name);
}
- php_mb_regex_set_mbctype(new_value TSRMLS_CC);
+ php_mb_regex_set_mbctype(new_value);
}
#endif
return SUCCESS;
@@ -1350,18 +1350,18 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
{
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
+ php_error_docref("ref.mbstring", E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
}
- if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
+ if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage) == FAILURE) {
return FAILURE;
}
if (stage & (PHP_INI_STAGE_STARTUP | PHP_INI_STAGE_SHUTDOWN | PHP_INI_STAGE_RUNTIME)) {
if (new_value && new_value->len) {
- return _php_mb_ini_mbstring_internal_encoding_set(new_value->val, new_value->len TSRMLS_CC);
+ return _php_mb_ini_mbstring_internal_encoding_set(new_value->val, new_value->len);
} else {
- return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(TSRMLS_C), strlen(get_internal_encoding(TSRMLS_C))+1 TSRMLS_CC);
+ return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(), strlen(get_internal_encoding())+1);
}
} else {
/* the corresponding mbstring globals needs to be set according to the
@@ -1420,14 +1420,14 @@ static PHP_INI_MH(OnUpdate_mbstring_encoding_translation)
return FAILURE;
}
- OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
if (MBSTRG(encoding_translation)) {
- sapi_unregister_post_entry(php_post_entries TSRMLS_CC);
- sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_unregister_post_entry(php_post_entries);
+ sapi_register_post_entries(mbstr_post_entries);
} else {
- sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC);
- sapi_register_post_entries(php_post_entries TSRMLS_CC);
+ sapi_unregister_post_entry(mbstr_post_entries);
+ sapi_register_post_entries(php_post_entries);
}
return SUCCESS;
@@ -1443,10 +1443,10 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output_conv_mimetypes)
if (!new_value) {
new_value = entry->orig_value;
}
- php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3 TSRMLS_CC);
+ php_trim(new_value->val, new_value->len, NULL, 0, &tmp, 3);
if (Z_STRLEN(tmp) > 0) {
- if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp) TSRMLS_CC))) {
+ if (!(re = _php_mb_compile_regex(Z_STRVAL(tmp)))) {
zval_dtor(&tmp);
return FAILURE;
}
@@ -1527,7 +1527,7 @@ ZEND_TSRMLS_CACHE_UPDATE;
mbstring_globals->outconv = NULL;
mbstring_globals->http_output_conv_mimetypes = NULL;
#if HAVE_MBREGEX
- mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc(TSRMLS_C);
+ mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc();
#endif
}
/* }}} */
@@ -1545,7 +1545,7 @@ static PHP_GSHUTDOWN_FUNCTION(mbstring)
_php_mb_free_regex(mbstring_globals->http_output_conv_mimetypes);
}
#if HAVE_MBREGEX
- php_mb_regex_globals_free(mbstring_globals->mb_regex_globals TSRMLS_CC);
+ php_mb_regex_globals_free(mbstring_globals->mb_regex_globals);
#endif
}
/* }}} */
@@ -1558,11 +1558,11 @@ PHP_MINIT_FUNCTION(mbstring)
REGISTER_INI_ENTRIES();
/* This is a global handler. Should not be set in a per-request handler. */
- sapi_register_treat_data(mbstr_treat_data TSRMLS_CC);
+ sapi_register_treat_data(mbstr_treat_data);
/* Post handlers are stored in the thread-local context. */
if (MBSTRG(encoding_translation)) {
- sapi_register_post_entries(mbstr_post_entries TSRMLS_CC);
+ sapi_register_post_entries(mbstr_post_entries);
}
REGISTER_LONG_CONSTANT("MB_OVERLOAD_MAIL", MB_OVERLOAD_MAIL, CONST_CS | CONST_PERSISTENT);
@@ -1577,7 +1577,7 @@ PHP_MINIT_FUNCTION(mbstring)
PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
- if (FAILURE == zend_multibyte_set_functions(&php_mb_zend_multibyte_functions TSRMLS_CC)) {
+ if (FAILURE == zend_multibyte_set_functions(&php_mb_zend_multibyte_functions)) {
return FAILURE;
}
@@ -1619,7 +1619,7 @@ PHP_RINIT_FUNCTION(mbstring)
MBSTRG(illegalchars) = 0;
- php_mb_populate_current_detect_order_list(TSRMLS_C);
+ php_mb_populate_current_detect_order_list();
/* override original function. */
if (MBSTRG(func_overload)){
@@ -1633,7 +1633,7 @@ PHP_RINIT_FUNCTION(mbstring)
func = zend_hash_str_find_ptr(EG(function_table), p->ovld_func, strlen(p->ovld_func));
if ((orig = zend_hash_str_find_ptr(EG(function_table), p->orig_func, strlen(p->orig_func))) == NULL) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't find function %s.", p->orig_func);
+ php_error_docref("ref.mbstring", E_WARNING, "mbstring couldn't find function %s.", p->orig_func);
return FAILURE;
} else {
ZEND_ASSERT(orig->type == ZEND_INTERNAL_FUNCTION);
@@ -1641,7 +1641,7 @@ PHP_RINIT_FUNCTION(mbstring)
function_add_ref(orig);
if (zend_hash_str_update_mem(EG(function_table), p->orig_func, strlen(p->orig_func), func, sizeof(zend_internal_function)) == NULL) {
- php_error_docref("ref.mbstring" TSRMLS_CC, E_WARNING, "mbstring couldn't replace function %s.", p->orig_func);
+ php_error_docref("ref.mbstring", E_WARNING, "mbstring couldn't replace function %s.", p->orig_func);
return FAILURE;
}
@@ -1654,7 +1654,7 @@ PHP_RINIT_FUNCTION(mbstring)
#if HAVE_MBREGEX
PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
- zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding) TSRMLS_CC);
+ zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding));
return SUCCESS;
}
@@ -1740,7 +1740,7 @@ PHP_FUNCTION(mb_language)
{
zend_string *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
if (name == NULL) {
@@ -1748,7 +1748,7 @@ PHP_FUNCTION(mb_language)
} else {
zend_string *ini_name = zend_string_init("mbstring.language", sizeof("mbstring.language") - 1, 0);
if (FAILURE == zend_alter_ini_entry(ini_name, name, PHP_INI_USER, PHP_INI_STAGE_RUNTIME)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown language \"%s\"", name->val);
+ php_error_docref(NULL, E_WARNING, "Unknown language \"%s\"", name->val);
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1766,7 +1766,7 @@ PHP_FUNCTION(mb_internal_encoding)
size_t name_len;
const mbfl_encoding *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
if (name == NULL) {
@@ -1779,7 +1779,7 @@ PHP_FUNCTION(mb_internal_encoding)
} else {
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
} else {
MBSTRG(current_internal_encoding) = encoding;
@@ -1800,7 +1800,7 @@ PHP_FUNCTION(mb_http_input)
const mbfl_encoding *result = NULL;
retname = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &typ, &typ_len) == FAILURE) {
return;
}
if (typ == NULL) {
@@ -1889,7 +1889,7 @@ PHP_FUNCTION(mb_http_output)
size_t name_len;
const mbfl_encoding *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
@@ -1903,7 +1903,7 @@ PHP_FUNCTION(mb_http_output)
} else {
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
} else {
MBSTRG(current_http_output_encoding) = encoding;
@@ -1919,7 +1919,7 @@ PHP_FUNCTION(mb_detect_order)
{
zval *arg1 = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1) == FAILURE) {
return;
}
@@ -1937,7 +1937,7 @@ PHP_FUNCTION(mb_detect_order)
size_t size = 0;
switch (Z_TYPE_P(arg1)) {
case IS_ARRAY:
- if (FAILURE == php_mb_parse_encoding_array(arg1, &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_array(arg1, &list, &size, 0)) {
if (list) {
efree(list);
}
@@ -1946,7 +1946,7 @@ PHP_FUNCTION(mb_detect_order)
break;
default:
convert_to_string_ex(arg1);
- if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), &list, &size, 0)) {
if (list) {
efree(list);
}
@@ -1975,7 +1975,7 @@ PHP_FUNCTION(mb_substitute_character)
{
zval *arg1 = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &arg1) == FAILURE) {
return;
}
@@ -2007,7 +2007,7 @@ PHP_FUNCTION(mb_substitute_character)
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character.");
+ php_error_docref(NULL, E_WARNING, "Unknown character.");
RETURN_FALSE;
}
}
@@ -2018,7 +2018,7 @@ PHP_FUNCTION(mb_substitute_character)
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown character.");
+ php_error_docref(NULL, E_WARNING, "Unknown character.");
RETURN_FALSE;
}
break;
@@ -2035,17 +2035,17 @@ PHP_FUNCTION(mb_preferred_mime_name)
char *name = NULL;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
} else {
no_encoding = mbfl_name2no_encoding(name);
if (no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETVAL_FALSE;
} else {
const char *preferred_name = mbfl_no2preferred_mime_name(no_encoding);
if (preferred_name == NULL || *preferred_name == '\0') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "No MIME preferred name corresponding to \"%s\"", name);
RETVAL_FALSE;
} else {
RETVAL_STRING((char *)preferred_name);
@@ -2069,7 +2069,7 @@ PHP_FUNCTION(mb_parse_str)
const mbfl_encoding *detected;
track_vars_array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &encstr, &encstr_len, &track_vars_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &encstr, &encstr_len, &track_vars_array) == FAILURE) {
return;
}
@@ -2091,13 +2091,13 @@ PHP_FUNCTION(mb_parse_str)
info.from_language = MBSTRG(language);
if (track_vars_array != NULL) {
- detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr);
} else {
zval tmp;
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
ZVAL_ARR(&tmp, symbol_table);
- detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr TSRMLS_CC);
+ detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr);
}
MBSTRG(http_input_identify) = detected;
@@ -2123,7 +2123,7 @@ PHP_FUNCTION(mb_output_handler)
unsigned char send_text_mimetype = 0;
char *s, *mimetype = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &arg_string, &arg_string_len, &arg_status) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &arg_string, &arg_string_len, &arg_status) == FAILURE) {
return;
}
@@ -2223,7 +2223,7 @@ PHP_FUNCTION(mb_strlen)
mbfl_string_init(&string);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
@@ -2233,7 +2233,7 @@ PHP_FUNCTION(mb_strlen)
} else {
string.no_encoding = mbfl_name2no_encoding(enc_name);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2265,24 +2265,24 @@ PHP_FUNCTION(mb_strpos)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (offset < 0 || offset > mbfl_strlen(&haystack)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
if (needle.len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
@@ -2294,16 +2294,16 @@ PHP_FUNCTION(mb_strpos)
case 1:
break;
case 2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Needle has not positive length");
+ php_error_docref(NULL, E_WARNING, "Needle has not positive length");
break;
case 4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding or conversion error");
+ php_error_docref(NULL, E_WARNING, "Unknown encoding or conversion error");
break;
case 8:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is empty");
+ php_error_docref(NULL, E_NOTICE, "Argument is empty");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in mb_strpos");
+ php_error_docref(NULL, E_WARNING, "Unknown error in mb_strpos");
break;
}
RETVAL_FALSE;
@@ -2331,7 +2331,7 @@ PHP_FUNCTION(mb_strrpos)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
@@ -2379,7 +2379,7 @@ PHP_FUNCTION(mb_strrpos)
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2395,7 +2395,7 @@ PHP_FUNCTION(mb_strrpos)
int haystack_char_len = mbfl_strlen(&haystack);
if ((offset > 0 && offset > haystack_char_len) ||
(offset < 0 && -offset > haystack_char_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
}
@@ -2421,14 +2421,14 @@ PHP_FUNCTION(mb_stripos)
n = -1;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
if (needle.len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
- n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
if (n >= 0) {
RETVAL_LONG(n);
@@ -2450,11 +2450,11 @@ PHP_FUNCTION(mb_strripos)
n = -1;
offset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
if (n >= 0) {
RETVAL_LONG(n);
@@ -2481,20 +2481,20 @@ PHP_FUNCTION(mb_strstr)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, (int *)&haystack.len, (char **)&needle.val, (int *)&needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (needle.len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
n = mbfl_strpos(&haystack, &needle, 0, 0);
@@ -2543,14 +2543,14 @@ PHP_FUNCTION(mb_strrchr)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2607,22 +2607,22 @@ PHP_FUNCTION(mb_stristr)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
if (!needle.len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
RETURN_FALSE;
}
- n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
if (n <0) {
RETURN_FALSE;
@@ -2670,17 +2670,17 @@ PHP_FUNCTION(mb_strrichr)
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
RETURN_FALSE;
}
- n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding TSRMLS_CC);
+ n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
if (n <0) {
RETURN_FALSE;
@@ -2727,20 +2727,20 @@ PHP_FUNCTION(mb_substr_count)
needle.no_language = MBSTRG(language);
needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
if (needle.len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring");
+ php_error_docref(NULL, E_WARNING, "Empty substring");
RETURN_FALSE;
}
@@ -2765,7 +2765,7 @@ PHP_FUNCTION(mb_substr)
zval *z_len = NULL;
mbfl_string string, result, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2776,7 +2776,7 @@ PHP_FUNCTION(mb_substr)
if (argc == 4) {
string.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2848,14 +2848,14 @@ PHP_FUNCTION(mb_strcut)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
if (argc == 4) {
string.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2916,14 +2916,14 @@ PHP_FUNCTION(mb_strwidth)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
if (enc_name != NULL) {
string.no_encoding = mbfl_name2no_encoding(enc_name);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
RETURN_FALSE;
}
}
@@ -2946,7 +2946,7 @@ PHP_FUNCTION(mb_strimwidth)
size_t str_len, trimmarker_len, encoding_len;
mbfl_string string, result, marker, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|ss", &str, &str_len, &from, &width, &trimmarker, &trimmarker_len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|ss", &str, &str_len, &from, &width, &trimmarker, &trimmarker_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2962,7 +2962,7 @@ PHP_FUNCTION(mb_strimwidth)
if (ZEND_NUM_ARGS() == 5) {
string.no_encoding = marker.no_encoding = mbfl_name2no_encoding(encoding);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
}
@@ -2971,12 +2971,12 @@ PHP_FUNCTION(mb_strimwidth)
string.len = str_len;
if (from < 0 || (size_t)from > str_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range");
+ php_error_docref(NULL, E_WARNING, "Start position is out of range");
RETURN_FALSE;
}
if (width < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width is negative value");
+ php_error_docref(NULL, E_WARNING, "Width is negative value");
RETURN_FALSE;
}
@@ -2997,7 +2997,7 @@ PHP_FUNCTION(mb_strimwidth)
/* }}} */
/* {{{ MBSTRING_API char *php_mb_convert_encoding() */
-MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len TSRMLS_DC)
+MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len)
{
mbfl_string string, result, *ret;
const mbfl_encoding *from_encoding, *to_encoding;
@@ -3016,7 +3016,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (_to_encoding && strlen(_to_encoding)) {
to_encoding = mbfl_name2encoding(_to_encoding);
if (!to_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", _to_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", _to_encoding);
return NULL;
}
} else {
@@ -3036,7 +3036,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (_from_encodings) {
list = NULL;
size = 0;
- php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0 TSRMLS_CC);
+ php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0);
if (size == 1) {
from_encoding = *list;
string.no_encoding = from_encoding->no_encoding;
@@ -3046,13 +3046,13 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
if (from_encoding) {
string.no_encoding = from_encoding->no_encoding;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect character encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect character encoding");
from_encoding = &mbfl_encoding_pass;
to_encoding = from_encoding;
string.no_encoding = from_encoding->no_encoding;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal character encoding specified");
+ php_error_docref(NULL, E_WARNING, "Illegal character encoding specified");
}
if (list != NULL) {
efree((void *)list);
@@ -3062,7 +3062,7 @@ MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length, co
/* initialize converter */
convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, string.len);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create character encoding converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create character encoding converter");
return NULL;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
@@ -3096,7 +3096,7 @@ PHP_FUNCTION(mb_convert_encoding)
zval *hash_entry;
HashTable *target_hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &arg_str, &str_len, &arg_new, &new_len, &arg_old) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &arg_str, &str_len, &arg_new, &new_len, &arg_old) == FAILURE) {
return;
}
@@ -3135,7 +3135,7 @@ PHP_FUNCTION(mb_convert_encoding)
}
/* new encoding */
- ret = php_mb_convert_encoding(arg_str, str_len, arg_new, _from_encodings, &size TSRMLS_CC);
+ ret = php_mb_convert_encoding(arg_str, str_len, arg_new, _from_encodings, &size);
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL(ret, size); /* the string is already strdup()'ed */
@@ -3162,12 +3162,12 @@ PHP_FUNCTION(mb_convert_case)
size_t ret_len;
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|s!", &str, &str_len,
&case_mode, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3188,11 +3188,11 @@ PHP_FUNCTION(mb_strtoupper)
char *newstr;
size_t ret_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3215,11 +3215,11 @@ PHP_FUNCTION(mb_strtolower)
char *newstr;
size_t ret_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &str, &str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding TSRMLS_CC);
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3245,7 +3245,7 @@ PHP_FUNCTION(mb_detect_encoding)
const mbfl_encoding **elist, **list;
size_t size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zb", &str, &str_len, &encoding_list, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|zb", &str, &str_len, &encoding_list, &strict) == FAILURE) {
return;
}
@@ -3255,7 +3255,7 @@ PHP_FUNCTION(mb_detect_encoding)
if (ZEND_NUM_ARGS() >= 2 && !Z_ISNULL_P(encoding_list)) {
switch (Z_TYPE_P(encoding_list)) {
case IS_ARRAY:
- if (FAILURE == php_mb_parse_encoding_array(encoding_list, &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_array(encoding_list, &list, &size, 0)) {
if (list) {
efree(list);
list = NULL;
@@ -3265,7 +3265,7 @@ PHP_FUNCTION(mb_detect_encoding)
break;
default:
convert_to_string(encoding_list);
- if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0 TSRMLS_CC)) {
+ if (FAILURE == php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0)) {
if (list) {
efree(list);
list = NULL;
@@ -3275,7 +3275,7 @@ PHP_FUNCTION(mb_detect_encoding)
break;
}
if (size <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal argument");
+ php_error_docref(NULL, E_WARNING, "Illegal argument");
}
}
@@ -3333,13 +3333,13 @@ PHP_FUNCTION(mb_encoding_aliases)
char *name = NULL;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
encoding = mbfl_name2encoding(name);
if (!encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", name);
RETURN_FALSE;
}
@@ -3371,7 +3371,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
return;
}
@@ -3381,7 +3381,7 @@ PHP_FUNCTION(mb_encode_mimeheader)
if (charset_name != NULL) {
charset = mbfl_name2no_encoding(charset_name);
if (charset == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", charset_name);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", charset_name);
RETURN_FALSE;
}
} else {
@@ -3422,7 +3422,7 @@ PHP_FUNCTION(mb_decode_mimeheader)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char **)&string.val, &string.len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string.val, &string.len) == FAILURE) {
return;
}
@@ -3453,7 +3453,7 @@ PHP_FUNCTION(mb_convert_kana)
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
return;
}
@@ -3527,7 +3527,7 @@ PHP_FUNCTION(mb_convert_kana)
if (encname != NULL) {
string.no_encoding = mbfl_name2no_encoding(encname);
if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encname);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encname);
RETURN_FALSE;
}
}
@@ -3562,14 +3562,14 @@ PHP_FUNCTION(mb_convert_variables)
char *to_enc;
void *ptmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz+", &to_enc, &to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz+", &to_enc, &to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
return;
}
/* new encoding */
to_encoding = mbfl_name2encoding(to_enc);
if (!to_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", to_enc);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", to_enc);
RETURN_FALSE;
}
@@ -3585,11 +3585,11 @@ PHP_FUNCTION(mb_convert_variables)
elistsz = 0;
switch (Z_TYPE_P(zfrom_enc)) {
case IS_ARRAY:
- php_mb_parse_encoding_array(zfrom_enc, &elist, &elistsz, 0 TSRMLS_CC);
+ php_mb_parse_encoding_array(zfrom_enc, &elist, &elistsz, 0);
break;
default:
convert_to_string_ex(zfrom_enc);
- php_mb_parse_encoding_list(Z_STRVAL_P(zfrom_enc), Z_STRLEN_P(zfrom_enc), &elist, &elistsz, 0 TSRMLS_CC);
+ php_mb_parse_encoding_list(Z_STRVAL_P(zfrom_enc), Z_STRLEN_P(zfrom_enc), &elist, &elistsz, 0);
break;
}
@@ -3668,7 +3668,7 @@ detect_end:
efree(stack);
if (!from_encoding) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to detect encoding");
+ php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
from_encoding = &mbfl_encoding_pass;
}
}
@@ -3680,7 +3680,7 @@ detect_end:
if (from_encoding != &mbfl_encoding_pass) {
convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, 0);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
@@ -3787,7 +3787,7 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
mbfl_string string, result, *ret;
enum mbfl_no_encoding no_encoding;
- if (zend_parse_parameters(argc TSRMLS_CC, "sz|sb", &str, &str_len, &zconvmap, &encoding, &encoding_len, &is_hex) == FAILURE) {
+ if (zend_parse_parameters(argc, "sz|sb", &str, &str_len, &zconvmap, &encoding, &encoding_len, &is_hex) == FAILURE) {
return;
}
@@ -3801,7 +3801,7 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
if ((argc == 3 || argc == 4) && encoding_len > 0) {
no_encoding = mbfl_name2no_encoding(encoding);
if (no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
} else {
string.no_encoding = no_encoding;
@@ -4097,7 +4097,7 @@ PHP_FUNCTION(mb_send_mail)
body_enc = lang->mail_body_encoding;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
return;
}
@@ -4142,7 +4142,7 @@ PHP_FUNCTION(mb_send_mail)
}
if (_tran_cs == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset);
+ php_error_docref(NULL, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset);
_tran_cs = mbfl_no_encoding_ascii;
}
tran_cs = _tran_cs;
@@ -4165,7 +4165,7 @@ PHP_FUNCTION(mb_send_mail)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", Z_STRVAL_P(s));
+ php_error_docref(NULL, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", Z_STRVAL_P(s));
body_enc = mbfl_no_encoding_8bit;
break;
}
@@ -4197,7 +4197,7 @@ PHP_FUNCTION(mb_send_mail)
to_r = to;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing To: field");
+ php_error_docref(NULL, E_WARNING, "Missing To: field");
err = 1;
}
@@ -4216,7 +4216,7 @@ PHP_FUNCTION(mb_send_mail)
subject_buf = subject = (char *)pstr->val;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing Subject: field");
+ php_error_docref(NULL, E_WARNING, "Missing Subject: field");
err = 1;
}
@@ -4247,7 +4247,7 @@ PHP_FUNCTION(mb_send_mail)
}
} else {
/* this is not really an error, so it is allowed. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty message body");
+ php_error_docref(NULL, E_WARNING, "Empty message body");
message = NULL;
}
@@ -4300,7 +4300,7 @@ PHP_FUNCTION(mb_send_mail)
extra_cmd = php_escape_shell_cmd(extra_cmd->val);
}
- if (!err && php_mail(to_r, subject, message, headers, extra_cmd ? extra_cmd->val : NULL TSRMLS_CC)) {
+ if (!err && php_mail(to_r, subject, message, headers, extra_cmd ? extra_cmd->val : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -4344,7 +4344,7 @@ PHP_FUNCTION(mb_get_info)
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
const mbfl_encoding **entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &typ, &typ_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &typ, &typ_len) == FAILURE) {
return;
}
@@ -4522,7 +4522,7 @@ PHP_FUNCTION(mb_check_encoding)
mbfl_string string, result, *ret = NULL;
long illegalchars = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &var, &var_len, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ss", &var, &var_len, &enc, &enc_len) == FAILURE) {
return;
}
@@ -4533,14 +4533,14 @@ PHP_FUNCTION(mb_check_encoding)
if (enc != NULL) {
encoding = mbfl_name2encoding(enc);
if (!encoding || encoding == &mbfl_encoding_pass) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid encoding \"%s\"", enc);
+ php_error_docref(NULL, E_WARNING, "Invalid encoding \"%s\"", enc);
RETURN_FALSE;
}
}
convd = mbfl_buffer_converter_new2(encoding, encoding, 0);
if (convd == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create converter");
+ php_error_docref(NULL, E_WARNING, "Unable to create converter");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE);
@@ -4567,7 +4567,7 @@ PHP_FUNCTION(mb_check_encoding)
/* }}} */
/* {{{ php_mb_populate_current_detect_order_list */
-static void php_mb_populate_current_detect_order_list(TSRMLS_D)
+static void php_mb_populate_current_detect_order_list(void)
{
const mbfl_encoding **entry = 0;
size_t nentries;
@@ -4595,7 +4595,7 @@ static void php_mb_populate_current_detect_order_list(TSRMLS_D)
/* }}} */
/* {{{ static int php_mb_encoding_translation() */
-static int php_mb_encoding_translation(TSRMLS_D)
+static int php_mb_encoding_translation(void)
{
return MBSTRG(encoding_translation);
}
@@ -4620,7 +4620,7 @@ MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *e
/* }}} */
/* {{{ MBSTRING_API size_t php_mb_mbchar_bytes() */
-MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC)
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s)
{
return php_mb_mbchar_bytes_ex(s, MBSTRG(internal_encoding));
}
@@ -4668,7 +4668,7 @@ MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c, size_t
/* }}} */
/* {{{ MBSTRING_API char *php_mb_safe_strrchr() */
-MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes TSRMLS_DC)
+MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nbytes)
{
return php_mb_safe_strrchr_ex(s, c, nbytes, MBSTRG(internal_encoding));
}
@@ -4676,7 +4676,7 @@ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nby
/* {{{ MBSTRING_API int php_mb_stripos()
*/
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding TSRMLS_DC)
+MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding)
{
int n;
mbfl_string haystack, needle;
@@ -4691,7 +4691,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
do {
size_t len = 0;
- haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_haystack, old_haystack_len, &len, from_encoding TSRMLS_CC);
+ haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_haystack, old_haystack_len, &len, from_encoding);
haystack.len = len;
if (!haystack.val) {
@@ -4702,7 +4702,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
break;
}
- needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_needle, old_needle_len, &len, from_encoding TSRMLS_CC);
+ needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_needle, old_needle_len, &len, from_encoding);
needle.len = len;
if (!needle.val) {
@@ -4715,7 +4715,7 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
break;
}
@@ -4725,12 +4725,12 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
if (mode) {
if ((offset > 0 && offset > haystack_char_len) ||
(offset < 0 && -offset > haystack_char_len)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
break;
}
} else {
if (offset < 0 || offset > haystack_char_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
break;
}
}
@@ -4751,14 +4751,14 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int
}
/* }}} */
-static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size TSRMLS_DC) /* {{{ */
+static void php_mb_gpc_get_detect_order(const zend_encoding ***list, size_t *list_size) /* {{{ */
{
*list = (const zend_encoding **)MBSTRG(http_input_list);
*list_size = MBSTRG(http_input_list_size);
}
/* }}} */
-static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding TSRMLS_DC) /* {{{ */
+static void php_mb_gpc_set_input_encoding(const zend_encoding *encoding) /* {{{ */
{
MBSTRG(http_input_identify) = (const mbfl_encoding*)encoding;
}
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index bc6434f81f..7f4b5dbafc 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -131,27 +131,27 @@ PHP_FUNCTION(mb_check_encoding);
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
size_t nbytes, const mbfl_encoding *enc);
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
- size_t nbytes TSRMLS_DC);
+ size_t nbytes);
MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
const char *_to_encoding,
const char *_from_encodings,
- size_t *output_len TSRMLS_DC);
+ size_t *output_len);
-MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list TSRMLS_DC);
+MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list);
MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
-MBSTRING_API size_t php_mb_mbchar_bytes(const char *s TSRMLS_DC);
+MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
- char *arg_list TSRMLS_DC);
+ char *arg_list);
MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
- const char *encoding_from TSRMLS_DC);
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding TSRMLS_DC);
+ const char *encoding_from);
+MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding);
/* internal use only */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC);
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length);
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
char *internal_encoding_name;
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 8be88c3fee..6f3954e013 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -61,7 +61,7 @@ static void php_mb_regex_free_cache(zval *el) {
/* }}} */
/* {{{ _php_mb_regex_globals_ctor */
-static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
{
pglobals->default_mbctype = ONIG_ENCODING_UTF8;
pglobals->current_mbctype = ONIG_ENCODING_UTF8;
@@ -77,21 +77,21 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
/* }}} */
/* {{{ _php_mb_regex_globals_dtor */
-static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
zend_hash_destroy(&pglobals->ht_rc);
}
/* }}} */
/* {{{ php_mb_regex_globals_alloc */
-zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
+zend_mb_regex_globals *php_mb_regex_globals_alloc(void)
{
zend_mb_regex_globals *pglobals = pemalloc(
sizeof(zend_mb_regex_globals), 1);
if (!pglobals) {
return NULL;
}
- if (SUCCESS != _php_mb_regex_globals_ctor(pglobals TSRMLS_CC)) {
+ if (SUCCESS != _php_mb_regex_globals_ctor(pglobals)) {
pefree(pglobals, 1);
return NULL;
}
@@ -100,12 +100,12 @@ zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
/* }}} */
/* {{{ php_mb_regex_globals_free */
-void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals TSRMLS_DC)
+void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals)
{
if (!pglobals) {
return;
}
- _php_mb_regex_globals_dtor(pglobals TSRMLS_CC);
+ _php_mb_regex_globals_dtor(pglobals);
pefree(pglobals, 1);
}
/* }}} */
@@ -403,7 +403,7 @@ static const char *_php_mb_regex_mbctype2name(OnigEncoding mbctype)
/* }}} */
/* {{{ php_mb_regex_set_mbctype */
-int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -415,7 +415,7 @@ int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_set_default_mbctype */
-int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_default_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -427,14 +427,14 @@ int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_get_mbctype */
-const char *php_mb_regex_get_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(current_mbctype));
}
/* }}} */
/* {{{ php_mb_regex_get_default_mbctype */
-const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_default_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(default_mbctype));
}
@@ -444,7 +444,7 @@ const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
* regex cache
*/
/* {{{ php_mbregex_compile_pattern */
-static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC)
+static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax)
{
int err_code = 0;
php_mb_regex_t *retval = NULL, *rc = NULL;
@@ -455,7 +455,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
onig_error_code_to_str(err_str, err_code, err_info);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
retval = NULL;
goto out;
}
@@ -658,7 +658,7 @@ PHP_FUNCTION(mb_regex_encoding)
size_t encoding_len;
OnigEncoding mbctype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -674,7 +674,7 @@ PHP_FUNCTION(mb_regex_encoding)
mbctype = _php_mb_regex_name2mbctype(encoding);
if (mbctype == ONIG_ENCODING_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
@@ -698,7 +698,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
RETURN_FALSE;
}
@@ -718,12 +718,12 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (Z_STRLEN_P(arg_pattern) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
+ php_error_docref(NULL, E_WARNING, "empty pattern");
RETVAL_FALSE;
goto out;
}
- re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC);
+ re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax));
if (re == NULL) {
RETVAL_FALSE;
goto out;
@@ -819,7 +819,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
current_enc_name = _php_mb_regex_mbctype2name(MBREX(current_mbctype));
if (current_enc_name == NULL ||
(enc = mbfl_name2encoding(current_enc_name)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
RETURN_FALSE;
}
}
@@ -829,7 +829,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
size_t option_str_len = 0;
if (!is_callable) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zss|s",
&arg_pattern_zval,
&replace, &replace_len,
&string, &string_len,
@@ -837,7 +837,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zfs|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zfs|s",
&arg_pattern_zval,
&arg_replace_fci, &arg_replace_fci_cache,
&string, &string_len,
@@ -866,14 +866,14 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_pattern_len = 1;
}
/* create regex pattern buffer */
- re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax TSRMLS_CC);
+ re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax);
if (re == NULL) {
RETURN_FALSE;
}
if (eval || is_callable) {
pbuf = &eval_buf;
- description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC);
+ description = zend_make_compiled_string_description("mbregex replace");
} else {
pbuf = &out_buf;
description = NULL;
@@ -881,7 +881,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (is_callable) {
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback");
+ php_error_docref(NULL, E_WARNING, "Option 'e' cannot be used with replacement callback");
RETURN_FALSE;
}
}
@@ -896,13 +896,13 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
break;
}
if (err >= 0) {
#if moriyoshi_0
if (regs->beg[0] == regs->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
break;
}
#endif
@@ -939,9 +939,9 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
/* null terminate buffer */
smart_str_0(&eval_buf);
/* do eval */
- if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description TSRMLS_CC) == FAILURE) {
+ if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description) == FAILURE) {
efree(description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
+ php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
/* zend_error() does not return in this case */
}
@@ -968,7 +968,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_replace_fci.param_count = 1;
arg_replace_fci.params = args;
arg_replace_fci.retval = &retval;
- if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache TSRMLS_CC) == SUCCESS &&
+ if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache) == SUCCESS &&
!Z_ISUNDEF(retval)) {
convert_to_string_ex(&retval);
smart_str_appendl(&out_buf, Z_STRVAL(retval), Z_STRLEN(retval));
@@ -979,7 +979,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
} else {
efree(description);
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+ php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
}
}
zval_ptr_dtor(&subpats);
@@ -1062,7 +1062,7 @@ PHP_FUNCTION(mb_split)
int n, err;
zend_long count = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
RETURN_FALSE;
}
@@ -1071,7 +1071,7 @@ PHP_FUNCTION(mb_split)
}
/* create regex pattern buffer */
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
@@ -1111,7 +1111,7 @@ PHP_FUNCTION(mb_split)
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(mb_ereg_match)
char *option_str = NULL;
size_t option_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s",
&arg_pattern, &arg_pattern_len, &string, &string_len,
&option_str, &option_str_len)==FAILURE) {
RETURN_FALSE;
@@ -1159,7 +1159,7 @@ PHP_FUNCTION(mb_ereg_match)
}
}
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
@@ -1186,7 +1186,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
OnigUChar *str;
OnigSyntaxType *syntax;
- if (zend_parse_parameters(argc TSRMLS_CC, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
@@ -1199,7 +1199,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (argc > 0) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
}
@@ -1213,12 +1213,12 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
if (MBREX(search_re) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No regex given");
+ php_error_docref(NULL, E_WARNING, "No regex given");
RETURN_FALSE;
}
if (str == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No string given");
+ php_error_docref(NULL, E_WARNING, "No string given");
RETURN_FALSE;
}
@@ -1234,11 +1234,11 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
} else if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
RETVAL_FALSE;
} else {
if (MBREX(search_regs)->beg[0] == MBREX(search_regs)->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
}
switch (mode) {
case 1:
@@ -1315,12 +1315,12 @@ PHP_FUNCTION(mb_ereg_search_init)
OnigSyntaxType *syntax = NULL;
OnigOptionType option;
- if (zend_parse_parameters(argc TSRMLS_CC, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
if (argc > 1 && arg_pattern_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty pattern");
+ php_error_docref(NULL, E_WARNING, "Empty pattern");
RETURN_FALSE;
}
@@ -1334,7 +1334,7 @@ PHP_FUNCTION(mb_ereg_search_init)
if (argc > 1) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
}
@@ -1398,12 +1398,12 @@ PHP_FUNCTION(mb_ereg_search_setpos)
{
zend_long position;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) {
return;
}
if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range");
+ php_error_docref(NULL, E_WARNING, "Position is out of range");
MBREX(search_pos) = 0;
RETURN_FALSE;
}
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
/* }}} */
/* {{{ php_mb_regex_set_options */
-static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC)
+static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax)
{
if (prev_options != NULL) {
*prev_options = MBREX(regex_default_options);
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(mb_regex_set_options)
size_t string_len;
char buf[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&string, &string_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(mb_regex_set_options)
opt = 0;
syntax = NULL;
_php_mb_regex_init_options(string, string_len, &opt, &syntax, NULL);
- _php_mb_regex_set_options(opt, syntax, NULL, NULL TSRMLS_CC);
+ _php_mb_regex_set_options(opt, syntax, NULL, NULL);
} else {
opt = MBREX(regex_default_options);
syntax = MBREX(regex_default_syntax);
diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h
index 0088b0a716..c819f2c17c 100644
--- a/ext/mbstring/php_mbregex.h
+++ b/ext/mbstring/php_mbregex.h
@@ -70,12 +70,12 @@ PHP_MINFO_FUNCTION(mb_regex);
typedef struct _zend_mb_regex_globals zend_mb_regex_globals;
-zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D);
-void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals TSRMLS_DC);
-int php_mb_regex_set_mbctype(const char *enc TSRMLS_DC);
-int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC);
-const char *php_mb_regex_get_mbctype(TSRMLS_D);
-const char *php_mb_regex_get_default_mbctype(TSRMLS_D);
+zend_mb_regex_globals *php_mb_regex_globals_alloc(void);
+void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals);
+int php_mb_regex_set_mbctype(const char *enc);
+int php_mb_regex_set_default_mbctype(const char *encname);
+const char *php_mb_regex_get_mbctype(void);
+const char *php_mb_regex_get_default_mbctype(void);
PHP_FUNCTION(mb_regex_encoding);
PHP_FUNCTION(mb_ereg);
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index ee5b75e67a..75973c9b47 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -160,7 +160,7 @@ MBSTRING_API unsigned long php_turkish_tolower(unsigned long code, long l, long
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -191,7 +191,7 @@ MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -222,7 +222,7 @@ MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_
return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_encoding enc TSRMLS_DC)
+MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_encoding enc)
{
int field;
long l, r;
@@ -268,7 +268,7 @@ MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_
}
MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *ret_len,
- const char *src_encoding TSRMLS_DC)
+ const char *src_encoding)
{
char *unicode, *newstr;
size_t unicode_len;
@@ -277,11 +277,11 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
enum mbfl_no_encoding _src_encoding = mbfl_name2no_encoding(src_encoding);
if (_src_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", src_encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", src_encoding);
return NULL;
}
- unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len TSRMLS_CC);
+ unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len);
if (unicode == NULL)
return NULL;
@@ -291,14 +291,14 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
case PHP_UNICODE_CASE_UPPER:
for (i = 0; i < unicode_len; i+=4) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
break;
case PHP_UNICODE_CASE_LOWER:
for (i = 0; i < unicode_len; i+=4) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
break;
@@ -312,7 +312,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
if (mode) {
if (res) {
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
} else {
mode = 0;
}
@@ -320,7 +320,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
if (res) {
mode = 1;
UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding TSRMLS_CC));
+ php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
}
}
}
@@ -328,7 +328,7 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
}
- newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len TSRMLS_CC);
+ newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len);
efree(unicode);
return newstr;
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index e376895cbd..7bdeb86faa 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -104,7 +104,7 @@
MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
unsigned long mask2);
MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *retlen,
- const char *src_encoding TSRMLS_DC);
+ const char *src_encoding);
#define PHP_UNICODE_CASE_UPPER 0
#define PHP_UNICODE_CASE_LOWER 1
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index d33cdd5972..7b5823ec41 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -330,7 +330,7 @@ typedef enum {
*/
#define MCRYPT_GET_CRYPT_ARGS \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssz|s", \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssz|s", \
&cipher, &cipher_len, &key, &key_len, &data, &data_len, &mode, &iv, &iv_len) == FAILURE) { \
return; \
}
@@ -338,7 +338,7 @@ typedef enum {
#define MCRYPT_GET_TD_ARG \
zval *mcryptind; \
php_mcrypt *pm; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mcryptind) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mcryptind) == FAILURE) { \
return; \
} \
ZEND_FETCH_RESOURCE (pm, php_mcrypt *, mcryptind, -1, "MCrypt", le_mcrypt);
@@ -348,7 +348,7 @@ typedef enum {
size_t dir_len; \
char *module; \
size_t module_len; \
- if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, \
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), \
"s|s", &module, &module_len, &dir, &dir_len) == FAILURE) { \
return; \
}
@@ -360,7 +360,7 @@ typedef enum {
#define PHP_MCRYPT_INIT_CHECK \
if (!pm->init) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation disallowed prior to mcrypt_generic_init()."); \
+ php_error_docref(NULL, E_WARNING, "Operation disallowed prior to mcrypt_generic_init()."); \
RETURN_FALSE; \
} \
@@ -369,7 +369,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("mcrypt.modes_dir", NULL, PHP_INI_ALL, OnUpdateString, modes_dir, zend_mcrypt_globals, mcrypt_globals)
PHP_INI_END()
-static void php_mcrypt_module_dtor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_mcrypt_module_dtor(zend_resource *rsrc) /* {{{ */
{
php_mcrypt *pm = (php_mcrypt *) rsrc->ptr;
if (pm) {
@@ -435,8 +435,8 @@ static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
MCRYPT_ENTRY2_2_4(MODE_STREAM, "stream");
REGISTER_INI_ENTRIES();
- php_stream_filter_register_factory("mcrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
- php_stream_filter_register_factory("mdecrypt.*", &php_mcrypt_filter_factory TSRMLS_CC);
+ php_stream_filter_register_factory("mcrypt.*", &php_mcrypt_filter_factory);
+ php_stream_filter_register_factory("mdecrypt.*", &php_mcrypt_filter_factory);
return SUCCESS;
}
@@ -444,8 +444,8 @@ static PHP_MINIT_FUNCTION(mcrypt) /* {{{ */
static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
{
- php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
- php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
+ php_stream_filter_unregister_factory("mcrypt.*");
+ php_stream_filter_unregister_factory("mdecrypt.*");
UNREGISTER_INI_ENTRIES();
return SUCCESS;
@@ -513,7 +513,7 @@ PHP_FUNCTION(mcrypt_module_open)
MCRYPT td;
php_mcrypt *pm;
- if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ssss",
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "ssss",
&cipher, &cipher_len, &cipher_dir, &cipher_dir_len,
&mode, &mode_len, &mode_dir, &mode_dir_len)) {
return;
@@ -527,7 +527,7 @@ PHP_FUNCTION(mcrypt_module_open)
);
if (td == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module");
+ php_error_docref(NULL, E_WARNING, "Could not open encryption module");
RETURN_FALSE;
} else {
pm = emalloc(sizeof(php_mcrypt));
@@ -550,7 +550,7 @@ PHP_FUNCTION(mcrypt_generic_init)
php_mcrypt *pm;
int result = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &mcryptind, &key, &key_len, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &mcryptind, &key, &key_len, &iv, &iv_len) == FAILURE) {
return;
}
@@ -560,7 +560,7 @@ PHP_FUNCTION(mcrypt_generic_init)
iv_size = mcrypt_enc_get_iv_size(pm->td);
if (key_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size is 0");
+ php_error_docref(NULL, E_WARNING, "Key size is 0");
}
key_s = emalloc(key_len);
@@ -570,7 +570,7 @@ PHP_FUNCTION(mcrypt_generic_init)
memset(iv_s, 0, iv_size + 1);
if (key_len > max_key_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size);
+ php_error_docref(NULL, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size);
key_size = max_key_size;
} else {
key_size = (int)key_len;
@@ -578,7 +578,7 @@ PHP_FUNCTION(mcrypt_generic_init)
memcpy(key_s, key, key_len);
if (iv_len != iv_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", iv_len, iv_size);
+ php_error_docref(NULL, E_WARNING, "Iv size incorrect; supplied length: %d, needed: %d", iv_len, iv_size);
if (iv_len > iv_size) {
iv_len = iv_size;
}
@@ -594,14 +594,14 @@ PHP_FUNCTION(mcrypt_generic_init)
zend_list_close(Z_RES_P(mcryptind));
switch (result) {
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect");
+ php_error_docref(NULL, E_WARNING, "Key length incorrect");
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation error");
+ php_error_docref(NULL, E_WARNING, "Memory allocation error");
break;
case -1:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
break;
}
} else {
@@ -625,7 +625,7 @@ PHP_FUNCTION(mcrypt_generic)
char* data_s;
int block_size, data_size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &mcryptind, &data, &data_len) == FAILURE) {
return;
}
@@ -633,7 +633,7 @@ PHP_FUNCTION(mcrypt_generic)
PHP_MCRYPT_INIT_CHECK
if (data_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ php_error_docref(NULL, E_WARNING, "An empty string was passed");
RETURN_FALSE
}
@@ -670,7 +670,7 @@ PHP_FUNCTION(mdecrypt_generic)
char* data_s;
int block_size, data_size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &mcryptind, &data, &data_len) == FAILURE) {
return;
}
@@ -678,7 +678,7 @@ PHP_FUNCTION(mdecrypt_generic)
PHP_MCRYPT_INIT_CHECK
if (data_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An empty string was passed");
+ php_error_docref(NULL, E_WARNING, "An empty string was passed");
RETURN_FALSE
}
@@ -749,7 +749,7 @@ PHP_FUNCTION(mcrypt_generic_deinit)
MCRYPT_GET_TD_ARG
if (mcrypt_generic_deinit(pm->td) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not terminate encryption specifier");
+ php_error_docref(NULL, E_WARNING, "Could not terminate encryption specifier");
RETURN_FALSE
}
pm->init = 0;
@@ -956,7 +956,7 @@ PHP_FUNCTION(mcrypt_list_algorithms)
size_t lib_dir_len;
int i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&lib_dir, &lib_dir_len) == FAILURE) {
return;
}
@@ -965,7 +965,7 @@ PHP_FUNCTION(mcrypt_list_algorithms)
modules = mcrypt_list_algorithms(lib_dir, &count);
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No algorithms found in module dir");
+ php_error_docref(NULL, E_WARNING, "No algorithms found in module dir");
}
for (i = 0; i < count; i++) {
add_index_string(return_value, i, modules[i]);
@@ -983,7 +983,7 @@ PHP_FUNCTION(mcrypt_list_modes)
size_t lib_dir_len;
int i, count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&lib_dir, &lib_dir_len) == FAILURE) {
return;
}
@@ -992,7 +992,7 @@ PHP_FUNCTION(mcrypt_list_modes)
modules = mcrypt_list_modes(lib_dir, &count);
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No modes found in module dir");
+ php_error_docref(NULL, E_WARNING, "No modes found in module dir");
}
for (i = 0; i < count; i++) {
add_index_string(return_value, i, modules[i]);
@@ -1014,7 +1014,7 @@ PHP_FUNCTION(mcrypt_get_key_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1024,7 +1024,7 @@ PHP_FUNCTION(mcrypt_get_key_size)
RETVAL_LONG(mcrypt_enc_get_key_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1043,7 +1043,7 @@ PHP_FUNCTION(mcrypt_get_block_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1053,7 +1053,7 @@ PHP_FUNCTION(mcrypt_get_block_size)
RETVAL_LONG(mcrypt_enc_get_block_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1072,7 +1072,7 @@ PHP_FUNCTION(mcrypt_get_iv_size)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&cipher, &cipher_len, &module, &module_len) == FAILURE) {
return;
}
@@ -1082,7 +1082,7 @@ PHP_FUNCTION(mcrypt_get_iv_size)
RETVAL_LONG(mcrypt_enc_get_iv_size(td));
mcrypt_module_close(td);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1101,7 +1101,7 @@ PHP_FUNCTION(mcrypt_get_cipher_name)
MCRYPT_GET_INI
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&cipher, &cipher_len) == FAILURE) {
return;
}
@@ -1122,7 +1122,7 @@ PHP_FUNCTION(mcrypt_get_cipher_name)
RETVAL_STRING(cipher_name);
mcrypt_free(cipher_name);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
}
@@ -1190,7 +1190,7 @@ static zend_bool php_mcrypt_is_valid_key_size(
}
/* }}} */
-static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /* {{{ */
+static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size) /* {{{ */
{
int key_size_count;
int max_key_size = mcrypt_enc_get_key_size(td);
@@ -1203,7 +1203,7 @@ static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /
char *key_size_str = php_mcrypt_get_key_size_str(
max_key_size, key_sizes, key_size_count
);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Key of size %d not supported by this algorithm. %s", key_size, key_size_str
);
efree(key_size_str);
@@ -1217,20 +1217,20 @@ static int php_mcrypt_ensure_valid_key_size(MCRYPT td, int key_size TSRMLS_DC) /
}
/* }}} */
-static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSRMLS_DC) /* {{{ */
+static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size) /* {{{ */
{
if (mcrypt_enc_mode_has_iv(td) == 1) {
int expected_iv_size = mcrypt_enc_get_iv_size(td);
if (!iv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Encryption mode requires an initialization vector of size %d", expected_iv_size
);
return FAILURE;
}
if (iv_size != expected_iv_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Received initialization vector of size %d, but size %d is required "
"for this encryption mode", iv_size, expected_iv_size
);
@@ -1242,7 +1242,7 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSR
}
/* }}} */
-static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
+static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value) /* {{{ */
{
char *cipher_dir_string;
char *module_dir_string;
@@ -1254,16 +1254,16 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, c
td = mcrypt_module_open(cipher, cipher_dir_string, mode, module_dir_string);
if (td == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
+ php_error_docref(NULL, E_WARNING, MCRYPT_OPEN_MODULE_FAILED);
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_key_size(td, (int)key_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_key_size(td, (int)key_len) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
@@ -1282,7 +1282,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, c
}
if (mcrypt_generic_init(td, (void *) key, (int)key_len, (void *) iv) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
mcrypt_module_close(td);
RETURN_FALSE;
}
@@ -1310,12 +1310,12 @@ PHP_FUNCTION(mcrypt_encrypt)
char *cipher, *key, *data, *mode, *iv = NULL;
size_t cipher_len, key_len, data_len, mode_len, iv_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssss|s", &cipher, &cipher_len,
&key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) {
return;
}
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_ENCRYPT, return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_ENCRYPT, return_value);
}
/* }}} */
@@ -1326,12 +1326,12 @@ PHP_FUNCTION(mcrypt_decrypt)
char *cipher, *key, *data, *mode, *iv = NULL;
size_t cipher_len, key_len, data_len, mode_len, iv_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss|s", &cipher, &cipher_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssss|s", &cipher, &cipher_len,
&key, &key_len, &data, &data_len, &mode, &mode_len, &iv, &iv_len) == FAILURE) {
return;
}
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_DECRYPT, return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, mode, iv, iv_len, MCRYPT_DECRYPT, return_value);
}
/* }}} */
@@ -1347,7 +1347,7 @@ PHP_FUNCTION(mcrypt_ecb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1363,7 +1363,7 @@ PHP_FUNCTION(mcrypt_cbc)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1379,7 +1379,7 @@ PHP_FUNCTION(mcrypt_cfb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1395,7 +1395,7 @@ PHP_FUNCTION(mcrypt_ofb)
convert_to_long_ex(mode);
- php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
+ php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value);
}
/* }}} */
@@ -1408,12 +1408,12 @@ PHP_FUNCTION(mcrypt_create_iv)
zend_long size;
int n = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &size, &source) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &size, &source) == FAILURE) {
return;
}
if (size <= 0 || size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create an IV with a size of less than 1 or greater than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Cannot create an IV with a size of less than 1 or greater than %d", INT_MAX);
RETURN_FALSE;
}
@@ -1425,7 +1425,7 @@ PHP_FUNCTION(mcrypt_create_iv)
BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
+ php_error_docref(NULL, E_WARNING, "Could not gather sufficient random data");
RETURN_FALSE;
}
n = (int)size;
@@ -1436,7 +1436,7 @@ PHP_FUNCTION(mcrypt_create_iv)
fd = open(source == RANDOM ? "/dev/random" : "/dev/urandom", O_RDONLY);
if (fd < 0) {
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open source device");
+ php_error_docref(NULL, E_WARNING, "Cannot open source device");
RETURN_FALSE;
}
while (read_bytes < size) {
@@ -1450,14 +1450,14 @@ PHP_FUNCTION(mcrypt_create_iv)
close(fd);
if (n < size) {
efree(iv);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
+ php_error_docref(NULL, E_WARNING, "Could not gather sufficient random data");
RETURN_FALSE;
}
#endif
} else {
n = (int)size;
while (size) {
- iv[--size] = (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX);
+ iv[--size] = (char) (255.0 * php_rand() / RAND_MAX);
}
}
RETVAL_STRINGL(iv, n);
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index c36e9494e3..ed3aba22cc 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -39,7 +39,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
size_t *bytes_consumed,
- int flags TSRMLS_DC)
+ int flags)
{
php_mcrypt_filter_data *data;
php_stream_bucket *bucket;
@@ -80,22 +80,22 @@ static php_stream_filter_status_t php_mcrypt_filter(
data->block_used = chunklen - n;
memcpy(data->block_buffer, outchunk + n, data->block_used);
- newbucket = php_stream_bucket_new(stream, outchunk, n, 1, data->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, newbucket TSRMLS_CC);
+ newbucket = php_stream_bucket_new(stream, outchunk, n, 1, data->persistent);
+ php_stream_bucket_append(buckets_out, newbucket);
exit_status = PSFS_PASS_ON;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
} else {
/* Stream cipher */
- php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ php_stream_bucket_make_writeable(bucket);
if (data->encrypt) {
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
mdecrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
}
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
exit_status = PSFS_PASS_ON;
}
@@ -111,8 +111,8 @@ static php_stream_filter_status_t php_mcrypt_filter(
mdecrypt_generic(data->module, data->block_buffer, data->blocksize);
}
- newbucket = php_stream_bucket_new(stream, data->block_buffer, data->blocksize, 0, data->persistent TSRMLS_CC);
- php_stream_bucket_append(buckets_out, newbucket TSRMLS_CC);
+ newbucket = php_stream_bucket_new(stream, data->block_buffer, data->blocksize, 0, data->persistent);
+ php_stream_bucket_append(buckets_out, newbucket);
exit_status = PSFS_PASS_ON;
}
@@ -124,7 +124,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
return exit_status;
}
-static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_mcrypt_filter_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_mcrypt_filter_data *data = (php_mcrypt_filter_data*) Z_PTR(thisfilter->abstract);
@@ -149,7 +149,7 @@ static php_stream_filter_ops php_mcrypt_filter_ops = {
/* {{{ php_mcrypt_filter_create
* Instantiate mcrypt filter
*/
-static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval *filterparams, int persistent)
{
int encrypt = 1, iv_len, key_len, keyl, result;
const char *cipher = filtername + sizeof("mcrypt.") - 1;
@@ -170,7 +170,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
}
if (!filterparams || Z_TYPE_P(filterparams) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter parameters for %s must be an array", filtername);
+ php_error_docref(NULL, E_WARNING, "Filter parameters for %s must be an array", filtername);
return NULL;
}
@@ -178,7 +178,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mode is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "mode is not a string, ignoring");
}
}
@@ -186,7 +186,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
algo_dir = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "algorithms_dir is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "algorithms_dir is not a string, ignoring");
}
}
@@ -194,7 +194,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (Z_TYPE_P(tmpzval) == IS_STRING) {
mode_dir = Z_STRVAL_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "modes_dir is not a string, ignoring");
+ php_error_docref(NULL, E_WARNING, "modes_dir is not a string, ignoring");
}
}
@@ -203,13 +203,13 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
key = Z_STRVAL_P(tmpzval);
key_len = (int)Z_STRLEN_P(tmpzval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key not specified or is not a string");
+ php_error_docref(NULL, E_WARNING, "key not specified or is not a string");
return NULL;
}
mcrypt_module = mcrypt_module_open((char *)cipher, algo_dir, mode, mode_dir);
if (mcrypt_module == MCRYPT_FAILED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module");
+ php_error_docref(NULL, E_WARNING, "Could not open encryption module");
return NULL;
}
iv_len = mcrypt_enc_get_iv_size(mcrypt_module);
@@ -220,7 +220,7 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (!(tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("iv"))) ||
Z_TYPE_P(tmpzval) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter parameter[iv] not provided or not of type: string");
+ php_error_docref(NULL, E_WARNING, "Filter parameter[iv] not provided or not of type: string");
mcrypt_module_close(mcrypt_module);
return NULL;
}
@@ -238,14 +238,14 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if (result < 0) {
switch (result) {
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key length incorrect");
+ php_error_docref(NULL, E_WARNING, "Key length incorrect");
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation error");
+ php_error_docref(NULL, E_WARNING, "Memory allocation error");
break;
case -1:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
break;
}
mcrypt_module_close(mcrypt_module);
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 1ba77ca8c4..f4dee9a0f1 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -42,8 +42,8 @@
static int le_result, le_link, le_plink, le_statement;
-static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC);
-static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC);
+static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type);
+static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type);
static void _mssql_bind_hash_dtor(void *data);
@@ -210,14 +210,13 @@ zend_module_entry mssql_module_entry =
ZEND_GET_MODULE(mssql)
#endif
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
/* {{{ PHP_INI_DISP
*/
static PHP_INI_DISP(display_text_size)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
@@ -266,10 +265,9 @@ PHP_INI_END()
/* error handler */
static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)
{
- TSRMLS_FETCH();
if (severity >= MS_SQL_G(min_error_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (severity %d)", dberrstr, severity);
+ php_error_docref(NULL, E_WARNING, "%s (severity %d)", dberrstr, severity);
}
return INT_CANCEL;
}
@@ -279,10 +277,9 @@ static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, i
/* message handler */
static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate, int severity,char *msgtext,char *srvname, char *procname,DBUSMALLINT line)
{
- TSRMLS_FETCH();
if (severity >= MS_SQL_G(min_message_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "message: %s (severity %d)", msgtext, severity);
+ php_error_docref(NULL, E_WARNING, "message: %s (severity %d)", msgtext, severity);
}
if (MS_SQL_G(server_message)) {
zend_string_free(MS_SQL_G(server_message));
@@ -295,7 +292,7 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate
/* {{{ _clean_invalid_results
*/
-static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC)
+static int _clean_invalid_results(zend_rsrc_list_entry *le)
{
if (Z_TYPE_P(le) == le_result) {
mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr;
@@ -340,7 +337,7 @@ static void _free_result(mssql_result *result, int free_fields)
/* {{{ _free_mssql_statement
*/
-static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_mssql_statement(zend_rsrc_list_entry *rsrc)
{
mssql_statement *statement = (mssql_statement *)rsrc->ptr;
@@ -355,7 +352,7 @@ static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ _free_mssql_result
*/
-static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_mssql_result(zend_rsrc_list_entry *rsrc)
{
mssql_result *result = (mssql_result *)rsrc->ptr;
@@ -367,7 +364,7 @@ static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ php_mssql_set_defaullt_link
*/
-static void php_mssql_set_default_link(int id TSRMLS_DC)
+static void php_mssql_set_default_link(int id)
{
if (MS_SQL_G(default_link)!=-1) {
zend_list_delete(MS_SQL_G(default_link));
@@ -379,12 +376,12 @@ static void php_mssql_set_default_link(int id TSRMLS_DC)
/* {{{ _close_mssql_link
*/
-static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_mssql_link(zend_rsrc_list_entry *rsrc)
{
mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr;
mssql_ptr->valid = 0;
- zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC);
+ zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results);
dbclose(mssql_ptr->link);
dbfreelogin(mssql_ptr->login);
efree(mssql_ptr);
@@ -394,7 +391,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* {{{ _close_mssql_plink
*/
-static void _close_mssql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_mssql_plink(zend_rsrc_list_entry *rsrc)
{
mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr;
@@ -551,7 +548,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
mssql_link mssql, *mssql_ptr;
char buffer[40];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) {
return;
}
@@ -587,7 +584,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (hashed_details == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory");
+ php_error_docref(NULL, E_WARNING, "Out of memory");
RETURN_FALSE;
}
@@ -596,7 +593,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* set a DBLOGIN record */
if ((mssql.login = dblogin()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate login record");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate login record");
RETURN_FALSE;
}
@@ -644,20 +641,20 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_rsrc_list_entry new_le;
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
/* create the link */
if ((mssql.link = dbopen(mssql.login, host)) == FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -714,7 +711,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server);
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!");
+ php_error_docref(NULL, E_WARNING, "Hashed persistent link is not a MS SQL link!");
efree(hashed_details);
RETURN_FALSE;
}
@@ -730,7 +727,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#if BROKEN_MSSQL_PCONNECTS
log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server);
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING, "Link to server lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
efree(hashed_details);
dbfreelogin(mssql_ptr->login);
@@ -774,7 +771,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ptr && (type==le_link || type==le_plink)) {
zend_list_addref(link);
Z_LVAL_P(return_value) = link;
- php_mssql_set_default_link(link TSRMLS_CC);
+ php_mssql_set_default_link(link);
Z_TYPE_P(return_value) = IS_RESOURCE;
dbfreelogin(mssql.login);
efree(hashed_details);
@@ -784,14 +781,14 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
}
if ((mssql.link=dbopen(mssql.login, host))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host));
efree(hashed_details);
dbfreelogin(mssql.login);
RETURN_FALSE;
@@ -837,7 +834,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
MS_SQL_G(num_links)++;
}
efree(hashed_details);
- php_mssql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
+ php_mssql_set_default_link(Z_LVAL_P(return_value));
}
/* }}} */
@@ -877,7 +874,7 @@ PHP_FUNCTION(mssql_close)
int id = -1;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mssql_link_index) == FAILURE) {
return;
}
@@ -908,7 +905,7 @@ PHP_FUNCTION(mssql_select_db)
int id = -1;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mssql_link_index) == FAILURE) {
return;
}
@@ -920,7 +917,7 @@ PHP_FUNCTION(mssql_select_db)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbuse(mssql_ptr->link, db)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to select database: %s", db);
+ php_error_docref(NULL, E_WARNING, "Unable to select database: %s", db);
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -930,7 +927,7 @@ PHP_FUNCTION(mssql_select_db)
/* {{{ php_mssql_get_column_content_with_type
*/
-static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
+static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type )
{
if (dbdata(mssql_ptr->link,offset) == NULL && dbdatlen(mssql_ptr->link,offset) == 0) {
ZVAL_NULL(result);
@@ -1047,7 +1044,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
ZVAL_STRINGL(result, res_buf, res_length, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
+ php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
ZVAL_FALSE(result);
}
}
@@ -1057,7 +1054,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
/* {{{ php_mssql_get_column_content_without_type
*/
-static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
+static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type)
{
if (dbdatlen(mssql_ptr->link,offset) == 0) {
ZVAL_NULL(result);
@@ -1127,7 +1124,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
ZVAL_STRINGL(result, res_buf, res_length, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
+ php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
ZVAL_FALSE(result);
}
}
@@ -1135,7 +1132,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
/* {{{ _mssql_get_sp_result
*/
-static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement TSRMLS_DC)
+static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement)
{
int i, num_rets, type;
char *parameter;
@@ -1187,7 +1184,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
}
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An output parameter variable was not provided");
+ php_error_docref(NULL, E_WARNING, "An output parameter variable was not provided");
}
}
}
@@ -1199,7 +1196,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL");
+ php_error_docref(NULL, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL");
}
}
}
@@ -1208,7 +1205,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme
/* {{{ _mssql_fetch_batch
*/
-static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC)
+static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue)
{
int i, j = 0;
char computed_buf[16];
@@ -1274,7 +1271,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0);
for (j=0; j<result->num_fields; j++) {
INIT_ZVAL(result->data[i][j]);
- MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type TSRMLS_CC));
+ MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type));
}
if (i<result->batchsize || result->batchsize==0) {
i++;
@@ -1286,7 +1283,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r
result->lastresult = retvalue;
}
if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) {
- _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, result->statement);
}
return i;
}
@@ -1300,7 +1297,7 @@ PHP_FUNCTION(mssql_fetch_batch)
mssql_result *result;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1313,7 +1310,7 @@ PHP_FUNCTION(mssql_fetch_batch)
mssql_ptr = result->mssql_ptr;
_free_result(result, 0);
result->cur_row=result->num_rows=0;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult);
RETURN_LONG(result->num_rows);
}
@@ -1334,7 +1331,7 @@ PHP_FUNCTION(mssql_query)
dbsettime(MS_SQL_G(timeout));
batchsize = MS_SQL_G(batchsize);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) {
return;
}
@@ -1351,11 +1348,11 @@ PHP_FUNCTION(mssql_query)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbcmd(mssql_ptr->link, query)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query");
+ php_error_docref(NULL, E_WARNING, "Unable to set query");
RETURN_FALSE;
}
if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue = dbresults(mssql_ptr->link))==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
+ php_error_docref(NULL, E_WARNING, "Query failed");
dbcancel(mssql_ptr->link);
RETURN_FALSE;
}
@@ -1388,7 +1385,7 @@ PHP_FUNCTION(mssql_query)
result->have_fields = 0;
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
}
@@ -1401,7 +1398,7 @@ PHP_FUNCTION(mssql_rows_affected)
zval *mssql_link_index;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_link_index) == FAILURE) {
return;
}
@@ -1419,7 +1416,7 @@ PHP_FUNCTION(mssql_free_result)
mssql_result *result;
int retvalue;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1462,7 +1459,7 @@ PHP_FUNCTION(mssql_num_rows)
zval *mssql_result_index;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1479,7 +1476,7 @@ PHP_FUNCTION(mssql_num_fields)
zval *mssql_result_index;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1501,12 +1498,12 @@ static void php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
switch (result_type) {
case MSSQL_NUM:
case MSSQL_ASSOC:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
break;
case MSSQL_BOTH:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &resulttype) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &resulttype) == FAILURE) {
return;
}
result_type = (resulttype > 0 && (resulttype & MSSQL_BOTH)) ? resulttype : result_type;
@@ -1615,14 +1612,14 @@ PHP_FUNCTION(mssql_data_seek)
long offset;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (offset < 0 || offset >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset");
+ php_error_docref(NULL, E_WARNING, "Bad row offset");
RETURN_FALSE;
}
@@ -1698,7 +1695,7 @@ PHP_FUNCTION(mssql_fetch_field)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1711,7 +1708,7 @@ PHP_FUNCTION(mssql_fetch_field)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1734,7 +1731,7 @@ PHP_FUNCTION(mssql_field_length)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1747,7 +1744,7 @@ PHP_FUNCTION(mssql_field_length)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1764,7 +1761,7 @@ PHP_FUNCTION(mssql_field_name)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1777,7 +1774,7 @@ PHP_FUNCTION(mssql_field_name)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1794,7 +1791,7 @@ PHP_FUNCTION(mssql_field_type)
long field_offset = -1;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
@@ -1807,7 +1804,7 @@ PHP_FUNCTION(mssql_field_type)
if (field_offset<0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
}
RETURN_FALSE;
}
@@ -1824,14 +1821,14 @@ PHP_FUNCTION(mssql_field_seek)
long field_offset;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (field_offset<0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Bad column offset");
RETURN_FALSE;
}
@@ -1849,14 +1846,14 @@ PHP_FUNCTION(mssql_result)
int field_offset=0;
mssql_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &mssql_result_index, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlZ", &mssql_result_index, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result);
if (row < 0 || row >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset (%ld)", row);
+ php_error_docref(NULL, E_WARNING, "Bad row offset (%ld)", row);
RETURN_FALSE;
}
@@ -1871,7 +1868,7 @@ PHP_FUNCTION(mssql_result)
}
}
if (i>=result->num_fields) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field));
+ php_error_docref(NULL, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field));
RETURN_FALSE;
}
break;
@@ -1880,7 +1877,7 @@ PHP_FUNCTION(mssql_result)
convert_to_long_ex(field);
field_offset = Z_LVAL_PP(field);
if (field_offset<0 || field_offset>=result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -1900,7 +1897,7 @@ PHP_FUNCTION(mssql_next_result)
mssql_result *result;
mssql_link *mssql_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) {
return;
}
@@ -1918,7 +1915,7 @@ PHP_FUNCTION(mssql_next_result)
}
else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) {
if (result->statement) {
- _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, result->statement);
}
RETURN_FALSE;
}
@@ -1931,7 +1928,7 @@ PHP_FUNCTION(mssql_next_result)
result->num_fields = dbnumcols(mssql_ptr->link);
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0);
result->have_fields = 0;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
RETURN_TRUE;
}
@@ -1945,7 +1942,7 @@ PHP_FUNCTION(mssql_min_error_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -1960,7 +1957,7 @@ PHP_FUNCTION(mssql_min_message_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -1979,7 +1976,7 @@ PHP_FUNCTION(mssql_init)
mssql_statement *statement;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) {
return;
}
@@ -1991,7 +1988,7 @@ PHP_FUNCTION(mssql_init)
ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink);
if (dbrpcinit(mssql_ptr->link, sp_name,0)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to init stored procedure");
+ php_error_docref(NULL, E_WARNING, "unable to init stored procedure");
RETURN_FALSE;
}
@@ -2000,7 +1997,7 @@ PHP_FUNCTION(mssql_init)
statement->link = mssql_ptr;
statement->executed=FALSE;
- statement->id = zend_list_insert(statement,le_statement TSRMLS_CC);
+ statement->id = zend_list_insert(statement,le_statement);
RETURN_RESOURCE(statement->id);
}
@@ -2021,7 +2018,7 @@ PHP_FUNCTION(mssql_bind)
mssql_bind bind,*bindp;
LPBYTE value = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZl|bbl", &stmt, &param_name, &param_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsZl|bbl", &stmt, &param_name, &param_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) {
return;
}
@@ -2072,7 +2069,7 @@ PHP_FUNCTION(mssql_bind)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported type");
+ php_error_docref(NULL, E_WARNING, "unsupported type");
RETURN_FALSE;
break;
}
@@ -2101,7 +2098,7 @@ PHP_FUNCTION(mssql_bind)
/* no call to dbrpcparam if RETVAL */
if ( strcmp("RETVAL", param_name)!=0 ) {
if (dbrpcparam(mssql_ptr->link, param_name, (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter");
+ php_error_docref(NULL, E_WARNING, "Unable to set parameter");
RETURN_FALSE;
}
}
@@ -2127,7 +2124,7 @@ PHP_FUNCTION(mssql_execute)
batchsize = MS_SQL_G(batchsize);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &stmt, &skip_results) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &stmt, &skip_results) == FAILURE) {
return;
}
@@ -2137,7 +2134,7 @@ PHP_FUNCTION(mssql_execute)
exec_retval = dbrpcexec(mssql_ptr->link);
if (exec_retval == FAIL || dbsqlok(mssql_ptr->link) == FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed");
+ php_error_docref(NULL, E_WARNING, "stored procedure execution failed");
if (exec_retval == FAIL) {
dbcancel(mssql_ptr->link);
@@ -2149,7 +2146,7 @@ PHP_FUNCTION(mssql_execute)
retval_results=dbresults(mssql_ptr->link);
if (retval_results==FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results");
+ php_error_docref(NULL, E_WARNING, "could not retrieve results");
dbcancel(mssql_ptr->link);
RETURN_FALSE;
}
@@ -2183,12 +2180,12 @@ PHP_FUNCTION(mssql_execute)
result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), num_fields, 0);
result->statement = statement;
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
+ result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue);
}
}
}
if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) {
- _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
+ _mssql_get_sp_result(mssql_ptr, statement);
}
if (result==NULL) {
@@ -2208,7 +2205,7 @@ PHP_FUNCTION(mssql_free_statement)
mssql_statement *statement;
int retvalue;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_statement_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_statement_index) == FAILURE) {
return;
}
@@ -2238,7 +2235,7 @@ PHP_FUNCTION(mssql_guid_string)
char buffer[32+1];
char buffer2[36+1];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &binary, &binary_len, &sf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &binary, &binary_len, &sf) == FAILURE) {
return;
}
diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h
index b0313a160a..f0f793ed03 100644
--- a/ext/mssql/php_mssql.h
+++ b/ext/mssql/php_mssql.h
@@ -167,7 +167,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mssql)
long cfg_min_error_severity, cfg_min_message_severity;
long connect_timeout, timeout;
zend_bool compatibility_mode;
- void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type TSRMLS_DC);
+ void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type );
long textsize, textlimit, batchsize;
zend_bool datetimeconvert;
HashTable *resource_list, *resource_plist;
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 384ce9a6ba..af5743c124 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -360,7 +360,7 @@ ZEND_GET_MODULE(mysql)
void timeout(int sig);
-#define CHECK_LINK(link) { if (link == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link == NULL) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } }
#if defined(MYSQL_USE_MYSQLND)
#define PHPMY_UNBUFFERED_QUERY_CHECK() \
@@ -373,7 +373,7 @@ void timeout(int sig);
mysql->active_result_res->type == le_result) { \
if (mysql_result_is_unbuffered(_mysql_result) && \
!mysql_eof(_mysql_result)) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Function called without first fetching all " \
"rows from a previous unbuffered query"); \
} \
@@ -393,7 +393,7 @@ void timeout(int sig);
if (mysql_result && \
mysql->active_result_res->type == le_result) { \
if (!mysql_eof(mysql_result)) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Function called without first fetching " \
"all rows from a previous unbuffered query"); \
while (mysql_fetch_row(mysql_result)); \
@@ -410,7 +410,7 @@ void timeout(int sig);
* This wrapper is required since mysql_free_result() returns an integer, and
* thus, cannot be used directly
*/
-static void _free_mysql_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_mysql_result(zend_resource *rsrc)
{
MYSQL_RES *mysql_result = (MYSQL_RES *)rsrc->ptr;
@@ -421,7 +421,7 @@ static void _free_mysql_result(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_mysql_set_default_link
*/
-static void php_mysql_set_default_link(zend_resource *link TSRMLS_DC)
+static void php_mysql_set_default_link(zend_resource *link)
{
if (MySG(default_link) != NULL) {
zend_list_delete(MySG(default_link));
@@ -433,7 +433,7 @@ static void php_mysql_set_default_link(zend_resource *link TSRMLS_DC)
/* {{{ php_mysql_select_db
*/
-static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC)
+static int php_mysql_select_db(php_mysql_conn *mysql, char *db)
{
PHPMY_UNBUFFERED_QUERY_CHECK();
@@ -447,7 +447,7 @@ static int php_mysql_select_db(php_mysql_conn *mysql, char *db TSRMLS_DC)
/* {{{ _close_mysql_link
*/
-static void _close_mysql_link(zend_resource *rsrc TSRMLS_DC)
+static void _close_mysql_link(zend_resource *rsrc)
{
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
void (*handler)(int);
@@ -462,7 +462,7 @@ static void _close_mysql_link(zend_resource *rsrc TSRMLS_DC)
/* {{{ _close_mysql_plink
*/
-static void _close_mysql_plink(zend_resource *rsrc TSRMLS_DC)
+static void _close_mysql_plink(zend_resource *rsrc)
{
php_mysql_conn *link = (php_mysql_conn *)rsrc->ptr;
void (*handler) (int);
@@ -534,7 +534,7 @@ static PHP_GINIT_FUNCTION(mysql)
#ifdef MYSQL_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv TSRMLS_DC)
+static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv)
{
php_mysql_conn *mysql;
@@ -543,7 +543,7 @@ static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv TSRMLS_DC)
return NULL;
}
- mysql = zend_fetch_resource(zv TSRMLS_CC, -1, "MySQL-Link", NULL, 2, le_link, le_plink);
+ mysql = zend_fetch_resource(zv, -1, "MySQL-Link", NULL, 2, le_link, le_plink);
if (!mysql) {
return NULL;
@@ -587,7 +587,7 @@ ZEND_MODULE_STARTUP_D(mysql)
#endif
#ifdef MYSQL_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&mysql_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&mysql_reverse_api);
#endif
return SUCCESS;
@@ -641,7 +641,7 @@ PHP_RINIT_FUNCTION(mysql)
/* }}} */
#if defined(A0) && defined(MYSQL_USE_MYSQLND)
-static int php_mysql_persistent_helper(zval *el TSRMLS_DC)
+static int php_mysql_persistent_helper(zval *el)
{
zend_resource *le = (zend_resource *)Z_PTR_P(el);
if (le->type == le_plink) {
@@ -662,7 +662,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
if (MySG(trace_mode)) {
if (MySG(result_allocated)){
- php_error_docref("function.mysql-free-result" TSRMLS_CC, E_WARNING, "%pu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated));
+ php_error_docref("function.mysql-free-result", E_WARNING, "%pu result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query()", MySG(result_allocated));
}
}
@@ -671,7 +671,7 @@ PHP_RSHUTDOWN_FUNCTION(mysql)
}
#if defined(A0) && defined(MYSQL_USE_MYSQLND)
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysql_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysql_persistent_helper);
#endif
return SUCCESS;
@@ -736,13 +736,13 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_string *hashed_details = NULL;
zend_bool free_host = 0, new_link = 0;
- php_error_docref(NULL TSRMLS_CC,
+ php_error_docref(NULL,
E_DEPRECATED,
"The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead");
#if !defined(MYSQL_USE_MYSQLND)
if ((MYSQL_VERSION_ID / 100) != (mysql_get_client_version() / 100)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Headers and client library minor version mismatch. Headers:%d Library:%ld",
MYSQL_VERSION_ID, mysql_get_client_version());
}
@@ -771,22 +771,22 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (PG(sql_safe_mode)) {
if (ZEND_NUM_ARGS()>0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
+ php_error_docref(NULL, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
}
- user = php_get_current_user(TSRMLS_C);
+ user = php_get_current_user();
hashed_details = zend_string_alloc(sizeof("mysql___") + strlen(user) - 1, 0);
snprintf(hashed_details->val, hashed_details->len + 1, "mysql__%s_", user);
client_flags = CLIENT_INTERACTIVE;
} else {
/* mysql_pconnect does not support new_link parameter */
if (persistent) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!l", &host_and_port, &host_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!l", &host_and_port, &host_len,
&user, &user_len, &passwd, &passwd_len,
&client_flags)==FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!bl", &host_and_port, &host_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!bl", &host_and_port, &host_len,
&user, &user_len, &passwd, &passwd_len,
&new_link, &client_flags)==FAILURE) {
return;
@@ -862,20 +862,20 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zval new_le;
if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MySG(num_links));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
if (MySG(max_persistent) != -1 && MySG(num_persistent) >= MySG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%pd)", MySG(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%pd)", MySG(num_persistent));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
/* create the link */
mysql = (php_mysql_conn *)malloc(sizeof(php_mysql_conn));
if (!mysql) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR,
+ php_error_docref(NULL, E_ERROR,
"Out of memory while allocating memory for a persistent link");
}
mysql->active_result_res = NULL;
@@ -897,7 +897,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Populate connect error globals so that the error functions can read them */
@@ -906,7 +906,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
MySG(connect_error) = estrdup(mysql_error(mysql->conn));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error));
+ php_error_docref(NULL, E_WARNING, "%s", MySG(connect_error));
#if defined(HAVE_MYSQL_ERRNO)
MySG(connect_errno) = mysql_errno(mysql->conn);
#endif
@@ -950,10 +950,10 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING, "Link to server lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), hashed_details);
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
@@ -987,7 +987,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (link && (link->type == le_link || link->type == le_plink)) {
GC_REFCOUNT(link)++;
ZVAL_RES(return_value, link);
- php_mysql_set_default_link(link TSRMLS_CC);
+ php_mysql_set_default_link(link);
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_CLEANUP();
return;
@@ -997,7 +997,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
if (MySG(max_links) != -1 && MySG(num_links) >= MySG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MySG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MySG(num_links));
zend_string_release(hashed_details);
MYSQL_DO_CONNECT_RETURN_FALSE();
}
@@ -1015,7 +1015,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
if (!mysql->conn) {
MySG(connect_error) = estrdup("OOM");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OOM");
+ php_error_docref(NULL, E_WARNING, "OOM");
zend_string_release(hashed_details);
efree(mysql);
MYSQL_DO_CONNECT_RETURN_FALSE();
@@ -1028,7 +1028,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#ifndef MYSQL_USE_MYSQLND
if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL)
#else
- if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ if (mysqlnd_connect(mysql->conn, host, user, passwd, passwd_len, NULL, 0, port, socket, client_flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Populate connect error globals so that the error functions can read them */
@@ -1036,7 +1036,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(MySG(connect_error));
}
MySG(connect_error) = estrdup(mysql_error(mysql->conn));
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", MySG(connect_error));
+ php_error_docref(NULL, E_WARNING, "%s", MySG(connect_error));
#if defined(HAVE_MYSQL_ERRNO)
MySG(connect_errno) = mysql_errno(mysql->conn);
#endif
@@ -1065,7 +1065,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
zend_string_release(hashed_details);
- php_mysql_set_default_link(Z_RES_P(return_value) TSRMLS_CC);
+ php_mysql_set_default_link(Z_RES_P(return_value));
MYSQL_DO_CONNECT_CLEANUP();
}
/* }}} */
@@ -1106,7 +1106,7 @@ PHP_FUNCTION(mysql_close)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1149,7 +1149,7 @@ PHP_FUNCTION(mysql_select_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1161,7 +1161,7 @@ PHP_FUNCTION(mysql_select_db)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (php_mysql_select_db(mysql, db)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1190,7 +1190,7 @@ PHP_FUNCTION(mysql_get_host_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1213,7 +1213,7 @@ PHP_FUNCTION(mysql_get_proto_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1236,7 +1236,7 @@ PHP_FUNCTION(mysql_get_server_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1260,7 +1260,7 @@ PHP_FUNCTION(mysql_info)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1287,7 +1287,7 @@ PHP_FUNCTION(mysql_thread_id)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1316,7 +1316,7 @@ PHP_FUNCTION(mysql_stat)
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1349,7 +1349,7 @@ PHP_FUNCTION(mysql_client_encoding)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1376,7 +1376,7 @@ PHP_FUNCTION(mysql_set_charset)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &csname, &csname_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &csname, &csname_len, &mysql_link) == FAILURE) {
return;
}
@@ -1408,7 +1408,7 @@ PHP_FUNCTION(mysql_create_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1439,7 +1439,7 @@ PHP_FUNCTION(mysql_drop_db)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1463,12 +1463,12 @@ PHP_FUNCTION(mysql_drop_db)
/* {{{ php_mysql_do_query_general
*/
-static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int query_len, char *db, int use_store, zval *return_value TSRMLS_DC)
+static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int query_len, char *db, int use_store, zval *return_value)
{
MYSQL_RES *mysql_result;
if (db) {
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
}
@@ -1488,16 +1488,16 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
mysql_real_query(mysql->conn, newquery, newql);
efree (newquery);
if (mysql_errno(mysql->conn)) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
RETURN_FALSE;
}
else {
mysql_result = mysql_use_result(mysql->conn);
while ((row = mysql_fetch_row(mysql_result))) {
if (!strcmp("ALL", row[1])) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "Your query requires a full tablescan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
} else if (!strcmp("INDEX", row[1])) {
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "Your query requires a full indexscan (table %s, %s rows affected). Use EXPLAIN to optimize your query.", row[0], row[6]);
}
}
mysql_free_result(mysql_result);
@@ -1512,7 +1512,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
/* check possible error */
if (MySG(trace_mode)){
if (mysql_errno(mysql->conn)){
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
}
}
RETURN_FALSE;
@@ -1522,7 +1522,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
/* check possible error */
if (MySG(trace_mode)){
if (mysql_errno(mysql->conn)){
- php_error_docref("http://www.mysql.com/doc" TSRMLS_CC, E_WARNING, "%s", mysql_error(mysql->conn));
+ php_error_docref("http://www.mysql.com/doc", E_WARNING, "%s", mysql_error(mysql->conn));
}
}
RETURN_FALSE;
@@ -1535,7 +1535,7 @@ static void php_mysql_do_query_general(php_mysql_conn *mysql, char *query, int q
}
if (!mysql_result) {
if (PHP_MYSQL_VALID_RESULT(mysql->conn)) { /* query should have returned rows */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save result set");
+ php_error_docref(NULL, E_WARNING, "Unable to save result set");
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -1559,7 +1559,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
zval *mysql_link = NULL;
php_mysql_conn *mysql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &query, &query_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &query, &query_len, &mysql_link) == FAILURE) {
return;
}
@@ -1571,7 +1571,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_mysql_do_query_general(mysql, query, query_len, NULL, use_store, return_value TSRMLS_CC);
+ php_mysql_do_query_general(mysql, query, query_len, NULL, use_store, return_value);
}
/* }}} */
@@ -1600,7 +1600,7 @@ PHP_FUNCTION(mysql_db_query)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &db, &db_len, &query, &query_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|r", &db, &db_len, &query, &query_len, &mysql_link) == FAILURE) {
return;
}
@@ -1612,9 +1612,9 @@ PHP_FUNCTION(mysql_db_query)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() instead");
+ php_error_docref(NULL, E_DEPRECATED, "This function is deprecated; use mysql_query() instead");
- php_mysql_do_query_general(mysql, query, query_len, db, MYSQL_STORE_RESULT, return_value TSRMLS_CC);
+ php_mysql_do_query_general(mysql, query, query_len, db, MYSQL_STORE_RESULT, return_value);
}
/* }}} */
@@ -1626,7 +1626,7 @@ PHP_FUNCTION(mysql_list_dbs)
MYSQL_RES *mysql_result;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1638,12 +1638,12 @@ PHP_FUNCTION(mysql_list_dbs)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() with SHOW DATABASES instead");
+ php_error_docref(NULL, E_DEPRECATED, "This function is deprecated; use mysql_query() with SHOW DATABASES instead");
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result = mysql_list_dbs(mysql->conn, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
@@ -1662,7 +1662,7 @@ PHP_FUNCTION(mysql_list_tables)
zval *mysql_link = NULL;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mysql_link) == FAILURE) {
return;
}
@@ -1674,14 +1674,14 @@ PHP_FUNCTION(mysql_list_tables)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result = mysql_list_tables(mysql->conn, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
MySG(result_allocated)++;
@@ -1699,7 +1699,7 @@ PHP_FUNCTION(mysql_list_fields)
php_mysql_conn *mysql;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|r", &db, &db_len, &table, &table_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|r", &db, &db_len, &table, &table_len, &mysql_link) == FAILURE) {
return;
}
@@ -1711,14 +1711,14 @@ PHP_FUNCTION(mysql_list_fields)
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
}
- if (!php_mysql_select_db(mysql, db TSRMLS_CC)) {
+ if (!php_mysql_select_db(mysql, db)) {
RETURN_FALSE;
}
PHPMY_UNBUFFERED_QUERY_CHECK();
if ((mysql_result=mysql_list_fields(mysql->conn, table, NULL))==NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
MySG(result_allocated)++;
@@ -1734,7 +1734,7 @@ PHP_FUNCTION(mysql_list_processes)
zval *mysql_link = NULL;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1750,7 +1750,7 @@ PHP_FUNCTION(mysql_list_processes)
mysql_result = mysql_list_processes(mysql->conn);
if (mysql_result == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result");
+ php_error_docref(NULL, E_WARNING, "Unable to save MySQL query result");
RETURN_FALSE;
}
@@ -1766,7 +1766,7 @@ PHP_FUNCTION(mysql_error)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1795,7 +1795,7 @@ PHP_FUNCTION(mysql_errno)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1824,7 +1824,7 @@ PHP_FUNCTION(mysql_affected_rows)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1849,7 +1849,7 @@ PHP_FUNCTION(mysql_escape_string)
size_t str_len;
zend_string *escaped_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -1860,7 +1860,7 @@ PHP_FUNCTION(mysql_escape_string)
escaped_str = zend_string_alloc(str_len * 2, 0);
escaped_str->len = mysql_escape_string(escaped_str->val, str, str_len);
- php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
+ php_error_docref("function.mysql-real-escape-string", E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
RETURN_STR(escaped_str);
}
/* }}} */
@@ -1875,7 +1875,7 @@ PHP_FUNCTION(mysql_real_escape_string)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &str, &str_len, &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &str, &str_len, &mysql_link) == FAILURE) {
return;
}
@@ -1905,7 +1905,7 @@ PHP_FUNCTION(mysql_insert_id)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link) == FAILURE) {
return;
}
@@ -1940,14 +1940,14 @@ johannes TODO:
Do 2 zend_parse_parameters calls instead of type "z" and switch below
Q: String or long first?
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z", &result, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (row < 0 || row >= (int)mysql_num_rows(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on MySQL result index %pd", row, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on MySQL result index %pd", row, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_data_seek(mysql_result, row);
@@ -1977,7 +1977,7 @@ Q: String or long first?
i++;
}
if (!tmp_field) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s%s%s not found in MySQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "%s%s%s not found in MySQL result index %pd",
(table_name?table_name:""), (table_name?".":""), field_name, Z_RES_P(result)->handle);
efree(field_name);
if (table_name) {
@@ -1995,7 +1995,7 @@ Q: String or long first?
convert_to_long_ex(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -2010,7 +2010,7 @@ Q: String or long first?
if (sql_row[field_offset]) {
#if PHP_API_VERSION < 20100412
if (PG(magic_quotes_runtime)) {
- RETVAL_STR(php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset], 0 TSRMLS_CC));
+ RETVAL_STR(php_addslashes(sql_row[field_offset], sql_row_lengths[field_offset], 0));
} else {
#endif
RETVAL_STRINGL(sql_row[field_offset], sql_row_lengths[field_offset]);
@@ -2033,7 +2033,7 @@ PHP_FUNCTION(mysql_num_rows)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2051,7 +2051,7 @@ PHP_FUNCTION(mysql_num_fields)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2078,23 +2078,23 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|Sz", &res, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|Sz", &res, &class_name, &ctor_params) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() < 2) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
result_type = MYSQL_ASSOC;
} else
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &result_type) == FAILURE) {
return;
}
if (!result_type) {
@@ -2104,7 +2104,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
}
if (result_type & ~MYSQL_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
+ php_error_docref(NULL, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH");
result_type = MYSQL_BOTH;
}
@@ -2128,7 +2128,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
#if PHP_API_VERSION < 20100412
if (PG(magic_quotes_runtime)) {
- ZVAL_STR(&data, php_addslashes(mysql_row[i], mysql_row_lengths[i], 0 TSRMLS_CC));
+ ZVAL_STR(&data, php_addslashes(mysql_row[i], mysql_row_lengths[i], 0));
} else {
#endif
ZVAL_STRINGL(&data, mysql_row[i], mysql_row_lengths[i]);
@@ -2174,7 +2174,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_dtor(&dataset);
}
@@ -2190,14 +2190,14 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -2208,8 +2208,8 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
} else {
if (!Z_ISUNDEF(retval)) {
zval_ptr_dtor(&retval);
@@ -2219,7 +2219,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
@@ -2270,14 +2270,14 @@ PHP_FUNCTION(mysql_data_seek)
zend_long offset;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &offset)) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &offset)) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (offset < 0 || offset >= (int)mysql_num_rows(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset %pd is invalid for MySQL result index %pd (or the query data is unbuffered)", offset, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Offset %pd is invalid for MySQL result index %pd (or the query data is unbuffered)", offset, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_data_seek(mysql_result, offset);
@@ -2295,7 +2295,7 @@ PHP_FUNCTION(mysql_fetch_lengths)
int num_fields;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2398,7 +2398,7 @@ PHP_FUNCTION(mysql_fetch_field)
MYSQL_RES *mysql_result;
const MYSQL_FIELD *mysql_field;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result, &field) == FAILURE) {
return;
}
@@ -2406,7 +2406,7 @@ PHP_FUNCTION(mysql_fetch_field)
if (ZEND_NUM_ARGS() > 1) {
if (field<0 || field >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset");
+ php_error_docref(NULL, E_WARNING, "Bad field offset");
RETURN_FALSE;
}
mysql_field_seek(mysql_result, field);
@@ -2444,13 +2444,13 @@ PHP_FUNCTION(mysql_field_seek)
zend_long offset;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (offset < 0 || offset >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", offset, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Field %pd is invalid for MySQL result index %pd", offset, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_field_seek(mysql_result, offset);
@@ -2475,14 +2475,14 @@ static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
char buf[512];
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
if (field < 0 || field >= (int)mysql_num_fields(mysql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %pd is invalid for MySQL result index %pd", field, Z_RES_P(result)->handle);
+ php_error_docref(NULL, E_WARNING, "Field %pd is invalid for MySQL result index %pd", field, Z_RES_P(result)->handle);
RETURN_FALSE;
}
mysql_field_seek(mysql_result, field);
@@ -2632,7 +2632,7 @@ PHP_FUNCTION(mysql_free_result)
zval *result;
MYSQL_RES *mysql_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2650,7 +2650,7 @@ PHP_FUNCTION(mysql_ping)
php_mysql_conn *mysql;
zval *mysql_link = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mysql_link)==FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mysql_link)==FAILURE) {
return;
}
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 88b79451b2..379bf5f855 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -44,7 +44,7 @@ static PHP_GINIT_FUNCTION(mysqli);
int i = 0; \
while (b[i].pname != NULL) { \
mysqli_add_property((a), (b)[i].pname, (b)[i].pname_length, \
- (mysqli_read_t)(b)[i].r_func, (mysqli_write_t)(b)[i].w_func TSRMLS_CC); \
+ (mysqli_read_t)(b)[i].r_func, (mysqli_write_t)(b)[i].w_func); \
i++; \
} \
}
@@ -70,8 +70,8 @@ zend_class_entry *mysqli_warning_class_entry;
zend_class_entry *mysqli_exception_class_entry;
-typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv TSRMLS_DC);
-typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval TSRMLS_DC);
+typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv);
+typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval);
typedef struct _mysqli_prop_handler {
zend_string *name;
@@ -89,7 +89,6 @@ static void free_prop_handler(zval *el) {
void php_mysqli_dtor_p_elements(void *data)
{
MYSQL *mysql = (MYSQL *)data;
- TSRMLS_FETCH();
mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT);
}
@@ -152,11 +151,11 @@ void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type)
#endif
/* {{{ php_clear_stmt_bind */
-void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC)
+void php_clear_stmt_bind(MY_STMT *stmt)
{
if (stmt->stmt) {
if (mysqli_stmt_close(stmt->stmt, TRUE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error occurred while closing statement");
+ php_error_docref(NULL, E_WARNING, "Error occurred while closing statement");
return;
}
}
@@ -197,13 +196,13 @@ void php_clear_mysql(MY_MYSQL *mysql) {
/* {{{ mysqli_objects_free_storage
*/
-static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_objects_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
my_efree(my_res);
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
@@ -211,7 +210,7 @@ static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
/* {{{ mysqli_link_free_storage
*/
-static void mysqli_link_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_link_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -219,41 +218,41 @@ static void mysqli_link_free_storage(zend_object *object TSRMLS_DC)
if (my_res && my_res->ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
if (mysql->mysql) {
- php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, my_res->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, my_res->status);
}
php_clear_mysql(mysql);
efree(mysql);
my_res->status = MYSQLI_STATUS_UNKNOWN;
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysql_driver_free_storage */
-static void mysqli_driver_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_driver_free_storage(zend_object *object)
{
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_stmt_free_storage
*/
-static void mysqli_stmt_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_stmt_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
if (my_res && my_res->ptr) {
MY_STMT *stmt = (MY_STMT *)my_res->ptr;
- php_clear_stmt_bind(stmt TSRMLS_CC);
+ php_clear_stmt_bind(stmt);
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_result_free_storage
*/
-static void mysqli_result_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_result_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -261,13 +260,13 @@ static void mysqli_result_free_storage(zend_object *object TSRMLS_DC)
if (my_res && my_res->ptr) {
mysql_free_result(my_res->ptr);
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_warning_free_storage
*/
-static void mysqli_warning_free_storage(zend_object *object TSRMLS_DC)
+static void mysqli_warning_free_storage(zend_object *object)
{
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
@@ -276,28 +275,28 @@ static void mysqli_warning_free_storage(zend_object *object TSRMLS_DC)
php_clear_warnings((MYSQLI_WARNING *)my_res->info);
my_res->ptr = NULL;
}
- mysqli_objects_free_storage(object TSRMLS_CC);
+ mysqli_objects_free_storage(object);
}
/* }}} */
/* {{{ mysqli_read_na */
-static zval *mysqli_read_na(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *mysqli_read_na(mysqli_object *obj, zval *retval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot read property");
+ php_error_docref(NULL, E_ERROR, "Cannot read property");
return NULL;
}
/* }}} */
/* {{{ mysqli_write_na */
-static int mysqli_write_na(mysqli_object *obj, zval *newval TSRMLS_DC)
+static int mysqli_write_na(mysqli_object *obj, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot write property");
+ php_error_docref(NULL, E_ERROR, "Cannot write property");
return FAILURE;
}
/* }}} */
/* {{{ mysqli_read_property */
-zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval tmp_member;
zval *retval;
@@ -317,13 +316,13 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
}
if (hnd) {
- retval = hnd->read_func(obj, rv TSRMLS_CC);
+ retval = hnd->read_func(obj, rv);
if (retval == NULL) {
retval = &EG(uninitialized_zval);
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -335,7 +334,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
/* }}} */
/* {{{ mysqli_write_property */
-void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
mysqli_object *obj;
@@ -354,7 +353,7 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
}
if (hnd) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
/* ???
if (! PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
Z_ADDREF_P(value);
@@ -362,7 +361,7 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
} */
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -371,8 +370,8 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
}
/* }}} */
-/* {{{ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) */
-void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysqli_read_t r_func, mysqli_write_t w_func TSRMLS_DC) {
+/* {{{ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli_write_t w_func) */
+void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysqli_read_t r_func, mysqli_write_t w_func) {
mysqli_prop_handler p;
p.name = zend_string_init(pname, pname_len, 1);
@@ -383,7 +382,7 @@ void mysqli_add_property(HashTable *h, const char *pname, size_t pname_len, mysq
}
/* }}} */
-static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
mysqli_object *obj = Z_MYSQLI_P(object);
mysqli_prop_handler *p;
@@ -396,7 +395,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
break;
case 1: {
zval rv;
- zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
convert_to_boolean(value);
ret = Z_TYPE_P(value) == IS_TRUE ? 1 : 0;
@@ -405,7 +404,7 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
}
case 0:{
zval rv;
- zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = mysqli_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
zval_ptr_dtor(value);
@@ -413,17 +412,17 @@ static int mysqli_object_has_property(zval *object, zval *member, int has_set_ex
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for has_set_exists");
+ php_error_docref(NULL, E_WARNING, "Invalid value for has_set_exists");
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- ret = std_hnd->has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ ret = std_hnd->has_property(object, member, has_set_exists, cache_slot);
}
return ret;
} /* }}} */
-HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
+HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp)
{
mysqli_object *obj = Z_MYSQLI_P(object);
HashTable *retval, *props = obj->prop_handler;
@@ -436,7 +435,7 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
zval rv, member;
zval *value;
ZVAL_STR(&member, entry->name);
- value = mysqli_read_property(object, &member, BP_VAR_IS, 0, &rv TSRMLS_CC);
+ value = mysqli_read_property(object, &member, BP_VAR_IS, 0, &rv);
if (value != &EG(uninitialized_zval)) {
zend_hash_add(retval, Z_STR(member), value);
}
@@ -448,7 +447,7 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
/* {{{ mysqli_objects_new
*/
-PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC)
+PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type)
{
mysqli_object *intern;
zend_class_entry *mysqli_base_class;
@@ -463,19 +462,19 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type
}
intern->prop_handler = zend_hash_find_ptr(&classes, mysqli_base_class->name);
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
/* link object */
- if (instanceof_function(class_type, mysqli_link_class_entry TSRMLS_CC)) {
+ if (instanceof_function(class_type, mysqli_link_class_entry)) {
handlers = &mysqli_object_link_handlers;
- } else if (instanceof_function(class_type, mysqli_driver_class_entry TSRMLS_CC)) { /* driver object */
+ } else if (instanceof_function(class_type, mysqli_driver_class_entry)) { /* driver object */
handlers = &mysqli_object_driver_handlers;
- } else if (instanceof_function(class_type, mysqli_stmt_class_entry TSRMLS_CC)) { /* stmt object */
+ } else if (instanceof_function(class_type, mysqli_stmt_class_entry)) { /* stmt object */
handlers = &mysqli_object_stmt_handlers;
- } else if (instanceof_function(class_type, mysqli_result_class_entry TSRMLS_CC)) { /* result object */
+ } else if (instanceof_function(class_type, mysqli_result_class_entry)) { /* result object */
handlers = &mysqli_object_result_handlers;
- } else if (instanceof_function(class_type, mysqli_warning_class_entry TSRMLS_CC)) { /* warning object */
+ } else if (instanceof_function(class_type, mysqli_warning_class_entry)) { /* warning object */
handlers = &mysqli_object_warning_handlers;
} else {
handlers = &mysqli_object_handlers;
@@ -489,15 +488,15 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *class_type
#ifdef MYSQLI_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC)
+static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv)
{
- if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry TSRMLS_CC)) {
+ if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), mysqli_link_class_entry)) {
MY_MYSQL *mysql;
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(zv);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
/* We know that we have a mysqli object, so this failure should be emitted */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);
return NULL;
}
mysql = (MY_MYSQL *)(my_res->ptr);
@@ -610,24 +609,24 @@ PHP_MINIT_FUNCTION(mysqli)
INIT_CLASS_ENTRY(cex, "mysqli_sql_exception", mysqli_exception_methods);
#ifdef HAVE_SPL
- mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException TSRMLS_CC);
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default());
#endif
mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
- zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED TSRMLS_CC);
+ zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
+ zend_declare_property_string(mysqli_exception_class_entry, "sqlstate", sizeof("sqlstate")-1, "00000", ZEND_ACC_PROTECTED);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_driver", mysqli_driver_class_entry, mysqli_driver_methods);
ce = mysqli_driver_class_entry;
zend_hash_init(&mysqli_driver_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_driver_properties, mysqli_driver_property_entries);
- zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "driver_version", sizeof("driver_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "embedded", sizeof("embedded") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "reconnect", sizeof("reconnect") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "report_mode", sizeof("report_mode") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "driver_version", sizeof("driver_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "embedded", sizeof("embedded") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "reconnect", sizeof("reconnect") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "report_mode", sizeof("report_mode") - 1, ZEND_ACC_PUBLIC);
ce->ce_flags |= ZEND_ACC_FINAL;
zend_hash_add_ptr(&classes, ce->name, &mysqli_driver_properties);
@@ -635,25 +634,25 @@ PHP_MINIT_FUNCTION(mysqli)
ce = mysqli_link_class_entry;
zend_hash_init(&mysqli_link_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_link_properties, mysqli_link_property_entries);
- zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "connect_errno", sizeof("connect_errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "connect_error", sizeof("connect_error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "host_info", sizeof("host_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "info", sizeof("info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "server_info", sizeof("server_info") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "server_version", sizeof("server_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "stat", sizeof("stat") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "protocol_version", sizeof("protocol_version") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "thread_id", sizeof("thread_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "warning_count", sizeof("warning_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_info", sizeof("client_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "client_version", sizeof("client_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "connect_errno", sizeof("connect_errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "connect_error", sizeof("connect_error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "host_info", sizeof("host_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "info", sizeof("info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "server_info", sizeof("server_info") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "server_version", sizeof("server_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "stat", sizeof("stat") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "protocol_version", sizeof("protocol_version") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "thread_id", sizeof("thread_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "warning_count", sizeof("warning_count") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_link_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_warning", mysqli_warning_class_entry, mysqli_warning_methods);
@@ -661,39 +660,39 @@ PHP_MINIT_FUNCTION(mysqli)
ce->ce_flags |= ZEND_ACC_FINAL;
zend_hash_init(&mysqli_warning_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_warning_properties, mysqli_warning_property_entries);
- zend_declare_property_null(ce, "message", sizeof("message") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "message", sizeof("message") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_warning_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_result", mysqli_result_class_entry, mysqli_result_methods);
ce = mysqli_result_class_entry;
zend_hash_init(&mysqli_result_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_result_properties, mysqli_result_property_entries);
- zend_declare_property_null(ce, "current_field", sizeof("current_field") - 1,ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "lengths", sizeof("lengths") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "type", sizeof("type") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "current_field", sizeof("current_field") - 1,ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "lengths", sizeof("lengths") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "type", sizeof("type") - 1, ZEND_ACC_PUBLIC);
mysqli_result_class_entry->get_iterator = php_mysqli_result_get_iterator;
mysqli_result_class_entry->iterator_funcs.funcs = &php_mysqli_result_iterator_funcs;
- zend_class_implements(mysqli_result_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(mysqli_result_class_entry, 1, zend_ce_traversable);
zend_hash_add_ptr(&classes, ce->name, &mysqli_result_properties);
REGISTER_MYSQLI_CLASS_ENTRY("mysqli_stmt", mysqli_stmt_class_entry, mysqli_stmt_methods);
ce = mysqli_stmt_class_entry;
zend_hash_init(&mysqli_stmt_properties, 0, NULL, free_prop_handler, 1);
MYSQLI_ADD_PROPERTIES(&mysqli_stmt_properties, mysqli_stmt_property_entries);
- zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "param_count", sizeof("param_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_null(ce, "id", sizeof("id") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(ce, "affected_rows", sizeof("affected_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "num_rows", sizeof("num_rows") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "param_count", sizeof("param_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "field_count", sizeof("field_count") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "errno", sizeof("errno") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error", sizeof("error") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "error_list", sizeof("error_list") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(ce, "id", sizeof("id") - 1, ZEND_ACC_PUBLIC);
zend_hash_add_ptr(&classes, ce->name, &mysqli_stmt_properties);
/* mysqli_options */
@@ -873,7 +872,7 @@ PHP_MINIT_FUNCTION(mysqli)
#ifdef MYSQLI_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&mysqli_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&mysqli_reverse_api);
#endif
return SUCCESS;
@@ -933,12 +932,11 @@ PHP_RINIT_FUNCTION(mysqli)
#if defined(A0) && defined(MYSQLI_USE_MYSQLND)
static void php_mysqli_persistent_helper_for_every(void *p)
{
- TSRMLS_FETCH();
mysqlnd_end_psession((MYSQLND *) p);
} /* }}} */
-static int php_mysqli_persistent_helper_once(zend_rsrc_list_entry *le TSRMLS_DC)
+static int php_mysqli_persistent_helper_once(zend_rsrc_list_entry *le)
{
if (le->type == php_le_pmysqli()) {
mysqli_plist_entry *plist = (mysqli_plist_entry *) le->ptr;
@@ -963,7 +961,7 @@ PHP_RSHUTDOWN_FUNCTION(mysqli)
}
#if defined(A0) && defined(MYSQLI_USE_MYSQLND)
/* psession is being called when the connection is freed - explicitly or implicitly */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysqli_persistent_helper_once TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_mysqli_persistent_helper_once);
#endif
return SUCCESS;
}
@@ -1058,7 +1056,7 @@ PHP_FUNCTION(mysqli_stmt_construct)
switch (ZEND_NUM_ARGS())
{
case 1: /* mysql_stmt_init */
- if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1068,7 +1066,7 @@ PHP_FUNCTION(mysqli_stmt_construct)
stmt->stmt = mysql_stmt_init(mysql->mysql);
break;
case 2:
- if (zend_parse_parameters(2 TSRMLS_CC, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
+ if (zend_parse_parameters(2, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1115,12 +1113,12 @@ PHP_FUNCTION(mysqli_result_construct)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(1 TSRMLS_CC, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
+ if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
return;
}
break;
case 2:
- if (zend_parse_parameters(2 TSRMLS_CC, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) {
+ if (zend_parse_parameters(2, "Ol", &mysql_link, mysqli_link_class_entry, &resmode)==FAILURE) {
return;
}
break;
@@ -1138,7 +1136,7 @@ PHP_FUNCTION(mysqli_result_construct)
result = mysql_use_result(mysql->mysql);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for resultmode");
+ php_error_docref(NULL, E_WARNING, "Invalid value for resultmode");
}
if (!result) {
@@ -1155,7 +1153,7 @@ PHP_FUNCTION(mysqli_result_construct)
/* {{{ php_mysqli_fetch_into_hash_aux
*/
-void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype TSRMLS_DC)
+void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype)
{
#if !defined(MYSQLI_USE_MYSQLND)
MYSQL_ROW row;
@@ -1205,7 +1203,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend
#if PHP_API_VERSION < 20100412
/* check if we need magic quotes */
if (PG(magic_quotes_runtime)) {
- ZVAL_STR(&res, php_addslashes(row[i], field_len[i], 0 TSRMLS_CC));
+ ZVAL_STR(&res, php_addslashes(row[i], field_len[i], 0));
} else {
#endif
ZVAL_STRINGL(&res, row[i], field_len[i]);
@@ -1251,28 +1249,28 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|Sz", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|Sz", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
return;
}
if (class_name == NULL) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
fetchtype = MYSQLI_ASSOC;
} else {
if (override_flags) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
fetchtype = override_flags;
} else {
fetchtype = MYSQLI_BOTH;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
return;
}
}
@@ -1280,11 +1278,11 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (fetchtype < MYSQLI_ASSOC || fetchtype > MYSQLI_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
+ php_error_docref(NULL, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
RETURN_FALSE;
}
- php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC);
+ php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype);
if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) {
zval dataset, retval;
@@ -1299,7 +1297,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_ptr_dtor(&dataset);
}
@@ -1315,14 +1313,14 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -1333,8 +1331,8 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name->val, ce->constructor->common.function_name->val);
} else {
zval_ptr_dtor(&retval);
}
@@ -1342,7 +1340,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
}
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 69799729b7..698e6bb5ba 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -68,7 +68,7 @@ static void mysqli_tx_cor_options_to_string(const MYSQL * const conn, smart_str
/* {{{ mysqlnd_escape_string_for_tx_name_in_comment */
char *
-mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
+mysqli_escape_string_for_tx_name_in_comment(const char * const name)
{
char * ret = NULL;
if (name) {
@@ -94,7 +94,7 @@ mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
{
*p_copy++ = v;
} else if (warned == FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
+ php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
warned = TRUE;
}
++p_orig;
@@ -108,7 +108,7 @@ mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
/* }}} */
/* {{{ mysqli_commit_or_rollback_libmysql */
-static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const uint32_t mode, const char * const name TSRMLS_DC)
+static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, const uint32_t mode, const char * const name)
{
int ret;
smart_str tmp_str = {0};
@@ -117,7 +117,7 @@ static int mysqli_commit_or_rollback_libmysql(MYSQL * conn, zend_bool commit, co
{
char *query;
- char *name_esc = mysqli_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char *name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
size_t query_len;
query_len = spprintf(&query, 0,
@@ -144,7 +144,7 @@ PHP_FUNCTION(mysqli_affected_rows)
zval *mysql_link;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -166,7 +166,7 @@ PHP_FUNCTION(mysqli_autocommit)
zval *mysql_link;
zend_bool automode;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &mysql_link, mysqli_link_class_entry, &automode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -182,7 +182,7 @@ PHP_FUNCTION(mysqli_autocommit)
#ifndef MYSQLI_USE_MYSQLND
static
int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned int num_vars,
- zval *args, unsigned int start, const char * const types TSRMLS_DC)
+ zval *args, unsigned int start, const char * const types)
{
int i, ofs;
MYSQL_BIND *bind;
@@ -234,7 +234,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i+1);
+ php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[ofs], i+1);
rc = 1;
goto end_1;
}
@@ -263,7 +263,7 @@ end_1:
#else
static
int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned int num_vars,
- zval *args, unsigned int start, const char * const types TSRMLS_DC)
+ zval *args, unsigned int start, const char * const types)
{
unsigned int i;
MYSQLND_PARAM_BIND *params;
@@ -298,7 +298,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
break;
default:
/* We count parameters from 1 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + start + 1);
+ php_error_docref(NULL, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + start + 1);
ret = FAIL;
mysqlnd_stmt_free_param_bind(stmt->stmt, params);
goto end;
@@ -334,7 +334,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
WRONG_PARAM_COUNT;
}
- if (zend_parse_method_parameters((getThis()) ? 1:2 TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry,
+ if (zend_parse_method_parameters((getThis()) ? 1:2, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry,
&types, &types_len) == FAILURE) {
return;
}
@@ -349,28 +349,28 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
--num_vars;
}
if (!types_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type or no types specified");
+ php_error_docref(NULL, E_WARNING, "Invalid type or no types specified");
RETURN_FALSE;
}
if (types_len != argc - start) {
/* number of bind variables doesn't match number of elements in type definition string */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
+ php_error_docref(NULL, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
RETURN_FALSE;
}
if (types_len != mysql_stmt_param_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement");
+ php_error_docref(NULL, E_WARNING, "Number of variables doesn't match number of parameters in prepared statement");
RETURN_FALSE;
}
args = safe_emalloc(argc, sizeof(zval), 0);
if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- zend_wrong_param_count(TSRMLS_C);
+ zend_wrong_param_count();
rc = 1;
} else {
- rc = mysqli_stmt_bind_param_do_bind(stmt, argc, num_vars, args, start, types TSRMLS_CC);
+ rc = mysqli_stmt_bind_param_do_bind(stmt, argc, num_vars, args, start, types);
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
}
@@ -386,7 +386,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
do_alloca, free_alloca
*/
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start TSRMLS_DC)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
{
MYSQL_BIND *bind;
int i, ofs;
@@ -525,7 +525,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Server returned unknown type %ld. Probably your client library is incompatible with the server version you use!", col_type);
+ php_error_docref(NULL, E_WARNING, "Server returned unknown type %ld. Probably your client library is incompatible with the server version you use!", col_type);
break;
}
}
@@ -556,7 +556,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
}
#else
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start TSRMLS_DC)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
{
unsigned int i;
MYSQLND_RESULT_BIND *params = mysqlnd_stmt_alloc_result_bind(stmt->stmt);
@@ -586,7 +586,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
start = 0;
}
- if (zend_parse_method_parameters((getThis()) ? 0:1 TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters((getThis()) ? 0:1, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -597,7 +597,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
}
if ((argc - start) != mysql_stmt_field_count(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
+ php_error_docref(NULL, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
RETURN_FALSE;
}
@@ -608,7 +608,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
WRONG_PARAM_COUNT;
}
- rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start TSRMLS_CC);
+ rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, start);
efree(args);
@@ -629,7 +629,7 @@ PHP_FUNCTION(mysqli_change_user)
const CHARSET_INFO * old_charset;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -671,7 +671,7 @@ PHP_FUNCTION(mysqli_character_set_name)
zval *mysql_link;
const char *cs_name;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -684,7 +684,7 @@ PHP_FUNCTION(mysqli_character_set_name)
/* }}} */
/* {{{ php_mysqli_close */
-void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC)
+void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status)
{
if (resource_status > MYSQLI_STATUS_INITIALIZED) {
MyG(num_links)--;
@@ -703,7 +703,7 @@ void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRM
if (MyG(rollback_on_cached_plink) &&
#if !defined(MYSQLI_USE_MYSQLND)
- mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, TRANS_COR_NO_OPT, NULL TSRMLS_CC))
+ mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, TRANS_COR_NO_OPT, NULL))
#else
FAIL == mysqlnd_rollback(mysql->mysql, TRANS_COR_NO_OPT, NULL))
#endif
@@ -731,13 +731,13 @@ PHP_FUNCTION(mysqli_close)
zval *mysql_link;
MY_MYSQL *mysql;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
- php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, ((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_EXPLICIT, ((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status);
((MYSQLI_RESOURCE *)(Z_MYSQLI_P(mysql_link))->ptr)->status = MYSQLI_STATUS_UNKNOWN;
MYSQLI_CLEAR_RESOURCE(mysql_link);
@@ -756,13 +756,13 @@ PHP_FUNCTION(mysqli_commit)
char * name = NULL;
size_t name_len = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name TSRMLS_CC)) {
+ if (mysqli_commit_or_rollback_libmysql(mysql->mysql, TRUE, flags, name)) {
#else
if (FAIL == mysqlnd_commit(mysql->mysql, flags, name)) {
#endif
@@ -780,14 +780,14 @@ PHP_FUNCTION(mysqli_data_seek)
zval *mysql_result;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (mysqli_result_is_unbuffered(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
+ php_error_docref(NULL, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
RETURN_FALSE;
}
@@ -807,7 +807,7 @@ PHP_FUNCTION(mysqli_debug)
char *debug;
size_t debug_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &debug, &debug_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &debug, &debug_len) == FAILURE) {
return;
}
@@ -823,7 +823,7 @@ PHP_FUNCTION(mysqli_dump_debug_info)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -839,7 +839,7 @@ PHP_FUNCTION(mysqli_errno)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -855,7 +855,7 @@ PHP_FUNCTION(mysqli_error)
zval *mysql_link;
const char *err;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -876,7 +876,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
unsigned int i;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -938,7 +938,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt) TSRMLS_CC);
+ php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt));
}
}
/* }}} */
@@ -956,7 +956,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS)
my_ulonglong llval;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1117,7 +1117,7 @@ void mysqli_stmt_fetch_mysqlnd(INTERNAL_FUNCTION_PARAMETERS)
zval *mysql_stmt;
zend_bool fetched_anything;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1146,7 +1146,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
/* }}} */
/* {{{ php_add_field_properties */
-static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC)
+static void php_add_field_properties(zval *value, const MYSQL_FIELD *field)
{
#ifdef MYSQLI_USE_MYSQLND
add_property_str(value, "name", zend_string_copy(field->sname));
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(mysqli_fetch_field)
zval *mysql_result;
const MYSQL_FIELD *field;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1194,7 +1194,7 @@ PHP_FUNCTION(mysqli_fetch_field)
}
object_init(return_value);
- php_add_field_properties(return_value, field TSRMLS_CC);
+ php_add_field_properties(return_value, field);
}
/* }}} */
@@ -1208,7 +1208,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
unsigned int i;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1221,7 +1221,7 @@ PHP_FUNCTION(mysqli_fetch_fields)
object_init(&obj);
- php_add_field_properties(&obj, field TSRMLS_CC);
+ php_add_field_properties(&obj, field);
add_index_zval(return_value, i, &obj);
}
}
@@ -1236,14 +1236,14 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
const MYSQL_FIELD *field;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (offset < 0 || offset >= (zend_long) mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset");
+ php_error_docref(NULL, E_WARNING, "Field offset is invalid for resultset");
RETURN_FALSE;
}
@@ -1252,7 +1252,7 @@ PHP_FUNCTION(mysqli_fetch_field_direct)
}
object_init(return_value);
- php_add_field_properties(return_value, field TSRMLS_CC);
+ php_add_field_properties(return_value, field);
}
/* }}} */
@@ -1265,7 +1265,7 @@ PHP_FUNCTION(mysqli_fetch_lengths)
unsigned int i;
zend_ulong *ret;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
@@ -1299,7 +1299,7 @@ PHP_FUNCTION(mysqli_field_count)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1317,13 +1317,13 @@ PHP_FUNCTION(mysqli_field_seek)
zval *mysql_result;
zend_long fieldnr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &fieldnr) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid field offset");
+ php_error_docref(NULL, E_WARNING, "Invalid field offset");
RETURN_FALSE;
}
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(mysqli_field_tell)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1355,7 +1355,7 @@ PHP_FUNCTION(mysqli_free_result)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(mysqli_get_host_info)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1410,7 +1410,7 @@ PHP_FUNCTION(mysqli_get_proto_info)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1426,7 +1426,7 @@ PHP_FUNCTION(mysqli_get_server_info)
zval *mysql_link = NULL;
const char *info;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(mysqli_get_server_version)
MY_MYSQL *mysql;
zval *mysql_link = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1462,7 +1462,7 @@ PHP_FUNCTION(mysqli_info)
zval *mysql_link = NULL;
const char *info;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1485,7 +1485,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
// To solve the problem, we added instanceof check for the class of $this
// ???
if (getThis() &&
- instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry) &&
(Z_MYSQLI_P(getThis()))->ptr) {
//??? if (getThis() && (Z_MYSQLI_P(getThis()))->ptr) {
return;
@@ -1511,7 +1511,7 @@ void php_mysqli_init(INTERNAL_FUNCTION_PARAMETERS)
mysqli_resource->ptr = (void *)mysql;
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
- if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry TSRMLS_CC)) {
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_link_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
(Z_MYSQLI_P(getThis()))->ptr = mysqli_resource;
@@ -1535,7 +1535,7 @@ PHP_FUNCTION(mysqli_insert_id)
my_ulonglong rc;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1552,13 +1552,13 @@ PHP_FUNCTION(mysqli_kill)
zval *mysql_link;
zend_long processid;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &processid) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (processid <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "processid should have positive value");
+ php_error_docref(NULL, E_WARNING, "processid should have positive value");
RETURN_FALSE;
}
@@ -1577,7 +1577,7 @@ PHP_FUNCTION(mysqli_more_results)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1592,13 +1592,13 @@ PHP_FUNCTION(mysqli_next_result) {
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!mysql_more_results(mysql->mysql)) {
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "There is no next result set. "
+ php_error_docref(NULL, E_STRICT, "There is no next result set. "
"Please, call mysqli_more_results()/mysqli::more_results() to check "
"whether to call this function/method");
}
@@ -1615,7 +1615,7 @@ PHP_FUNCTION(mysqli_stmt_more_results)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -1630,13 +1630,13 @@ PHP_FUNCTION(mysqli_stmt_next_result) {
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (!mysqlnd_stmt_more_results(stmt->stmt)) {
- php_error_docref(NULL TSRMLS_CC, E_STRICT, "There is no next result set. "
+ php_error_docref(NULL, E_STRICT, "There is no next result set. "
"Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check "
"whether to call this function/method");
}
@@ -1653,7 +1653,7 @@ PHP_FUNCTION(mysqli_num_fields)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
@@ -1669,13 +1669,13 @@ PHP_FUNCTION(mysqli_num_rows)
MYSQL_RES *result;
zval *mysql_result;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (mysqli_result_is_unbuffered_and_not_everything_is_fetched(result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
+ php_error_docref(NULL, E_WARNING, "Function cannot be used with MYSQL_USE_RESULT");
RETURN_LONG(0);
}
@@ -1766,7 +1766,7 @@ PHP_FUNCTION(mysqli_options)
zend_long ret;
int expected_type;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -1818,7 +1818,7 @@ PHP_FUNCTION(mysqli_ping)
zval *mysql_link;
zend_long rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1840,14 +1840,14 @@ PHP_FUNCTION(mysqli_prepare)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os",&mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os",&mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
if (mysql->mysql->status == MYSQL_STATUS_GET_RESULT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "All data must be fetched before a new statement prepare takes place");
+ php_error_docref(NULL, E_WARNING, "All data must be fetched before a new statement prepare takes place");
RETURN_FALSE;
}
#endif
@@ -1926,7 +1926,7 @@ PHP_FUNCTION(mysqli_real_query)
char *query = NULL;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1940,7 +1940,7 @@ PHP_FUNCTION(mysqli_real_query)
if (!mysql_field_count(mysql->mysql)) {
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
}
@@ -1957,7 +1957,7 @@ PHP_FUNCTION(mysqli_real_escape_string) {
size_t escapestr_len;
zend_string *newstr;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &escapestr, &escapestr_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -1980,13 +1980,13 @@ PHP_FUNCTION(mysqli_rollback)
char * name = NULL;
size_t name_len = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, flags, name TSRMLS_CC)) {
+ if (mysqli_commit_or_rollback_libmysql(mysql->mysql, FALSE, flags, name)) {
#else
if (FAIL == mysqlnd_rollback(mysql->mysql, flags, name)) {
#endif
@@ -2006,13 +2006,13 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
zend_long param_nr;
size_t data_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &mysql_stmt, mysqli_stmt_class_entry, &param_nr, &data, &data_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (param_nr < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter number");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter number");
RETURN_FALSE;
}
if (mysql_stmt_send_long_data(stmt->stmt, param_nr, data, data_len)) {
@@ -2030,7 +2030,7 @@ PHP_FUNCTION(mysqli_stmt_affected_rows)
zval *mysql_stmt;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2050,14 +2050,14 @@ PHP_FUNCTION(mysqli_stmt_close)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
mysqli_stmt_close(stmt->stmt, FALSE);
stmt->stmt = NULL;
- php_clear_stmt_bind(stmt TSRMLS_CC);
+ php_clear_stmt_bind(stmt);
MYSQLI_CLEAR_RESOURCE(mysql_stmt);
RETURN_TRUE;
}
@@ -2071,11 +2071,11 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
zval *mysql_stmt;
zend_long offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) {
return;
}
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be positive");
+ php_error_docref(NULL, E_WARNING, "Offset must be positive");
RETURN_FALSE;
}
@@ -2092,7 +2092,7 @@ PHP_FUNCTION(mysqli_stmt_field_count)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2108,7 +2108,7 @@ PHP_FUNCTION(mysqli_stmt_free_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2126,7 +2126,7 @@ PHP_FUNCTION(mysqli_stmt_insert_id)
my_ulonglong rc;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2142,7 +2142,7 @@ PHP_FUNCTION(mysqli_stmt_param_count)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2158,7 +2158,7 @@ PHP_FUNCTION(mysqli_stmt_reset)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2179,7 +2179,7 @@ PHP_FUNCTION(mysqli_stmt_num_rows)
zval *mysql_stmt;
my_ulonglong rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
@@ -2199,7 +2199,7 @@ PHP_FUNCTION(mysqli_select_db)
char *dbname;
size_t dbname_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &dbname, &dbname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2220,7 +2220,7 @@ PHP_FUNCTION(mysqli_sqlstate)
zval *mysql_link;
const char *state;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2240,7 +2240,7 @@ PHP_FUNCTION(mysqli_ssl_set)
char *ssl_parm[5];
size_t ssl_parm_len[5], i;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Osssss", &mysql_link, mysqli_link_class_entry, &ssl_parm[0], &ssl_parm_len[0], &ssl_parm[1], &ssl_parm_len[1], &ssl_parm[2], &ssl_parm_len[2], &ssl_parm[3], &ssl_parm_len[3], &ssl_parm[4], &ssl_parm_len[4]) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osssss", &mysql_link, mysqli_link_class_entry, &ssl_parm[0], &ssl_parm_len[0], &ssl_parm[1], &ssl_parm_len[1], &ssl_parm[2], &ssl_parm_len[2], &ssl_parm[3], &ssl_parm_len[3], &ssl_parm[4], &ssl_parm_len[4]) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -2269,7 +2269,7 @@ PHP_FUNCTION(mysqli_stat)
char *stat;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2298,7 +2298,7 @@ PHP_FUNCTION(mysqli_refresh)
zval *mysql_link = NULL;
zend_long options;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &options) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_link, mysqli_link_class_entry, &options) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
@@ -2324,13 +2324,13 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
zend_long attr;
void *mode_p;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode_in) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode_in) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (mode_in < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
+ php_error_docref(NULL, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
RETURN_FALSE;
}
@@ -2367,7 +2367,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
zend_long attr;
int rc;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2391,7 +2391,7 @@ PHP_FUNCTION(mysqli_stmt_errno)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2408,7 +2408,7 @@ PHP_FUNCTION(mysqli_stmt_error)
zval *mysql_stmt;
const char * err;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2430,7 +2430,7 @@ PHP_FUNCTION(mysqli_stmt_init)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2462,7 +2462,7 @@ PHP_FUNCTION(mysqli_stmt_prepare)
char *query;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_stmt, mysqli_stmt_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -2486,7 +2486,7 @@ PHP_FUNCTION(mysqli_stmt_result_metadata)
zval *mysql_stmt;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2510,7 +2510,7 @@ PHP_FUNCTION(mysqli_stmt_store_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2560,7 +2560,7 @@ PHP_FUNCTION(mysqli_stmt_sqlstate)
zval *mysql_stmt;
const char * state;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -2583,7 +2583,7 @@ PHP_FUNCTION(mysqli_store_result)
zend_long flags = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_link, mysqli_link_class_entry, &flags) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_link, mysqli_link_class_entry, &flags) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2597,7 +2597,7 @@ PHP_FUNCTION(mysqli_store_result)
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -2614,7 +2614,7 @@ PHP_FUNCTION(mysqli_thread_id)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2640,7 +2640,7 @@ PHP_FUNCTION(mysqli_use_result)
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -2651,7 +2651,7 @@ PHP_FUNCTION(mysqli_use_result)
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index("from previous query", mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)result;
@@ -2667,7 +2667,7 @@ PHP_FUNCTION(mysqli_warning_count)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c
index 95096f4a61..bdb0a3796b 100644
--- a/ext/mysqli/mysqli_driver.c
+++ b/ext/mysqli/mysqli_driver.c
@@ -30,59 +30,59 @@
#include "mysqli_fe.h"
#define MAP_PROPERTY_MYG_BOOL_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_BOOL(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_BOOL_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_LVAL_P(value) > 0; \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_LONG_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_LONG(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_LONG_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_LVAL_P(value); \
return SUCCESS; \
} \
#define MAP_PROPERTY_MYG_STRING_READ(name, value) \
-static zval *name(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *name(mysqli_object *obj, zval *retval) \
{ \
ZVAL_STRING(retval, MyG(value)); \
return retval; \
} \
#define MAP_PROPERTY_MYG_STRING_WRITE(name, value) \
-static int name(mysqli_object *obj, zval *value TSRMLS_DC) \
+static int name(mysqli_object *obj, zval *value) \
{ \
MyG(value) = Z_STRVAL_P(value); \
return SUCCESS; \
} \
/* {{{ property driver_report_write */
-static int driver_report_write(mysqli_object *obj, zval *value TSRMLS_DC)
+static int driver_report_write(mysqli_object *obj, zval *value)
{
MyG(report_mode) = Z_LVAL_P(value);
/*FIXME*/
- /* zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL TSRMLS_CC); */
+ /* zend_replace_error_handling(MyG(report_mode) & MYSQLI_REPORT_STRICT ? EH_THROW : EH_NORMAL, NULL, NULL); */
return SUCCESS;
}
/* }}} */
/* {{{ property driver_embedded_read */
-static zval *driver_embedded_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_embedded_read(mysqli_object *obj, zval *retval)
{
#ifdef HAVE_EMBEDDED_MYSQLI
ZVAL_BOOL(retval, 1);
@@ -94,7 +94,7 @@ static zval *driver_embedded_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property driver_client_version_read */
-static zval *driver_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_client_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQL_VERSION_ID);
return retval;
@@ -102,7 +102,7 @@ static zval *driver_client_version_read(mysqli_object *obj, zval *retval TSRMLS_
/* }}} */
/* {{{ property driver_client_info_read */
-static zval *driver_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_client_info_read(mysqli_object *obj, zval *retval)
{
ZVAL_STRING(retval, (char *)mysql_get_client_info());
return retval;
@@ -110,7 +110,7 @@ static zval *driver_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property driver_driver_version_read */
-static zval *driver_driver_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *driver_driver_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQLI_VERSION_ID);
return retval;
diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c
index 4c1c4a37a5..772cecf0fd 100644
--- a/ext/mysqli/mysqli_embedded.c
+++ b/ext/mysqli/mysqli_embedded.c
@@ -42,7 +42,7 @@ PHP_FUNCTION(mysqli_embedded_server_start)
HashPosition pos;
int index, rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "laa", &start, &args, &grps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "laa", &start, &args, &grps) == FAILURE) {
return;
}
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index ec86b9d740..5a8f84c2bc 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -36,7 +36,7 @@ const zend_function_entry mysqli_exception_methods[] = {
};
/* }}} */
-void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
+void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...)
{
zval sql_ex;
va_list arg;
@@ -47,7 +47,7 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
va_end(arg);;
if (!(MyG(report_mode) & MYSQLI_REPORT_STRICT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message);
+ php_error_docref(NULL, E_WARNING, "(%s/%d): %s", sqlstate, errorno, message);
efree(message);
return;
}
@@ -56,21 +56,21 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
if (message) {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "message", sizeof("message") - 1,
- message TSRMLS_CC);
+ message);
}
if (sqlstate) {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
- sqlstate TSRMLS_CC);
+ sqlstate);
} else {
zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
- "00000" TSRMLS_CC);
+ "00000");
}
efree(message);
- zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
+ zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno);
- zend_throw_exception_object(&sql_ex TSRMLS_CC);
+ zend_throw_exception_object(&sql_ex);
}
/*
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index db0d0ee677..32bdcdfa69 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -37,12 +37,12 @@
#ifndef zend_parse_parameters_none
#define zend_parse_parameters_none() \
- zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
+ zend_parse_parameters(ZEND_NUM_ARGS(), "")
#endif
/* {{{ php_mysqli_set_error
*/
-static void php_mysqli_set_error(zend_long mysql_errno, char *mysql_err TSRMLS_DC)
+static void php_mysqli_set_error(zend_long mysql_errno, char *mysql_err)
{
MyG(error_no) = mysql_errno;
if (MyG(error_msg)) {
@@ -74,7 +74,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
#if !defined(MYSQL_USE_MYSQLND)
if ((MYSQL_VERSION_ID / 100) != (mysql_get_client_version() / 100)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Headers and client library minor version mismatch. Headers:%d Library:%ld",
MYSQL_VERSION_ID, mysql_get_client_version());
}
@@ -87,12 +87,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
hostname = username = dbname = passwd = socket = NULL;
if (!is_real_connect) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssssls", &hostname, &hostname_len, &username, &username_len,
&passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) {
return;
}
- if (object && instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
+ if (object && instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) {
mysqli_resource = (Z_MYSQLI_P(object))->ptr;
if (mysqli_resource && mysqli_resource->ptr) {
mysql = (MY_MYSQL*) mysqli_resource->ptr;
@@ -105,7 +105,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */
} else {
/* We have flags too */
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|sssslsl", &object, mysqli_link_class_entry,
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|sssslsl", &object, mysqli_link_class_entry,
&hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len,
&flags) == FAILURE) {
return;
@@ -144,13 +144,13 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
(mysqli_resource->status > MYSQLI_STATUS_INITIALIZED))
{
/* already connected, we should close the connection */
- php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status TSRMLS_CC);
+ php_mysqli_close(mysql, MYSQLI_CLOSE_IMPLICIT, mysqli_resource->status);
}
if (strlen(SAFE_STR(hostname)) > 2 && !strncasecmp(hostname, "p:", 2)) {
hostname += 2;
if (!MyG(allow_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
+ php_error_docref(NULL, E_WARNING, "Persistent connections are disabled. Downgrading to normal");
} else {
mysql->persistent = persistent = TRUE;
@@ -200,14 +200,14 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
}
}
if (MyG(max_links) != -1 && MyG(num_links) >= MyG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%pd)", MyG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", MyG(num_links));
goto err;
}
if (persistent && MyG(max_persistent) != -1 &&
(MyG(num_active_persistent) + MyG(num_inactive_persistent))>= MyG(max_persistent))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%pd)",
+ php_error_docref(NULL, E_WARNING, "Too many open persistent links (%pd)",
MyG(num_active_persistent) + MyG(num_inactive_persistent));
goto err;
}
@@ -238,12 +238,12 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
if (mysql_real_connect(mysql->mysql, hostname, username, passwd, dbname, port, socket, flags) == NULL)
#else
if (mysqlnd_connect(mysql->mysql, hostname, username, passwd, passwd_len, dbname, dbname_len,
- port, socket, flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA TSRMLS_CC) == NULL)
+ port, socket, flags, MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA) == NULL)
#endif
{
/* Save error messages - for mysqli_connect_error() & mysqli_connect_errno() */
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
if (!is_real_connect) {
/* free mysql structure */
@@ -254,7 +254,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
}
/* clear error */
- php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql) TSRMLS_CC);
+ php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
#if !defined(MYSQLI_USE_MYSQLND)
mysql->mysql->reconnect = MyG(reconnect);
@@ -278,7 +278,7 @@ end:
mysql->multi_query = 0;
- if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) {
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
} else {
(Z_MYSQLI_P(object))->ptr = mysqli_resource;
@@ -362,13 +362,13 @@ PHP_FUNCTION(mysqli_fetch_all)
zval *mysql_result;
zend_long mode = MYSQLND_FETCH_NUM;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &mode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
if (!mode || (mode & ~MYSQLND_FETCH_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode can be only MYSQLI_FETCH_NUM, "
+ php_error_docref(NULL, E_WARNING, "Mode can be only MYSQLI_FETCH_NUM, "
"MYSQLI_FETCH_ASSOC or MYSQLI_FETCH_BOTH");
RETURN_FALSE;
}
@@ -395,7 +395,7 @@ PHP_FUNCTION(mysqli_get_connection_stats)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -413,7 +413,7 @@ PHP_FUNCTION(mysqli_error_list)
MY_MYSQL *mysql;
zval *mysql_link;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -454,7 +454,7 @@ PHP_FUNCTION(mysqli_stmt_error_list)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
@@ -505,7 +505,7 @@ PHP_FUNCTION(mysqli_multi_query)
char *query = NULL;
size_t query_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &query, &query_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -551,12 +551,12 @@ PHP_FUNCTION(mysqli_query)
size_t query_len;
zend_long resultmode = MYSQLI_STORE_RESULT;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &mysql_link, mysqli_link_class_entry, &query, &query_len, &resultmode) == FAILURE) {
return;
}
if (!query_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty query");
+ php_error_docref(NULL, E_WARNING, "Empty query");
RETURN_FALSE;
}
#ifdef MYSQLI_USE_MYSQLND
@@ -564,7 +564,7 @@ PHP_FUNCTION(mysqli_query)
#else
if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && (resultmode & ~MYSQLI_ASYNC) != MYSQLI_STORE_RESULT) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for resultmode");
+ php_error_docref(NULL, E_WARNING, "Invalid value for resultmode");
RETURN_FALSE;
}
@@ -592,7 +592,7 @@ PHP_FUNCTION(mysqli_query)
if (!mysql_field_count(mysql->mysql)) {
/* no result set - not a SELECT */
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
RETURN_TRUE;
}
@@ -615,13 +615,13 @@ PHP_FUNCTION(mysqli_query)
break;
}
if (!result) {
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
- php_mysqli_report_index(query, mysqli_server_status(mysql->mysql) TSRMLS_CC);
+ php_mysqli_report_index(query, mysqli_server_status(mysql->mysql));
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -634,7 +634,7 @@ PHP_FUNCTION(mysqli_query)
#if defined(MYSQLI_USE_MYSQLND)
#include "php_network.h"
/* {{{ mysqlnd_zval_array_to_mysqlnd_array functions */
-static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_array TSRMLS_DC)
+static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_array)
{
zval *elem;
int i = 0, current = 0;
@@ -646,19 +646,19 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(in_array), elem) {
i++;
if (Z_TYPE_P(elem) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d not a mysqli object", i);
+ !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry)) {
+ php_error_docref(NULL, E_WARNING, "Parameter %d not a mysqli object", i);
} else {
MY_MYSQL *mysql;
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
continue;
}
mysql = (MY_MYSQL*) my_res->ptr;
if (MYSQLI_STATUS_VALID && my_res->status < MYSQLI_STATUS_VALID) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object %d or resource %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid object %d or resource %s", i, intern->zo.ce->name->val);
continue;
}
(*out_array)[current++] = mysql->mysql;
@@ -669,7 +669,7 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
/* }}} */
/* {{{ mysqlnd_zval_array_from_mysqlnd_array */
-static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_array TSRMLS_DC)
+static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_array)
{
MYSQLND **p = in_array;
zval dest_array;
@@ -681,7 +681,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(out_array), elem) {
i++;
if (Z_TYPE_P(elem) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry TSRMLS_CC)) {
+ !instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry)) {
continue;
}
{
@@ -689,7 +689,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
+ php_error_docref(NULL, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name->val);
continue;
}
mysql = (MY_MYSQL *) my_res->ptr;
@@ -713,7 +713,7 @@ static int mysqlnd_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *out_a
/* }}} */
/* {{{ mysqlnd_dont_poll_zval_array_from_mysqlnd_array */
-static int mysqlnd_dont_poll_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *in_zval_array, zval *out_array TSRMLS_DC)
+static int mysqlnd_dont_poll_zval_array_from_mysqlnd_array(MYSQLND **in_array, zval *in_zval_array, zval *out_array)
{
MYSQLND **p = in_array;
zval proxy, *elem, *dest_elem;
@@ -754,35 +754,35 @@ PHP_FUNCTION(mysqli_poll)
enum_func_status ret;
int desc_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) {
return;
}
if (sec < 0 || usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative values passed for sec and/or usec");
+ php_error_docref(NULL, E_WARNING, "Negative values passed for sec and/or usec");
RETURN_FALSE;
}
if (!r_array && !e_array) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, "No stream arrays were passed");
RETURN_FALSE;
}
if (r_array != NULL) {
- mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array TSRMLS_CC);
+ mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array);
}
if (e_array != NULL) {
- mysqlnd_zval_array_to_mysqlnd_array(e_array, &new_e_array TSRMLS_CC);
+ mysqlnd_zval_array_to_mysqlnd_array(e_array, &new_e_array);
}
ret = mysqlnd_poll(new_r_array, new_e_array, &new_dont_poll_array, sec, usec, &desc_num);
- mysqlnd_dont_poll_zval_array_from_mysqlnd_array(r_array != NULL ? new_dont_poll_array:NULL, r_array, dont_poll_array TSRMLS_CC);
+ mysqlnd_dont_poll_zval_array_from_mysqlnd_array(r_array != NULL ? new_dont_poll_array:NULL, r_array, dont_poll_array);
if (r_array != NULL) {
- mysqlnd_zval_array_from_mysqlnd_array(new_r_array, r_array TSRMLS_CC);
+ mysqlnd_zval_array_from_mysqlnd_array(new_r_array, r_array);
}
if (e_array != NULL) {
- mysqlnd_zval_array_from_mysqlnd_array(new_e_array, e_array TSRMLS_CC);
+ mysqlnd_zval_array_from_mysqlnd_array(new_e_array, e_array);
}
if (new_dont_poll_array) {
@@ -811,7 +811,7 @@ PHP_FUNCTION(mysqli_reap_async_query)
MYSQLI_RESOURCE *mysqli_resource;
MYSQL_RES *result = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
@@ -824,7 +824,7 @@ PHP_FUNCTION(mysqli_reap_async_query)
if (!mysql_field_count(mysql->mysql)) {
/* no result set - not a SELECT */
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
-/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql) TSRMLS_CC); */
+/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql)); */
}
RETURN_TRUE;
}
@@ -839,13 +839,13 @@ PHP_FUNCTION(mysqli_reap_async_query)
}
if (!result) {
- php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql) TSRMLS_CC,
+ php_mysqli_throw_sql_exception((char *)mysql_sqlstate(mysql->mysql), mysql_errno(mysql->mysql),
"%s", mysql_error(mysql->mysql));
RETURN_FALSE;
}
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
-/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql) TSRMLS_CC); */
+/* php_mysqli_report_index("n/a", mysqli_server_status(mysql->mysql)); */
}
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
@@ -864,7 +864,7 @@ PHP_FUNCTION(mysqli_stmt_get_result)
MY_STMT *stmt;
zval *mysql_stmt;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
@@ -890,16 +890,16 @@ PHP_FUNCTION(mysqli_get_warnings)
MYSQLI_RESOURCE *mysqli_resource;
MYSQLI_WARNING *w;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (mysql_warning_count(mysql->mysql)) {
#ifdef MYSQLI_USE_MYSQLND
- w = php_get_warnings(mysql->mysql->data TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql->data);
#else
- w = php_get_warnings(mysql->mysql TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql);
#endif
} else {
RETURN_FALSE;
@@ -919,13 +919,13 @@ PHP_FUNCTION(mysqli_stmt_get_warnings)
MYSQLI_RESOURCE *mysqli_resource;
MYSQLI_WARNING *w;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &stmt_link, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, stmt_link, MYSQLI_STATUS_VALID);
if (mysqli_stmt_warning_count(stmt->stmt)) {
- w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
+ w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt));
} else {
RETURN_FALSE;
}
@@ -946,7 +946,7 @@ PHP_FUNCTION(mysqli_set_charset)
char *cs_name;
size_t csname_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &csname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &cs_name, &csname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -974,7 +974,7 @@ PHP_FUNCTION(mysqli_get_charset)
const MYSQLND_CHARSET *cs;
#endif
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
@@ -993,7 +993,7 @@ PHP_FUNCTION(mysqli_get_charset)
#else
cs = mysql->mysql->data->charset;
if (!cs) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The connection has no charset associated");
+ php_error_docref(NULL, E_WARNING, "The connection has no charset associated");
RETURN_NULL();
}
name = cs->name;
@@ -1019,10 +1019,10 @@ PHP_FUNCTION(mysqli_get_charset)
#endif
#if !defined(MYSQLI_USE_MYSQLND)
-extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC);
+extern char * mysqli_escape_string_for_tx_name_in_comment(const char * const name);
/* {{{ proto bool mysqli_begin_transaction_libmysql */
-static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name TSRMLS_DC)
+static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mode, const char * const name)
{
int ret;
zend_bool err = FALSE;
@@ -1035,7 +1035,7 @@ static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mo
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
if (mysql_get_server_version(conn) < 50605L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
+ php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
err = TRUE;
} else if (mode & TRANS_START_READ_WRITE) {
if (tmp_str.s) {
@@ -1052,7 +1052,7 @@ static int mysqli_begin_transaction_libmysql(MYSQL * conn, const unsigned int mo
smart_str_0(&tmp_str);
if (err == FALSE){
- char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqli_escape_string_for_tx_name_in_comment(name);
char * query;
unsigned int query_len = spprintf(&query, 0, "START TRANSACTION%s %s",
name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
@@ -1081,16 +1081,16 @@ PHP_FUNCTION(mysqli_begin_transaction)
size_t name_len = -1;
zend_bool err = FALSE;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (flags < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for parameter flags (%pd)", flags);
+ php_error_docref(NULL, E_WARNING, "Invalid value for parameter flags (%pd)", flags);
err = TRUE;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
err = TRUE;
}
if (TRUE == err) {
@@ -1098,7 +1098,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
}
#if !defined(MYSQLI_USE_MYSQLND)
- if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name TSRMLS_CC)) {
+ if (mysqli_begin_transaction_libmysql(mysql->mysql, flags, name)) {
RETURN_FALSE;
}
#else
@@ -1133,12 +1133,12 @@ PHP_FUNCTION(mysqli_savepoint)
char * name = NULL;
size_t name_len = -1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!name || !name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
RETURN_FALSE;
}
@@ -1162,12 +1162,12 @@ PHP_FUNCTION(mysqli_release_savepoint)
char * name = NULL;
size_t name_len = -1;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &mysql_link, mysqli_link_class_entry, &name, &name_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
if (!name || !name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Savepoint name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Savepoint name cannot be empty");
RETURN_FALSE;
}
#if !defined(MYSQLI_USE_MYSQLND)
@@ -1186,7 +1186,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
PHP_FUNCTION(mysqli_get_links_stats)
{
if (ZEND_NUM_ARGS()) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no parameters expected");
+ php_error_docref(NULL, E_WARNING, "no parameters expected");
return;
}
array_init(return_value);
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index cff28400ed..4040b338d1 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -61,22 +61,22 @@ extern const zend_property_info mysqli_warning_property_info_entries[];
extern int php_le_pmysqli(void);
extern void php_mysqli_dtor_p_elements(void *data);
-extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC);
+extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
-extern void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC);
+extern void php_clear_stmt_bind(MY_STMT *stmt);
extern void php_clear_mysql(MY_MYSQL *);
#ifdef MYSQLI_USE_MYSQLND
-extern MYSQLI_WARNING *php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC);
+extern MYSQLI_WARNING *php_get_warnings(MYSQLND_CONN_DATA * mysql);
#else
-extern MYSQLI_WARNING *php_get_warnings(MYSQL * mysql TSRMLS_DC);
+extern MYSQLI_WARNING *php_get_warnings(MYSQL * mysql);
#endif
extern void php_clear_warnings(MYSQLI_WARNING *w);
extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type);
-extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC);
-extern void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC);
-extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
+extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error);
+extern void php_mysqli_report_index(const char *query, unsigned int status);
+extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
@@ -84,7 +84,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
#define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type
-PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry * TSRMLS_DC);
+PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *);
#define MYSQLI_DISABLE_MQ if (mysql->multi_query) { \
mysql_set_server_option(mysql->mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); \
@@ -136,12 +136,12 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry * TSRMLS_DC
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_errno(mysql)) { \
- php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql) TSRMLS_CC); \
+ php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql)); \
}
#define MYSQLI_REPORT_STMT_ERROR(stmt) \
if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_stmt_errno(stmt)) { \
- php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt) TSRMLS_CC); \
+ php_mysqli_report_error(mysql_stmt_sqlstate(stmt), mysql_stmt_errno(stmt), mysql_stmt_error(stmt)); \
}
void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_connect, zend_bool in_ctor);
diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c
index 1354e0db93..e4377ff273 100644
--- a/ext/mysqli/mysqli_prop.c
+++ b/ext/mysqli/mysqli_prop.c
@@ -33,7 +33,7 @@
#define CHECK_STATUS(value) \
if (!obj->ptr || ((MYSQLI_RESOURCE *)obj->ptr)->status < value ) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property access is not allowed yet"); \
+ php_error_docref(NULL, E_WARNING, "Property access is not allowed yet"); \
ZVAL_NULL(retval); \
return retval; \
} \
@@ -41,7 +41,7 @@
#define MYSQLI_GET_MYSQL(statusval) \
MYSQL *p; \
if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -52,7 +52,7 @@ if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
#define MYSQLI_GET_RESULT(statusval) \
MYSQL_RES *p; \
if (!obj->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -64,7 +64,7 @@ if (!obj->ptr) { \
#define MYSQLI_GET_STMT(statusval) \
MYSQL_STMT *p; \
if (!obj->ptr) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", obj->zo.ce->name->val);\
ZVAL_NULL(retval);\
return retval; \
} else { \
@@ -73,7 +73,7 @@ if (!obj->ptr) { \
}
#define MYSQLI_MAP_PROPERTY_FUNC_LONG( __func, __int_func, __get_type, __ret_type, __ret_type_sprint_mod)\
-static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
+static zval *__func(mysqli_object *obj, zval *retval) \
{\
__ret_type l;\
__get_type;\
@@ -91,7 +91,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC) \
}
#define MYSQLI_MAP_PROPERTY_FUNC_STRING(__func, __int_func, __get_type)\
-static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC)\
+static zval *__func(mysqli_object *obj, zval *retval)\
{\
char *c;\
__get_type;\
@@ -109,7 +109,7 @@ static zval *__func(mysqli_object *obj, zval *retval TSRMLS_DC)\
}
/* {{{ property link_client_version_read */
-static zval *link_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_client_version_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, MYSQL_VERSION_ID);
return retval;
@@ -117,7 +117,7 @@ static zval *link_client_version_read(mysqli_object *obj, zval *retval TSRMLS_DC
/* }}} */
/* {{{ property link_client_info_read */
-static zval *link_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_client_info_read(mysqli_object *obj, zval *retval)
{
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
ZVAL_STRING(retval, MYSQL_SERVER_VERSION);
@@ -126,7 +126,7 @@ static zval *link_client_info_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_connect_errno_read */
-static zval *link_connect_errno_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_connect_errno_read(mysqli_object *obj, zval *retval)
{
ZVAL_LONG(retval, (zend_long)MyG(error_no));
return retval;
@@ -134,7 +134,7 @@ static zval *link_connect_errno_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_connect_error_read */
-static zval *link_connect_error_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_connect_error_read(mysqli_object *obj, zval *retval)
{
if (MyG(error_msg)) {
ZVAL_STRING(retval, MyG(error_msg));
@@ -146,7 +146,7 @@ static zval *link_connect_error_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_affected_rows_read */
-static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_affected_rows_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
my_ulonglong rc;
@@ -178,7 +178,7 @@ static zval *link_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property link_error_list_read */
-static zval *link_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_error_list_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
@@ -235,7 +235,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_M
MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT)
/* {{{ property link_stat_read */
-static zval *link_stat_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *link_stat_read(mysqli_object *obj, zval *retval)
{
MY_MYSQL *mysql;
@@ -269,7 +269,7 @@ static zval *link_stat_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* result properties */
/* {{{ property result_type_read */
-static zval *result_type_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *result_type_read(mysqli_object *obj, zval *retval)
{
MYSQL_RES *p;
@@ -286,7 +286,7 @@ static zval *result_type_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property result_lengths_read */
-static zval *result_lengths_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *result_lengths_read(mysqli_object *obj, zval *retval)
{
MYSQL_RES *p;
zend_ulong *ret;
@@ -317,7 +317,7 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(result_num_rows_read, mysql_num_rows, MYSQLI_GET_R
/* statement properties */
/* {{{ property stmt_id_read */
-static zval *stmt_id_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_id_read(mysqli_object *obj, zval *retval)
{
MY_STMT *p;
@@ -335,7 +335,7 @@ static zval *stmt_id_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property stmt_affected_rows_read */
-static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval)
{
MY_STMT *p;
my_ulonglong rc;
@@ -365,7 +365,7 @@ static zval *stmt_affected_rows_read(mysqli_object *obj, zval *retval TSRMLS_DC)
/* }}} */
/* {{{ property stmt_error_list_read */
-static zval *stmt_error_list_read(mysqli_object *obj, zval *retval TSRMLS_DC)
+static zval *stmt_error_list_read(mysqli_object *obj, zval *retval)
{
MY_STMT * stmt;
diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c
index ceec68efb4..bdd36b557d 100644
--- a/ext/mysqli/mysqli_report.c
+++ b/ext/mysqli/mysqli_report.c
@@ -27,7 +27,7 @@
#include "ext/standard/info.h"
#include "php_mysqli_structs.h"
-extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
+extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, ...);
/* {{{ proto bool mysqli_report(int flags)
sets report level */
@@ -36,7 +36,7 @@ PHP_FUNCTION(mysqli_report)
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -47,14 +47,14 @@ PHP_FUNCTION(mysqli_report)
/* }}} */
/* {{{ void php_mysqli_report_error(char *sqlstate, int errorno, char *error) */
-void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC)
+void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error)
{
- php_mysqli_throw_sql_exception((char *)sqlstate, errorno TSRMLS_CC, "%s", error);
+ php_mysqli_throw_sql_exception((char *)sqlstate, errorno, "%s", error);
}
/* }}} */
/* {{{ void php_mysqli_report_index() */
-void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
+void php_mysqli_report_index(const char *query, unsigned int status) {
char index[15];
if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) {
@@ -64,7 +64,7 @@ void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC) {
} else {
return;
}
- php_mysqli_throw_sql_exception("00000", 0 TSRMLS_CC, "%s used in query/prepared statement %s", index, query);
+ php_mysqli_throw_sql_exception("00000", 0, "%s used in query/prepared statement %s", index, query);
}
/* }}} */
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c
index 5caa926b47..db8fa1dc2a 100644
--- a/ext/mysqli/mysqli_result_iterator.c
+++ b/ext/mysqli/mysqli_result_iterator.c
@@ -44,7 +44,7 @@ typedef struct {
/* {{{ */
-zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
php_mysqli_result_iterator *iterator;
@@ -52,7 +52,7 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = ecalloc(1, sizeof(php_mysqli_result_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_mysqli_result_iterator_funcs;
@@ -64,7 +64,7 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*)iter;
@@ -75,7 +75,7 @@ static void php_mysqli_result_iterator_dtor(zend_object_iterator *iter TSRMLS_DC
/* }}} */
/* {{{ */
-static int php_mysqli_result_iterator_valid(zend_object_iterator *iter TSRMLS_DC)
+static int php_mysqli_result_iterator_valid(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -84,7 +84,7 @@ static int php_mysqli_result_iterator_valid(zend_object_iterator *iter TSRMLS_DC
/* }}} */
/* {{{ */
-static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -93,7 +93,7 @@ static zval *php_mysqli_result_iterator_current_data(zend_object_iterator *iter
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
@@ -103,7 +103,7 @@ static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter T
MYSQLI_FETCH_RESOURCE_BY_OBJ(result, MYSQL_RES *, intern, "mysqli_result", MYSQLI_STATUS_VALID);
zval_ptr_dtor(&iterator->current_row);
- php_mysqli_fetch_into_hash_aux(&iterator->current_row, result, MYSQLI_ASSOC TSRMLS_CC);
+ php_mysqli_fetch_into_hash_aux(&iterator->current_row, result, MYSQLI_ASSOC);
if (Z_TYPE(iterator->current_row) == IS_ARRAY) {
iterator->row_num++;
}
@@ -111,7 +111,7 @@ static void php_mysqli_result_iterator_move_forward(zend_object_iterator *iter T
/* }}} */
/* {{{ */
-static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
mysqli_object *intern = iterator->result;
@@ -125,19 +125,19 @@ static void php_mysqli_result_iterator_rewind(zend_object_iterator *iter TSRMLS_
#else
if (result->eof) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data fetched with MYSQLI_USE_RESULT can be iterated only once");
+ php_error_docref(NULL, E_WARNING, "Data fetched with MYSQLI_USE_RESULT can be iterated only once");
return;
}
} else {
mysql_data_seek(result, 0);
}
iterator->row_num = -1;
- php_mysqli_result_iterator_move_forward(iter TSRMLS_CC);
+ php_mysqli_result_iterator_move_forward(iter);
}
/* }}} */
/* {{{ php_mysqli_result_iterator_current_key */
-static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, zval *key)
{
php_mysqli_result_iterator *iterator = (php_mysqli_result_iterator*) iter;
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 084bc58581..db9c9dd5ee 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -53,7 +53,7 @@ void php_clear_warnings(MYSQLI_WARNING *w)
#ifndef MYSQLI_USE_MYSQLND
/* {{{ MYSQLI_WARNING *php_new_warning */
static
-MYSQLI_WARNING *php_new_warning(const char *reason, int errorno TSRMLS_DC)
+MYSQLI_WARNING *php_new_warning(const char *reason, int errorno)
{
MYSQLI_WARNING *w;
@@ -69,8 +69,8 @@ MYSQLI_WARNING *php_new_warning(const char *reason, int errorno TSRMLS_DC)
}
/* }}} */
-/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC) */
-MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
+/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */
+MYSQLI_WARNING *php_get_warnings(MYSQL *mysql)
{
MYSQLI_WARNING *w, *first = NULL, *prev = NULL;
MYSQL_RES *result;
@@ -83,7 +83,7 @@ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
result = mysql_store_result(mysql);
while ((row = mysql_fetch_row(result))) {
- w = php_new_warning(row[2], atoi(row[1]) TSRMLS_CC);
+ w = php_new_warning(row[2], atoi(row[1]));
if (!first) {
first = w;
}
@@ -99,7 +99,7 @@ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC)
#else
/* {{{ MYSQLI_WARNING *php_new_warning */
static
-MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno TSRMLS_DC)
+MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno)
{
MYSQLI_WARNING *w;
@@ -118,18 +118,18 @@ MYSQLI_WARNING *php_new_warning(const zval * reason, int errorno TSRMLS_DC)
}
/* }}} */
-/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql TSRMLS_DC) */
-MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
+/* {{{ MYSQLI_WARNING *php_get_warnings(MYSQL *mysql) */
+MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql)
{
MYSQLI_WARNING *w, *first = NULL, *prev = NULL;
MYSQL_RES *result;
zval row;
- if (mysql->m->query(mysql, "SHOW WARNINGS", 13 TSRMLS_CC)) {
+ if (mysql->m->query(mysql, "SHOW WARNINGS", 13)) {
return NULL;
}
- result = mysql->m->use_result(mysql, 0 TSRMLS_CC);
+ result = mysql->m->use_result(mysql, 0);
for (;;) {
zval *entry;
@@ -153,7 +153,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql TSRMLS_DC)
/* 2. Here comes the reason */
entry = zend_hash_get_current_data(Z_ARRVAL(row));
- w = php_new_warning(entry, errno TSRMLS_CC);
+ w = php_new_warning(entry, errno);
/*
Don't destroy entry, because the row destroy will decrease
the refcounter. Decreased twice then mysqlnd_free_result()
@@ -184,7 +184,7 @@ PHP_METHOD(mysqli_warning, next)
mysqli_object *obj = Z_MYSQLI_P(getThis());
if (obj->ptr) {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
&mysqli_warning, mysqli_warning_class_entry) == FAILURE) {
return;
}
@@ -203,7 +203,7 @@ PHP_METHOD(mysqli_warning, next)
/* {{{ property mysqli_warning_message */
static
-zval *mysqli_warning_message(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_message(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -219,7 +219,7 @@ zval *mysqli_warning_message(mysqli_object *obj, zval *retval TSRMLS_DC)
/* {{{ property mysqli_warning_sqlstate */
static
-zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -235,7 +235,7 @@ zval *mysqli_warning_sqlstate(mysqli_object *obj, zval *retval TSRMLS_DC)
/* {{{ property mysqli_warning_error */
static
-zval *mysqli_warning_errno(mysqli_object *obj, zval *retval TSRMLS_DC)
+zval *mysqli_warning_errno(mysqli_object *obj, zval *retval)
{
MYSQLI_WARNING *w;
@@ -262,7 +262,7 @@ PHP_METHOD(mysqli_warning, __construct)
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "o", &z)==FAILURE) {
+ if (zend_parse_parameters(1, "o", &z)==FAILURE) {
return;
}
obj = Z_MYSQLI_P(z);
@@ -272,12 +272,12 @@ PHP_METHOD(mysqli_warning, __construct)
MYSQLI_FETCH_RESOURCE_CONN(mysql, z, MYSQLI_STATUS_VALID);
if (mysql_warning_count(mysql->mysql)) {
#ifndef MYSQLI_USE_MYSQLND
- w = php_get_warnings(mysql->mysql TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql);
#else
- w = php_get_warnings(mysql->mysql->data TSRMLS_CC);
+ w = php_get_warnings(mysql->mysql->data);
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No warnings found");
+ php_error_docref(NULL, E_WARNING, "No warnings found");
RETURN_FALSE;
}
} else if (obj->zo.ce == mysqli_stmt_class_entry) {
@@ -286,17 +286,17 @@ PHP_METHOD(mysqli_warning, __construct)
#ifndef MYSQLI_USE_MYSQLND
hdl = mysqli_stmt_get_connection(stmt->stmt);
if (mysql_warning_count(hdl)) {
- w = php_get_warnings(hdl TSRMLS_CC);
+ w = php_get_warnings(hdl);
#else
if (mysqlnd_stmt_warning_count(stmt->stmt)) {
- w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt) TSRMLS_CC);
+ w = php_get_warnings(mysqli_stmt_get_connection(stmt->stmt));
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No warnings found");
+ php_error_docref(NULL, E_WARNING, "No warnings found");
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid class argument");
+ php_error_docref(NULL, E_WARNING, "invalid class argument");
RETURN_FALSE;
}
@@ -304,7 +304,7 @@ PHP_METHOD(mysqli_warning, __construct)
mysqli_resource->ptr = mysqli_resource->info = (void *)w;
mysqli_resource->status = MYSQLI_STATUS_VALID;
- if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) {
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry)) {
MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
} else {
(Z_MYSQLI_P(getThis()))->ptr = mysqli_resource;
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index cf12c5bba5..673440e093 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -164,8 +164,8 @@ struct st_mysqli_warning {
typedef struct _mysqli_property_entry {
const char *pname;
size_t pname_length;
- zval *(*r_func)(mysqli_object *obj, zval *retval TSRMLS_DC);
- int (*w_func)(mysqli_object *obj, zval *value TSRMLS_DC);
+ zval *(*r_func)(mysqli_object *obj, zval *retval);
+ int (*w_func)(mysqli_object *obj, zval *value);
} mysqli_property_entry;
typedef struct {
@@ -209,12 +209,12 @@ extern zend_class_entry *mysqli_exception_class_entry;
extern int php_le_pmysqli(void);
extern void php_mysqli_dtor_p_elements(void *data);
-extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status TSRMLS_DC);
+extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
extern zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
-extern zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+extern zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype TSRMLS_DC);
+extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype);
#ifdef HAVE_SPL
extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
@@ -234,22 +234,22 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
zend_class_entry ce; \
INIT_CLASS_ENTRY(ce, name,class_functions); \
ce.create_object = mysqli_objects_new; \
- mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
+ mysqli_entry = zend_register_internal_class(&ce); \
} \
#define MYSQLI_REGISTER_RESOURCE_EX(__ptr, __zval) \
(Z_MYSQLI_P(__zval))->ptr = __ptr;
#define MYSQLI_RETURN_RESOURCE(__ptr, __ce) \
- RETVAL_OBJ(mysqli_objects_new(__ce TSRMLS_CC)); \
+ RETVAL_OBJ(mysqli_objects_new(__ce)); \
MYSQLI_REGISTER_RESOURCE_EX(__ptr, return_value)
#define MYSQLI_REGISTER_RESOURCE(__ptr, __ce) \
{\
zval *object = getThis(); \
- if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry TSRMLS_CC)) { \
+ if (!object || !instanceof_function(Z_OBJCE_P(object), mysqli_link_class_entry)) { \
object = return_value; \
- ZVAL_OBJ(object, mysqli_objects_new(__ce TSRMLS_CC)); \
+ ZVAL_OBJ(object, mysqli_objects_new(__ce)); \
} \
MYSQLI_REGISTER_RESOURCE_EX(__ptr, object)\
}
@@ -259,12 +259,12 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_RESOURCE *my_res; \
mysqli_object *intern = Z_MYSQLI_P(__id); \
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
RETURN_NULL();\
}\
__ptr = (__type)my_res->ptr; \
if (__check && my_res->status < __check) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL();\
}\
}
@@ -273,12 +273,12 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
{ \
MYSQLI_RESOURCE *my_res; \
if (!(my_res = (MYSQLI_RESOURCE *)(__obj->ptr))) {\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
+ php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", intern->zo.ce->name->val);\
return;\
}\
__ptr = (__type)my_res->ptr; \
if (__check && my_res->status < __check) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
return;\
}\
}
@@ -288,7 +288,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_FETCH_RESOURCE((__ptr), MY_MYSQL *, (__id), "mysqli_link", (__check)); \
if (!(__ptr)->mysql) { \
mysqli_object *intern = Z_MYSQLI_P(__id); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL(); \
} \
}
@@ -298,7 +298,7 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
MYSQLI_FETCH_RESOURCE((__ptr), MY_STMT *, (__id), "mysqli_stmt", (__check)); \
if (!(__ptr)->stmt) { \
mysqli_object *intern = Z_MYSQLI_P(__id); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
+ php_error_docref(NULL, E_WARNING, "invalid object or resource %s\n", intern->zo.ce->name->val); \
RETURN_NULL();\
} \
}
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 08a10dbbd1..f779e6a5b0 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -67,7 +67,7 @@ PHPAPI MYSQLND_STATS *mysqlnd_global_stats = NULL;
/* {{{ mysqlnd_conn_data::free_options */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn)
{
zend_bool pers = conn->persistent;
@@ -107,19 +107,19 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_options)(MYSQLND_CONN_DATA * conn TSRMLS_
/* {{{ mysqlnd_conn_data::free_contents */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn)
{
zend_bool pers = conn->persistent;
DBG_ENTER("mysqlnd_conn_data::free_contents");
if (conn->current_result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
conn->current_result = NULL;
}
if (conn->net) {
- conn->net->data->m.free_contents(conn->net TSRMLS_CC);
+ conn->net->data->m.free_contents(conn->net);
}
DBG_INF("Freeing memory of members");
@@ -180,21 +180,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn TSRMLS
/* {{{ mysqlnd_conn_data::dtor */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::dtor");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- conn->m->free_contents(conn TSRMLS_CC);
- conn->m->free_options(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
+ conn->m->free_options(conn);
if (conn->net) {
- mysqlnd_net_free(conn->net, conn->stats, conn->error_info TSRMLS_CC);
+ mysqlnd_net_free(conn->net, conn->stats, conn->error_info);
conn->net = NULL;
}
if (conn->protocol) {
- mysqlnd_protocol_free(conn->protocol TSRMLS_CC);
+ mysqlnd_protocol_free(conn->protocol);
conn->protocol = NULL;
}
@@ -213,7 +213,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, dtor)(MYSQLND_CONN_DATA * conn TSRMLS_
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet,
zend_bool silent, enum php_mysqlnd_server_command command,
- zend_bool ignore_upsert_status TSRMLS_DC)
+ zend_bool ignore_upsert_status)
{
enum_func_status ret = FAIL;
@@ -222,7 +222,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
switch (ok_packet) {
case PROT_OK_PACKET:{
- MYSQLND_PACKET_OK * ok_response = conn->protocol->m.get_ok_packet(conn->protocol, FALSE TSRMLS_CC);
+ MYSQLND_PACKET_OK * ok_response = conn->protocol->m.get_ok_packet(conn->protocol, FALSE);
if (!ok_response) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -230,7 +230,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
if (FAIL == (ret = PACKET_READ(ok_response, conn))) {
if (!silent) {
DBG_ERR_FMT("Error while reading %s's OK packet", mysqlnd_command_to_text[command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's OK packet. PID=%u",
+ php_error_docref(NULL, E_WARNING, "Error while reading %s's OK packet. PID=%u",
mysqlnd_command_to_text[command], getpid());
}
} else {
@@ -268,7 +268,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
break;
}
case PROT_EOF_PACKET:{
- MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
+ MYSQLND_PACKET_EOF * ok_response = conn->protocol->m.get_eof_packet(conn->protocol, FALSE);
if (!ok_response) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -278,7 +278,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
"Malformed packet");
if (!silent) {
DBG_ERR_FMT("Error while reading %s's EOF packet", mysqlnd_command_to_text[command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading %s's EOF packet. PID=%d",
+ php_error_docref(NULL, E_WARNING, "Error while reading %s's EOF packet. PID=%d",
mysqlnd_command_to_text[command], getpid());
}
} else if (0xFF == ok_response->field_count) {
@@ -289,7 +289,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
SET_CLIENT_ERROR(*conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet");
if (!silent) {
DBG_ERR_FMT("EOF packet expected, field count wasn't 0xFE but 0x%2X", ok_response->field_count);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet expected, field count wasn't 0xFE but 0x%2X",
+ php_error_docref(NULL, E_WARNING, "EOF packet expected, field count wasn't 0xFE but 0x%2X",
ok_response->field_count);
}
} else {
@@ -300,7 +300,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
}
default:
SET_CLIENT_ERROR(*conn->error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet");
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong response packet %u passed to the function", ok_packet);
+ php_error_docref(NULL, E_ERROR, "Wrong response packet %u passed to the function", ok_packet);
break;
}
DBG_INF(ret == PASS ? "PASS":"FAIL");
@@ -312,7 +312,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
/* {{{ mysqlnd_conn_data::simple_command_send_request */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
- const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC)
+ const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status)
{
enum_func_status ret = PASS;
MYSQLND_PACKET_COMMAND * cmd_packet;
@@ -338,7 +338,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
SET_ERROR_AFF_ROWS(conn);
SET_EMPTY_ERROR(*conn->error_info);
- cmd_packet = conn->protocol->m.get_command_packet(conn->protocol, FALSE TSRMLS_CC);
+ cmd_packet = conn->protocol->m.get_command_packet(conn->protocol, FALSE);
if (!cmd_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -358,7 +358,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
php_error(E_WARNING, "Error while sending %s packet. PID=%d", mysqlnd_command_to_text[command], getpid());
}
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
DBG_ERR("Server is gone");
ret = FAIL;
}
@@ -372,14 +372,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent,
- zend_bool ignore_upsert_status TSRMLS_DC)
+ zend_bool ignore_upsert_status)
{
enum_func_status ret;
DBG_ENTER("mysqlnd_conn_data::simple_command");
- ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status TSRMLS_CC);
+ ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status);
if (PASS == ret && ok_packet != PROT_LAST) {
- ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status TSRMLS_CC);
+ ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status);
}
DBG_INF(ret == PASS ? "PASS":"FAIL");
@@ -390,18 +390,18 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum
/* {{{ mysqlnd_conn_data::set_server_option */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_server_option);
zend_uchar buffer[2];
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::set_server_option");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int2store(buffer, (unsigned int) option);
- ret = conn->m->simple_command(conn, COM_SET_OPTION, buffer, sizeof(buffer), PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_SET_OPTION, buffer, sizeof(buffer), PROT_EOF_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -410,7 +410,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::restart_psession */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::restart_psession");
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_REUSED);
@@ -426,7 +426,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, restart_psession)(MYSQLND_CONN_DATA * conn TSR
/* {{{ mysqlnd_conn_data::end_psession */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::end_psession");
DBG_RETURN(PASS);
@@ -474,7 +474,7 @@ mysqlnd_switch_to_ssl_if_needed(
DBG_INF_FMT("CLIENT_SSL_VERIFY_SERVER_CERT= %d", mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? 1:0);
DBG_INF_FMT("CLIENT_REMEMBER_OPTIONS= %d", mysql_flags & CLIENT_REMEMBER_OPTIONS? 1:0);
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -494,14 +494,14 @@ mysqlnd_switch_to_ssl_if_needed(
DBG_INF("Switching to SSL");
if (!PACKET_WRITE(auth_packet, conn)) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
goto end;
}
- conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
+ conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify);
- if (FAIL == conn->net->data->m.enable_ssl(conn->net TSRMLS_CC)) {
+ if (FAIL == conn->net->data->m.enable_ssl(conn->net)) {
goto end;
}
}
@@ -516,7 +516,7 @@ end:
/* {{{ mysqlnd_conn_data::fetch_auth_plugin_by_name */
static struct st_mysqlnd_authentication_plugin *
-MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol)
{
struct st_mysqlnd_authentication_plugin * auth_plugin;
char * plugin_name = NULL;
@@ -576,10 +576,10 @@ mysqlnd_run_authentication(
}
do {
- struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol TSRMLS_CC);
+ struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol);
if (!auth_plugin) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
+ php_error_docref(NULL, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method unknown to the client");
goto end;
}
@@ -610,7 +610,7 @@ mysqlnd_run_authentication(
/* The data should be allocated with malloc() */
scrambled_data =
auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
- plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags TSRMLS_CC);
+ plugin_data, plugin_data_len, options, &conn->net->data->options, mysql_flags);
if (conn->error_info->error_no) {
goto end;
}
@@ -630,7 +630,7 @@ mysqlnd_run_authentication(
scrambled_data, scrambled_data_len,
&switch_to_auth_protocol, &switch_to_auth_protocol_len,
&switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
- TSRMLS_CC);
+ );
}
first_call = FALSE;
free(scrambled_data);
@@ -652,7 +652,7 @@ mysqlnd_run_authentication(
if (ret == PASS) {
DBG_INF_FMT("saving requested_protocol=%s", requested_protocol);
- conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
+ conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol);
}
end:
if (plugin_data) {
@@ -684,11 +684,11 @@ mysqlnd_connect_run_authentication(
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_connect_run_authentication");
- ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC);
+ ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags);
if (PASS == ret) {
ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len,
greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol,
- greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/ TSRMLS_CC);
+ greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/);
}
DBG_RETURN(ret);
}
@@ -697,7 +697,7 @@ mysqlnd_connect_run_authentication(
/* {{{ mysqlnd_conn_data::execute_init_commands */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn)
{
enum_func_status ret = PASS;
@@ -708,15 +708,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * con
const char * const command = conn->options->init_commands[current_command];
if (command) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT);
- if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) {
+ if (PASS != conn->m->query(conn, command, strlen(command))) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT);
ret = FAIL;
break;
}
if (conn->last_query_type == QUERY_SELECT) {
- MYSQLND_RES * result = conn->m->use_result(conn, 0 TSRMLS_CC);
+ MYSQLND_RES * result = conn->m->use_result(conn, 0);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
}
}
@@ -729,7 +729,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::get_updated_connect_flags */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags)
{
MYSQLND_NET * net = conn->net;
@@ -775,30 +775,30 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
const char * const host, const char * const user,
const char * const passwd, const unsigned int passwd_len,
const char * const db, const unsigned int db_len,
- const unsigned int mysql_flags TSRMLS_DC)
+ const unsigned int mysql_flags)
{
MYSQLND_PACKET_GREET * greet_packet;
MYSQLND_NET * net = conn->net;
DBG_ENTER("mysqlnd_conn_data::connect_handshake");
- greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE TSRMLS_CC);
+ greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE);
if (!greet_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL); /* OOM */
}
if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
- conn->stats, conn->error_info TSRMLS_CC))
+ conn->stats, conn->error_info))
{
goto err;
}
- DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC));
+ DBG_INF_FMT("stream=%p", net->data->m.get_stream(net));
if (FAIL == PACKET_READ(greet_packet, conn)) {
DBG_ERR("Error while reading greeting packet");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
+ php_error_docref(NULL, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
goto err;
} else if (greet_packet->error_no) {
DBG_ERR_FMT("errorno=%u error=%s", greet_packet->error_no, greet_packet->error);
@@ -806,7 +806,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
goto err;
} else if (greet_packet->pre41) {
DBG_ERR_FMT("Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet->server_version);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
+ php_error_docref(NULL, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
" is not supported. Server is %-.32s", greet_packet->server_version);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
"Connecting to 3.22, 3.23 & 4.0 servers is not supported");
@@ -819,7 +819,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
if (!conn->greet_charset) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet->charset_no);
SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
"Server sent charset unknown to the client. Please, report to the developers");
@@ -830,7 +830,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
conn->server_capabilities = greet_packet->server_capabilities;
if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len,
- greet_packet, conn->options, mysql_flags TSRMLS_CC))
+ greet_packet, conn->options, mysql_flags))
{
goto err;
}
@@ -859,7 +859,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
unsigned int port,
const char *socket_or_pipe,
unsigned int mysql_flags
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect);
size_t host_len;
@@ -873,7 +873,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_conn_data::connect");
DBG_INF_FMT("conn=%p", conn);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto err;
}
local_tx_started = TRUE;
@@ -891,10 +891,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
if (CONN_GET_STATE(conn) < CONN_QUIT_SENT) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CLOSE_IMPLICIT);
reconnect = TRUE;
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
}
- conn->m->free_contents(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_CONNECTIONS);
if (conn->persistent) {
MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_PERSISTENT_CONNECTIONS);
@@ -914,7 +914,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
}
} else {
unsigned int max_allowed_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE;
- conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size TSRMLS_CC);
+ conn->m->set_client_option(conn, MYSQLND_OPT_MAX_ALLOWED_PACKET, (char *)&max_allowed_size);
}
if (!host || !host[0]) {
@@ -978,9 +978,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
}
}
- mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags TSRMLS_CC);
+ mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags);
- if (FAIL == conn->m->connect_handshake(conn, host, user, passwd, passwd_len, db, db_len, mysql_flags TSRMLS_CC)) {
+ if (FAIL == conn->m->connect_handshake(conn, host, user, passwd, passwd_len, db, db_len, mysql_flags)) {
goto err;
}
@@ -1049,7 +1049,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
goto err; /* OOM */
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Impossible. Should be either socket or a pipe. Report a bug!");
+ php_error_docref(NULL, E_WARNING, "Impossible. Should be either socket or a pipe. Report a bug!");
}
if (!conn->unix_socket || !conn->host_info) {
SET_OOM_ERROR(*conn->error_info);
@@ -1064,7 +1064,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
mysqlnd_local_infile_default(conn);
- if (FAIL == conn->m->execute_init_commands(conn TSRMLS_CC)) {
+ if (FAIL == conn->m->execute_init_commands(conn)) {
goto err;
}
@@ -1078,7 +1078,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
DBG_INF_FMT("connection_id=%llu", conn->thread_id);
- conn->m->local_tx_end(conn, this_func, PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, PASS);
DBG_RETURN(PASS);
}
err:
@@ -1086,14 +1086,14 @@ err:
DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme);
if (!conn->error_info->error_no) {
SET_CLIENT_ERROR(*conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, conn->error_info->error? conn->error_info->error:"Unknown error");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%u] %.128s (trying to connect via %s)",
+ php_error_docref(NULL, E_WARNING, "[%u] %.128s (trying to connect via %s)",
conn->error_info->error_no, conn->error_info->error, conn->scheme);
}
- conn->m->free_contents(conn TSRMLS_CC);
+ conn->m->free_contents(conn);
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_FAILURE);
if (TRUE == local_tx_started) {
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
}
DBG_RETURN(FAIL);
@@ -1110,7 +1110,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
unsigned int port,
const char * socket_or_pipe,
unsigned int mysql_flags
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect);
enum_func_status ret = FAIL;
@@ -1118,11 +1118,11 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
DBG_ENTER("mysqlnd_conn::connect");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd");
- ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
+ ret = conn->m->connect(conn, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
}
DBG_RETURN(ret);
}
@@ -1138,7 +1138,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
const char * socket_or_pipe,
unsigned int mysql_flags,
unsigned int client_api_flags
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
zend_bool self_alloced = FALSE;
@@ -1154,7 +1154,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
}
}
- ret = conn_handle->m->connect(conn_handle, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags TSRMLS_CC);
+ ret = conn_handle->m->connect(conn_handle, host, user, passwd, passwd_len, db, db_len, port, socket_or_pipe, mysql_flags);
if (ret == FAIL) {
if (self_alloced) {
@@ -1162,7 +1162,7 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
We have alloced, thus there are no references to this
object - we are free to kill it!
*/
- conn_handle->m->dtor(conn_handle TSRMLS_CC);
+ conn_handle->m->dtor(conn_handle);
}
DBG_RETURN(NULL);
}
@@ -1177,23 +1177,23 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,
Still the result from the query is PASS
*/
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, query);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::query");
DBG_INF_FMT("conn=%p conn=%llu query=%s", conn, conn->thread_id, query);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- if (PASS == conn->m->send_query(conn, query, query_len TSRMLS_CC) &&
- PASS == conn->m->reap_query(conn TSRMLS_CC))
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ if (PASS == conn->m->send_query(conn, query, query_len) &&
+ PASS == conn->m->reap_query(conn))
{
ret = PASS;
if (conn->last_query_type == QUERY_UPSERT && conn->upsert_status->affected_rows) {
MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status->affected_rows);
}
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1202,7 +1202,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char *
/* {{{ mysqlnd_conn_data::send_query */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query);
enum_func_status ret = FAIL;
@@ -1210,14 +1210,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch
DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query);
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
ret = conn->m->simple_command(conn, COM_QUERY, (zend_uchar *) query, query_len,
PROT_LAST /* we will handle the OK packet*/,
- FALSE, FALSE TSRMLS_CC);
+ FALSE, FALSE);
if (PASS == ret) {
CONN_SET_STATE(conn, CONN_QUERY_SENT);
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(ret);
@@ -1227,7 +1227,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch
/* {{{ mysqlnd_conn_data::reap_query */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, reap_query);
enum_mysqlnd_connection_state state = CONN_GET_STATE(conn);
@@ -1236,15 +1236,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC
DBG_INF_FMT("conn=%llu", conn->thread_id);
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (state <= CONN_READY || state == CONN_QUIT_SENT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection not opened, clear or has been closed");
+ php_error_docref(NULL, E_WARNING, "Connection not opened, clear or has been closed");
DBG_ERR_FMT("Connection not opened, clear or has been closed. State=%u", state);
DBG_RETURN(ret);
}
- ret = conn->m->query_read_result_set_header(conn, NULL TSRMLS_CC);
+ ret = conn->m->query_read_result_set_header(conn, NULL);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(ret);
@@ -1255,7 +1255,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC
#include "php_network.h"
/* {{{ mysqlnd_stream_array_to_fd_set */
-MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC)
+MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array)
{
int cnt = 0;
MYSQLND **p = conn_array, **p_p;
@@ -1289,7 +1289,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
/* {{{ mysqlnd_stream_array_to_fd_set */
-static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC)
+static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd)
{
php_socket_t this_fd;
php_stream *stream = NULL;
@@ -1303,7 +1303,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
* when casting. It is only used here so that the buffered data warning
* is not displayed.
* */
- stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC);
+ stream = (*p)->data->net->data->m.get_stream((*p)->data->net);
DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
(void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
@@ -1323,7 +1323,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
/* {{{ mysqlnd_stream_array_from_fd_set */
-static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC)
+static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds)
{
php_socket_t this_fd;
php_stream *stream = NULL;
@@ -1333,7 +1333,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
DBG_ENTER("mysqlnd_stream_array_from_fd_set");
while (*fwd) {
- stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC);
+ stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net);
DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
(void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
@@ -1366,7 +1366,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
/* {{{ _mysqlnd_poll */
PHPAPI enum_func_status
-_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC)
+_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num)
{
struct timeval tv;
struct timeval *tv_p = NULL;
@@ -1377,7 +1377,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
DBG_ENTER("_mysqlnd_poll");
if (sec < 0 || usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative values passed for sec and/or usec");
+ php_error_docref(NULL, E_WARNING, "Negative values passed for sec and/or usec");
DBG_RETURN(FAIL);
}
@@ -1386,8 +1386,8 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
FD_ZERO(&efds);
if (r_array != NULL) {
- *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array TSRMLS_CC);
- set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
+ *dont_poll = mysqlnd_stream_array_check_for_readiness(r_array);
+ set_count = mysqlnd_stream_array_to_fd_set(r_array, &rfds, &max_fd);
if (set_count > max_set_count) {
max_set_count = set_count;
}
@@ -1395,7 +1395,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
}
if (e_array != NULL) {
- set_count = mysqlnd_stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ set_count = mysqlnd_stream_array_to_fd_set(e_array, &efds, &max_fd);
if (set_count > max_set_count) {
max_set_count = set_count;
}
@@ -1403,7 +1403,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
}
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, *dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, *dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
DBG_ERR_FMT(*dont_poll ? "All arrays passed are clear":"No stream arrays were passed");
DBG_RETURN(FAIL);
}
@@ -1424,16 +1424,16 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
retval = php_select(max_fd + 1, &rfds, &wfds, &efds, tv_p);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
errno, strerror(errno), max_fd);
DBG_RETURN(FAIL);
}
if (r_array != NULL) {
- mysqlnd_stream_array_from_fd_set(r_array, &rfds TSRMLS_CC);
+ mysqlnd_stream_array_from_fd_set(r_array, &rfds);
}
if (e_array != NULL) {
- mysqlnd_stream_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ mysqlnd_stream_array_from_fd_set(e_array, &efds);
}
*desc_num = retval;
@@ -1451,7 +1451,7 @@ _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long s
/* {{{ mysqlnd_conn_data::list_fields */
MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_fields);
/* db + \0 + wild + \0 (for wild) */
@@ -1461,7 +1461,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
DBG_ENTER("mysqlnd_conn_data::list_fields");
DBG_INF_FMT("conn=%llu table=%s wild=%s", conn->thread_id, table? table:"",achtung_wild? achtung_wild:"");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
p = buff;
if (table && (table_len = strlen(table))) {
@@ -1480,8 +1480,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
if (PASS != conn->m->simple_command(conn, COM_FIELD_LIST, buff, p - buff,
PROT_LAST /* we will handle the OK packet*/,
- FALSE, TRUE TSRMLS_CC)) {
- conn->m->local_tx_end(conn, 0, FAIL TSRMLS_CC);
+ FALSE, TRUE)) {
+ conn->m->local_tx_end(conn, 0, FAIL);
break;
}
@@ -1489,30 +1489,30 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
Prepare for the worst case.
MyISAM goes to 2500 BIT columns, double it for safety.
*/
- result = conn->m->result_init(5000, conn->persistent TSRMLS_CC);
+ result = conn->m->result_init(5000, conn->persistent);
if (!result) {
break;
}
- if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) {
+ if (FAIL == result->m.read_result_metadata(result, conn)) {
DBG_ERR("Error occurred while reading metadata");
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
result = NULL;
break;
}
result->type = MYSQLND_RES_NORMAL;
- result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, FALSE, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, FALSE, result->persistent);
if (!result->unbuf) {
/* OOM */
SET_OOM_ERROR(*conn->error_info);
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
result = NULL;
break;
}
result->unbuf->eof_reached = TRUE;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
@@ -1522,7 +1522,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
/* {{{ mysqlnd_conn_data::list_method */
MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char *achtung_wild, char *par1 TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char *achtung_wild, char *par1)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_method);
char * show_query = NULL;
@@ -1532,7 +1532,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
DBG_ENTER("mysqlnd_conn_data::list_method");
DBG_INF_FMT("conn=%llu query=%s wild=%u", conn->thread_id, query, achtung_wild);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (par1) {
if (achtung_wild) {
show_query_len = mnd_sprintf(&show_query, 0, query, par1, achtung_wild);
@@ -1547,13 +1547,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
}
}
- if (PASS == conn->m->query(conn, show_query, show_query_len TSRMLS_CC)) {
- result = conn->m->store_result(conn, MYSQLND_STORE_NO_COPY TSRMLS_CC);
+ if (PASS == conn->m->query(conn, show_query, show_query_len)) {
+ result = conn->m->store_result(conn, MYSQLND_STORE_NO_COPY);
}
if (show_query != query) {
mnd_sprintf_free(show_query);
}
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
}
@@ -1562,7 +1562,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const c
/* {{{ mysqlnd_conn_data::errno */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->error_no;
}
@@ -1571,7 +1571,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, errno)(const MYSQLND_CONN_DATA * const conn TS
/* {{{ mysqlnd_conn_data::error */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->error;
}
@@ -1580,7 +1580,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, error)(const MYSQLND_CONN_DATA * const conn TS
/* {{{ mysqlnd_conn_data::sqlstate */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn)
{
return conn->error_info->sqlstate[0] ? conn->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
}
@@ -1589,10 +1589,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn
/* {{{ mysqlnd_old_escape_string */
PHPAPI zend_ulong
-mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC)
+mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len)
{
DBG_ENTER("mysqlnd_old_escape_string");
- DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name("latin1"), newstr, escapestr, escapestr_len TSRMLS_CC));
+ DBG_RETURN(mysqlnd_cset_escape_slashes(mysqlnd_find_charset_name("latin1"), newstr, escapestr, escapestr_len));
}
/* }}} */
@@ -1600,21 +1600,21 @@ mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapest
/* {{{ mysqlnd_conn_data::ssl_set */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert,
- const char * const ca, const char * const capath, const char * const cipher TSRMLS_DC)
+ const char * const ca, const char * const capath, const char * const cipher)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ssl_set);
enum_func_status ret = FAIL;
MYSQLND_NET * net = conn->net;
DBG_ENTER("mysqlnd_conn_data::ssl_set");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = (PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
- PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = (PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_KEY, key) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CERT, cert) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CA, ca) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CAPATH, capath) &&
+ PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CIPHER, cipher)) ? PASS : FAIL;
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1623,21 +1623,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const
/* {{{ mysqlnd_conn_data::escape_string */
static zend_ulong
-MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string);
zend_ulong ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::escape_string");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
DBG_INF_FMT("server_status=%u", conn->upsert_status->server_status);
if (conn->upsert_status->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) {
- ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len TSRMLS_CC);
+ ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len);
} else {
- ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len TSRMLS_CC);
+ ret = mysqlnd_cset_escape_slashes(conn->charset, newstr, escapestr, escapestr_len);
}
- conn->m->local_tx_end(conn, this_func, PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, PASS);
}
DBG_RETURN(ret);
}
@@ -1646,16 +1646,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn,
/* {{{ mysqlnd_conn_data::dump_debug_info */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, server_dump_debug_information);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::dump_debug_info");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_DEBUG, NULL, 0, PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_DEBUG, NULL, 0, PROT_EOF_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -1665,7 +1665,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::select_db */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, select_db);
enum_func_status ret = FAIL;
@@ -1673,8 +1673,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
DBG_ENTER("mysqlnd_conn_data::select_db");
DBG_INF_FMT("conn=%llu db=%s", conn->thread_id, db);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_INIT_DB, (zend_uchar*) db, db_len, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_INIT_DB, (zend_uchar*) db, db_len, PROT_OK_PACKET, FALSE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
@@ -1692,7 +1692,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
ret = FAIL;
}
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1701,7 +1701,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con
/* {{{ mysqlnd_conn_data::ping */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ping);
enum_func_status ret = FAIL;
@@ -1709,15 +1709,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC
DBG_ENTER("mysqlnd_conn_data::ping");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->simple_command(conn, COM_PING, NULL, 0, PROT_OK_PACKET, TRUE, TRUE TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->simple_command(conn, COM_PING, NULL, 0, PROT_OK_PACKET, TRUE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
*/
SET_ERROR_AFF_ROWS(conn);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF_FMT("ret=%u", ret);
DBG_RETURN(ret);
@@ -1727,7 +1727,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC
/* {{{ mysqlnd_conn_data::statistic */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, get_server_statistics);
enum_func_status ret = FAIL;
@@ -1736,13 +1736,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
DBG_ENTER("mysqlnd_conn_data::statistic");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
- ret = conn->m->simple_command(conn, COM_STATISTICS, NULL, 0, PROT_LAST, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_STATISTICS, NULL, 0, PROT_LAST, FALSE, TRUE);
if (FAIL == ret) {
break;
}
- stats_header = conn->protocol->m.get_stats_packet(conn->protocol, FALSE TSRMLS_CC);
+ stats_header = conn->protocol->m.get_stats_packet(conn->protocol, FALSE);
if (!stats_header) {
SET_OOM_ERROR(*conn->error_info);
break;
@@ -1756,7 +1756,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
PACKET_FREE(stats_header);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1765,7 +1765,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri
/* {{{ mysqlnd_conn_data::kill */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, kill_connection);
enum_func_status ret = FAIL;
@@ -1774,23 +1774,23 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p
DBG_ENTER("mysqlnd_conn_data::kill");
DBG_INF_FMT("conn=%llu pid=%u", conn->thread_id, pid);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int4store(buff, pid);
/* If we kill ourselves don't expect OK packet, PROT_LAST will skip it */
if (pid != conn->thread_id) {
- ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_OK_PACKET, FALSE, TRUE);
/*
The server sends 0 but libmysql doesn't read it and has established
a protocol of giving back -1. Thus we have to follow it :(
*/
SET_ERROR_AFF_ROWS(conn);
- } else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE TSRMLS_CC))) {
+ } else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE))) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1799,7 +1799,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p
/* {{{ mysqlnd_conn_data::set_charset */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const csname TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const csname)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_charset);
enum_func_status ret = FAIL;
@@ -1814,12 +1814,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
DBG_RETURN(ret);
}
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
char * query;
size_t query_len = mnd_sprintf(&query, 0, "SET NAMES %s", csname);
- if (FAIL == (ret = conn->m->query(conn, query, query_len TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error executing query");
+ if (FAIL == (ret = conn->m->query(conn, query, query_len))) {
+ php_error_docref(NULL, E_WARNING, "Error executing query");
} else if (conn->error_info->error_no) {
ret = FAIL;
} else {
@@ -1827,7 +1827,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
}
mnd_sprintf_free(query);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_INF(ret == PASS? "PASS":"FAIL");
@@ -1838,7 +1838,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c
/* {{{ mysqlnd_conn_data::refresh */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, refresh_server);
enum_func_status ret = FAIL;
@@ -1846,12 +1846,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8
DBG_ENTER("mysqlnd_conn_data::refresh");
DBG_INF_FMT("conn=%llu options=%lu", conn->thread_id, options);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int1store(bits, options);
- ret = conn->m->simple_command(conn, COM_REFRESH, bits, 1, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_REFRESH, bits, 1, PROT_OK_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1860,7 +1860,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8
/* {{{ mysqlnd_conn_data::shutdown */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, shutdown_server);
enum_func_status ret = FAIL;
@@ -1868,12 +1868,12 @@ MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint
DBG_ENTER("mysqlnd_conn_data::shutdown");
DBG_INF_FMT("conn=%llu level=%lu", conn->thread_id, level);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
int1store(bits, level);
- ret = conn->m->simple_command(conn, COM_SHUTDOWN, bits, 1, PROT_OK_PACKET, FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_SHUTDOWN, bits, 1, PROT_OK_PACKET, FALSE, TRUE);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
}
@@ -1882,11 +1882,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint
/* {{{ mysqlnd_send_close */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn)
{
enum_func_status ret = PASS;
MYSQLND_NET * net = conn->net;
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
enum mysqlnd_connection_state state;
DBG_ENTER("mysqlnd_send_close");
@@ -1904,8 +1904,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
case CONN_READY:
DBG_INF("Connection clean, sending COM_QUIT");
if (net_stream) {
- ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE TSRMLS_CC);
- net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
+ ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE);
+ net->data->m.close_stream(net, conn->stats, conn->error_info);
}
CONN_SET_STATE(conn, CONN_QUIT_SENT);
break;
@@ -1935,7 +1935,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
/* Fall-through */
case CONN_QUIT_SENT:
/* The user has killed its own connection */
- net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
+ net->data->m.close_stream(net, conn->stats, conn->error_info);
break;
}
@@ -1946,7 +1946,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
/* {{{ mysqlnd_conn_data::get_reference */
static MYSQLND_CONN_DATA *
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_reference");
++conn->refcount;
@@ -1958,7 +1958,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_reference)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::free_reference */
static enum_func_status
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * const conn)
{
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::free_reference");
@@ -1969,8 +1969,8 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * co
This will free the object too, of course because references has
reached zero.
*/
- ret = conn->m->send_close(conn TSRMLS_CC);
- conn->m->dtor(conn TSRMLS_CC);
+ ret = conn->m->send_close(conn);
+ conn->m->dtor(conn);
}
DBG_RETURN(ret);
}
@@ -1979,7 +1979,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, free_reference)(MYSQLND_CONN_DATA * co
/* {{{ mysqlnd_conn_data::get_state */
static enum mysqlnd_connection_state
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_state");
DBG_RETURN(conn->state);
@@ -1989,7 +1989,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, get_state)(const MYSQLND_CONN_DATA * c
/* {{{ mysqlnd_conn_data::set_state */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state)
{
DBG_ENTER("mysqlnd_conn_data::set_state");
DBG_INF_FMT("New state=%u", new_state);
@@ -2001,7 +2001,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn_data, set_state)(MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::field_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const conn)
{
return conn->field_count;
}
@@ -2010,7 +2010,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, field_count)(const MYSQLND_CONN_DATA * const c
/* {{{ mysqlnd_conn_data::server_status */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->server_status;
}
@@ -2019,7 +2019,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, server_status)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::insert_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->last_insert_id;
}
@@ -2028,7 +2028,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, insert_id)(const MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::affected_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->affected_rows;
}
@@ -2037,7 +2037,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, affected_rows)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::warning_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const conn)
{
return conn->upsert_status->warning_count;
}
@@ -2046,7 +2046,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, warning_count)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->last_message;
}
@@ -2070,7 +2070,7 @@ PHPAPI unsigned int mysqlnd_get_client_version()
/* {{{ mysqlnd_conn_data::get_server_info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->server_version;
}
@@ -2079,7 +2079,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_info)(const MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::get_host_info */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->host_info;
}
@@ -2088,7 +2088,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_host_info)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::get_proto_info */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * const conn)
{
return conn->protocol_version;
}
@@ -2097,7 +2097,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_proto_info)(const MYSQLND_CONN_DATA * cons
/* {{{ mysqlnd_conn_data::charset_name */
static const char *
-MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const conn)
{
return conn->charset->name;
}
@@ -2106,7 +2106,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, charset_name)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::thread_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const conn)
{
return conn->thread_id;
}
@@ -2115,7 +2115,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, thread_id)(const MYSQLND_CONN_DATA * const con
/* {{{ mysqlnd_conn_data::get_server_version */
static zend_ulong
-MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * const conn)
{
zend_long major, minor, patch;
char *p;
@@ -2137,7 +2137,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA *
/* {{{ mysqlnd_conn_data::more_results */
static zend_bool
-MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::more_results");
/* (conn->state == CONN_NEXT_RESULT_PENDING) too */
@@ -2148,7 +2148,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const
/* {{{ mysqlnd_conn_data::next_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, next_result);
enum_func_status ret = FAIL;
@@ -2156,7 +2156,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
DBG_ENTER("mysqlnd_conn_data::next_result");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
if (CONN_GET_STATE(conn) != CONN_NEXT_RESULT_PENDING) {
break;
@@ -2168,16 +2168,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
We are sure that there is a result set, since conn->state is set accordingly
in mysqlnd_store_result() or mysqlnd_fetch_row_unbuffered()
*/
- if (FAIL == (ret = conn->m->query_read_result_set_header(conn, NULL TSRMLS_CC))) {
+ if (FAIL == (ret = conn->m->query_read_result_set_header(conn, NULL))) {
/*
There can be an error in the middle of a multi-statement, which will cancel the multi-statement.
So there are no more results and we should just return FALSE, error_no has been set
*/
if (!conn->error_info->error_no) {
DBG_ERR_FMT("Serious error. %s::%u", __FILE__, __LINE__);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error. PID=%d", getpid());
+ php_error_docref(NULL, E_WARNING, "Serious error. PID=%d", getpid());
CONN_SET_STATE(conn, CONN_QUIT_SENT);
- conn->m->send_close(conn TSRMLS_CC);
+ conn->m->send_close(conn);
} else {
DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error);
}
@@ -2187,7 +2187,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_NORMAL, conn->upsert_status->affected_rows);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2254,7 +2254,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
const char * db,
zend_bool silent,
size_t passwd_len
- TSRMLS_DC)
+ )
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, change_user);
enum_func_status ret = FAIL;
@@ -2263,7 +2263,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
DBG_INF_FMT("conn=%llu user=%s passwd=%s db=%s silent=%u",
conn->thread_id, user?user:"", passwd?"***":"null", db?db:"", (silent == TRUE)?1:0 );
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
@@ -2283,13 +2283,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
/* XXX: passwords that have \0 inside work during auth, but in this case won't work with change user */
ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, strlen(db),
conn->auth_plugin_data, conn->auth_plugin_data_len, conn->options->auth_protocol,
- 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/ TSRMLS_CC);
+ 0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/);
/*
Here we should close all statements. Unbuffered queries should not be a
problem as we won't allow sending COM_CHANGE_USER.
*/
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
end:
DBG_INF(ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -2309,7 +2309,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
DBG_ENTER("mysqlnd_conn_data::set_client_option");
DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
switch (option) {
@@ -2328,7 +2328,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
case MYSQL_SERVER_PUBLIC_KEY:
- ret = conn->net->data->m.set_client_option(conn->net, option, value TSRMLS_CC);
+ ret = conn->net->data->m.set_client_option(conn->net, option, value);
break;
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
case MYSQLND_OPT_INT_AND_FLOAT_NATIVE:
@@ -2456,11 +2456,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
default:
ret = FAIL;
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
DBG_RETURN(ret);
oom:
SET_OOM_ERROR(*conn->error_info);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
end:
DBG_RETURN(FAIL);
}
@@ -2480,7 +2480,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
DBG_ENTER("mysqlnd_conn_data::set_client_option_2d");
DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option);
- if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS != conn->m->local_tx_start(conn, this_func)) {
goto end;
}
switch (option) {
@@ -2503,11 +2503,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons
default:
ret = FAIL;
}
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
DBG_RETURN(ret);
oom:
SET_OOM_ERROR(*conn->error_info);
- conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, FAIL);
end:
DBG_RETURN(FAIL);
}
@@ -2516,7 +2516,7 @@ end:
/* {{{ mysqlnd_conn_data::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, use_result);
MYSQLND_RES * result = NULL;
@@ -2524,7 +2524,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
DBG_ENTER("mysqlnd_conn_data::use_result");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
if (!conn->current_result) {
break;
@@ -2539,16 +2539,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_UNBUFFERED_SETS);
- conn->current_result->conn = conn->m->get_reference(conn TSRMLS_CC);
- result = conn->current_result->m.use_result(conn->current_result, FALSE TSRMLS_CC);
+ conn->current_result->conn = conn->m->get_reference(conn);
+ result = conn->current_result->m.use_result(conn->current_result, FALSE);
if (!result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
}
conn->current_result = NULL;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
@@ -2558,7 +2558,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co
/* {{{ mysqlnd_conn_data::store_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, store_result);
MYSQLND_RES * result = NULL;
@@ -2566,7 +2566,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
DBG_ENTER("mysqlnd_conn_data::store_result");
DBG_INF_FMT("conn=%llu conn=%p", conn->thread_id, conn);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
unsigned int f = flags;
if (!conn->current_result) {
@@ -2583,7 +2583,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
/* overwrite */
- if ((conn->m->get_client_api_capabilities(conn TSRMLS_CC) & MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA)) {
+ if ((conn->m->get_client_api_capabilities(conn) & MYSQLND_CLIENT_KNOWS_RSET_COPY_DATA)) {
if (MYSQLND_G(fetch_data_copy)) {
f &= ~MYSQLND_STORE_NO_COPY;
f |= MYSQLND_STORE_COPY;
@@ -2599,14 +2599,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn,
DBG_ERR("Unknown fetch mode");
break;
}
- result = conn->current_result->m.store_result(conn->current_result, conn, f TSRMLS_CC);
+ result = conn->current_result->m.store_result(conn->current_result, conn, f);
if (!result) {
- conn->current_result->m.free_result(conn->current_result, TRUE TSRMLS_CC);
+ conn->current_result->m.free_result(conn->current_result, TRUE);
}
conn->current_result = NULL;
} while (0);
- conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS);
}
DBG_RETURN(result);
}
@@ -2627,15 +2627,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA
/* {{{ mysqlnd_conn_data::set_autocommit */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_autocommit);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::set_autocommit");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
- ret = conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCOMMIT=1") - 1 TSRMLS_CC);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
+ ret = conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCOMMIT=1") - 1);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2645,25 +2645,25 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsi
/* {{{ mysqlnd_conn_data::tx_commit */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn)
{
- return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL TSRMLS_CC);
+ return conn->m->tx_commit_or_rollback(conn, TRUE, TRANS_COR_NO_OPT, NULL);
}
/* }}} */
/* {{{ mysqlnd_conn_data::tx_rollback */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn)
{
- return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL TSRMLS_CC);
+ return conn->m->tx_commit_or_rollback(conn, FALSE, TRANS_COR_NO_OPT, NULL);
}
/* }}} */
/* {{{ mysqlnd_tx_cor_options_to_string */
static void
-MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode)
{
if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
if (str->s && str->s->len) {
@@ -2695,7 +2695,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_D
/* {{{ mysqlnd_escape_string_for_tx_name_in_comment */
static char *
-mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
+mysqlnd_escape_string_for_tx_name_in_comment(const char * const name)
{
char * ret = NULL;
DBG_ENTER("mysqlnd_escape_string_for_tx_name_in_comment");
@@ -2722,7 +2722,7 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
{
*p_copy++ = v;
} else if (warned == FALSE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
+ php_error_docref(NULL, E_WARNING, "Transaction name truncated. Must be only [0-9A-Za-z\\-_=]+");
warned = TRUE;
}
++p_orig;
@@ -2738,23 +2738,23 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name TSRMLS_DC)
/* {{{ mysqlnd_conn_data::tx_commit_ex */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_commit_or_rollback);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_commit_or_rollback");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
smart_str tmp_str = {0, 0};
- conn->m->tx_cor_options_to_string(conn, &tmp_str, flags TSRMLS_CC);
+ conn->m->tx_cor_options_to_string(conn, &tmp_str, flags);
smart_str_0(&tmp_str);
{
char * query;
size_t query_len;
- char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name);
query_len = mnd_sprintf(&query, 0, (commit? "COMMIT%s %s":"ROLLBACK%s %s"),
name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
@@ -2768,11 +2768,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2782,13 +2782,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con
/* {{{ mysqlnd_conn_data::tx_begin */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_begin);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_begin");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
smart_str tmp_str = {0, 0};
if (mode & TRANS_START_WITH_CONSISTENT_SNAPSHOT) {
@@ -2798,9 +2798,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_appendl(&tmp_str, "WITH CONSISTENT SNAPSHOT", sizeof("WITH CONSISTENT SNAPSHOT") - 1);
}
if (mode & (TRANS_START_READ_WRITE | TRANS_START_READ_ONLY)) {
- zend_ulong server_version = conn->m->get_server_version(conn TSRMLS_CC);
+ zend_ulong server_version = conn->m->get_server_version(conn);
if (server_version < 50605L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
+ php_error_docref(NULL, E_WARNING, "This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required");
smart_str_free(&tmp_str);
break;
} else if (mode & TRANS_START_READ_WRITE) {
@@ -2818,7 +2818,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
smart_str_0(&tmp_str);
{
- char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name TSRMLS_CC);
+ char * name_esc = mysqlnd_escape_string_for_tx_name_in_comment(name);
char * query;
unsigned int query_len = mnd_sprintf(&query, 0, "START TRANSACTION%s %s", name_esc? name_esc:"", tmp_str.s? tmp_str.s->val:"");
smart_str_free(&tmp_str);
@@ -2830,11 +2830,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
}
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2844,13 +2844,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi
/* {{{ mysqlnd_conn_data::tx_savepoint */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_savepoint");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
char * query;
unsigned int query_len;
@@ -2863,10 +2863,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2876,13 +2876,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const
/* {{{ mysqlnd_conn_data::tx_savepoint_release */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint_release);
enum_func_status ret = FAIL;
DBG_ENTER("mysqlnd_conn_data::tx_savepoint_release");
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
do {
char * query;
unsigned int query_len;
@@ -2895,10 +2895,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn
SET_OOM_ERROR(*conn->error_info);
break;
}
- ret = conn->m->query(conn, query, query_len TSRMLS_CC);
+ ret = conn->m->query(conn, query, query_len);
mnd_sprintf_free(query);
} while (0);
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
}
DBG_RETURN(ret);
@@ -2908,7 +2908,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn
/* {{{ mysqlnd_conn_data::negotiate_client_api_capabilities */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags)
{
unsigned int ret = 0;
DBG_ENTER("mysqlnd_conn_data::negotiate_client_api_capabilities");
@@ -2924,7 +2924,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, negotiate_client_api_capabilities)(MYSQLND_CON
/* {{{ mysqlnd_conn_data::get_client_api_capabilities */
static unsigned int
-MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn)
{
DBG_ENTER("mysqlnd_conn_data::get_client_api_capabilities");
DBG_RETURN(conn? conn->client_api_capabilities : 0);
@@ -2934,7 +2934,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_client_api_capabilities)(const MYSQLND_CON
/* {{{ mysqlnd_conn_data::local_tx_start */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func)
{
enum_func_status ret = PASS;
DBG_ENTER("mysqlnd_conn_data::local_tx_start");
@@ -2945,7 +2945,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start)(MYSQLND_CONN_DATA * conn, size
/* {{{ mysqlnd_conn_data::local_tx_end */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status)
{
DBG_ENTER("mysqlnd_conn_data::local_tx_end");
DBG_RETURN(status);
@@ -2955,21 +2955,21 @@ MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)(MYSQLND_CONN_DATA * conn, size_t
/* {{{ mysqlnd_conn_data::init */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, init)(MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_conn_data::init");
mysqlnd_stats_init(&conn->stats, STAT_LAST);
SET_ERROR_AFF_ROWS(conn);
- conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info TSRMLS_CC);
- conn->protocol = mysqlnd_protocol_init(conn->persistent TSRMLS_CC);
+ conn->net = mysqlnd_net_init(conn->persistent, conn->stats, conn->error_info);
+ conn->protocol = mysqlnd_protocol_init(conn->persistent);
DBG_RETURN(conn->stats && conn->net && conn->protocol? PASS:FAIL);
}
/* }}} */
-MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn);
MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data)
@@ -3069,11 +3069,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_conn::get_reference */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn)
{
MYSQLND * ret;
DBG_ENTER("mysqlnd_conn::get_reference");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).clone_connection_object(conn TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).clone_connection_object(conn);
DBG_RETURN(ret);
}
/* }}} */
@@ -3081,12 +3081,12 @@ MYSQLND_METHOD(mysqlnd_conn, clone_object)(MYSQLND * const conn TSRMLS_DC)
/* {{{ mysqlnd_conn_data::dtor */
static void
-MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn)
{
DBG_ENTER("mysqlnd_conn::dtor");
DBG_INF_FMT("conn=%llu", conn->data->thread_id);
- conn->data->m->free_reference(conn->data TSRMLS_CC);
+ conn->data->m->free_reference(conn->data);
mnd_pefree(conn, conn->persistent);
@@ -3097,7 +3097,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn TSRMLS_DC)
/* {{{ mysqlnd_conn_data::close */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close_type close_type TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close_type close_type)
{
size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_methods, close);
MYSQLND_CONN_DATA * conn = conn_handle->data;
@@ -3106,7 +3106,7 @@ MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close
DBG_ENTER("mysqlnd_conn::close");
DBG_INF_FMT("conn=%llu", conn->thread_id);
- if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
+ if (PASS == conn->m->local_tx_start(conn, this_func)) {
if (CONN_GET_STATE(conn) >= CONN_READY) {
static enum_mysqlnd_collected_stats close_type_to_stat_map[MYSQLND_CLOSE_LAST] = {
STAT_CLOSE_EXPLICIT,
@@ -3120,12 +3120,12 @@ MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close
Close now, free_reference will try,
if we are last, but that's not a problem.
*/
- ret = conn->m->send_close(conn TSRMLS_CC);
+ ret = conn->m->send_close(conn);
/* do it after free_reference/dtor and we might crash */
- conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
+ conn->m->local_tx_end(conn, this_func, ret);
- conn_handle->m->dtor(conn_handle TSRMLS_CC);
+ conn_handle->m->dtor(conn_handle);
}
DBG_RETURN(ret);
}
@@ -3142,13 +3142,13 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ _mysqlnd_init */
PHPAPI MYSQLND *
-_mysqlnd_init(unsigned int flags, zend_bool persistent TSRMLS_DC)
+_mysqlnd_init(unsigned int flags, zend_bool persistent)
{
MYSQLND * ret;
DBG_ENTER("mysqlnd_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_connection(persistent TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_connection(persistent);
if (ret && ret->data) {
- ret->data->m->negotiate_client_api_capabilities(ret->data, flags TSRMLS_CC);
+ ret->data->m->negotiate_client_api_capabilities(ret->data, flags);
}
DBG_RETURN(ret);
}
diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index 2e45740abb..829177a7c1 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -63,20 +63,20 @@
/* Library related */
-PHPAPI void mysqlnd_library_init(TSRMLS_D);
-PHPAPI void mysqlnd_library_end(TSRMLS_D);
+PHPAPI void mysqlnd_library_init(void);
+PHPAPI void mysqlnd_library_end(void);
PHPAPI unsigned int mysqlnd_plugin_register();
-PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin TSRMLS_DC);
+PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin);
PHPAPI unsigned int mysqlnd_plugin_count();
-PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC);
-#define mysqlnd_plugin_find(name) _mysqlnd_plugin_find((name) TSRMLS_CC);
+PHPAPI void * _mysqlnd_plugin_find(const char * const name);
+#define mysqlnd_plugin_find(name) _mysqlnd_plugin_find((name));
-PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC);
-#define mysqlnd_plugin_apply_with_argument(func, argument) _mysqlnd_plugin_apply_with_argument((func), (argument) TSRMLS_CC);
+PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument);
+#define mysqlnd_plugin_apply_with_argument(func, argument) _mysqlnd_plugin_apply_with_argument((func), (argument));
-#define mysqlnd_restart_psession(conn) ((conn)->data)->m->restart_psession((conn)->data TSRMLS_CC)
-#define mysqlnd_end_psession(conn) ((conn)->data)->m->end_psession((conn)->data TSRMLS_CC)
+#define mysqlnd_restart_psession(conn) ((conn)->data)->m->restart_psession((conn)->data)
+#define mysqlnd_end_psession(conn) ((conn)->data)->m->end_psession((conn)->data)
PHPAPI void mysqlnd_minfo_print_hash(zval *values);
#define mysqlnd_thread_safe() TRUE
@@ -85,8 +85,8 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const char
/* Connect */
-#define mysqlnd_init(client_flags, persistent) _mysqlnd_init((client_flags), (persistent) TSRMLS_CC)
-PHPAPI MYSQLND * _mysqlnd_init(unsigned int client_flags, zend_bool persistent TSRMLS_DC);
+#define mysqlnd_init(client_flags, persistent) _mysqlnd_init((client_flags), (persistent))
+PHPAPI MYSQLND * _mysqlnd_init(unsigned int client_flags, zend_bool persistent);
PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn,
const char * host, const char * user,
const char * passwd, unsigned int passwd_len,
@@ -95,94 +95,94 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn,
const char * socket_or_pipe,
unsigned int mysql_flags,
unsigned int client_api_flags
- TSRMLS_DC);
+ );
-#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd)) TSRMLS_CC)
-#define mysqlnd_change_user_ex(conn, user, passwd, db, silent, passwd_len) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), (passwd_len) TSRMLS_CC)
+#define mysqlnd_change_user(conn, user, passwd, db, silent) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), strlen((passwd)))
+#define mysqlnd_change_user_ex(conn, user, passwd, db, silent, passwd_len) ((conn)->data)->m->change_user((conn)->data, (user), (passwd), (db), (silent), (passwd_len))
-#define mysqlnd_debug(x) _mysqlnd_debug((x) TSRMLS_CC)
-PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC);
+#define mysqlnd_debug(x) _mysqlnd_debug((x))
+PHPAPI void _mysqlnd_debug(const char *mode);
/* Query */
#define mysqlnd_fetch_into(result, flags, ret_val, ext) (result)->m.fetch_into((result), (flags), (ret_val), (ext) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_fetch_row_c(result) (result)->m.fetch_row_c((result) TSRMLS_CC)
+#define mysqlnd_fetch_row_c(result) (result)->m.fetch_row_c((result))
#define mysqlnd_fetch_all(result, flags, return_value) (result)->m.fetch_all((result), (flags), (return_value) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_result_fetch_field_data(res,offset,ret) (res)->m.fetch_field_data((res), (offset), (ret) TSRMLS_CC)
+#define mysqlnd_result_fetch_field_data(res,offset,ret) (res)->m.fetch_field_data((res), (offset), (ret))
#define mysqlnd_get_connection_stats(conn, values) ((conn)->data)->m->get_statistics((conn)->data, (values) TSRMLS_CC ZEND_FILE_LINE_CC)
#define mysqlnd_get_client_stats(values) _mysqlnd_get_client_stats((values) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define mysqlnd_close(conn,is_forced) (conn)->m->close((conn), (is_forced) TSRMLS_CC)
-#define mysqlnd_query(conn, query_str, query_len) ((conn)->data)->m->query((conn)->data, (query_str), (query_len) TSRMLS_CC)
-#define mysqlnd_async_query(conn, query_str, query_len) ((conn)->data)->m->send_query((conn)->data, (query_str), (query_len) TSRMLS_CC)
-#define mysqlnd_poll(r, err, d_pull,sec,usec,desc_num) _mysqlnd_poll((r), (err), (d_pull), (sec), (usec), (desc_num) TSRMLS_CC)
-#define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data TSRMLS_CC)
-#define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result) TSRMLS_CC)
+#define mysqlnd_close(conn,is_forced) (conn)->m->close((conn), (is_forced))
+#define mysqlnd_query(conn, query_str, query_len) ((conn)->data)->m->query((conn)->data, (query_str), (query_len))
+#define mysqlnd_async_query(conn, query_str, query_len) ((conn)->data)->m->send_query((conn)->data, (query_str), (query_len))
+#define mysqlnd_poll(r, err, d_pull,sec,usec,desc_num) _mysqlnd_poll((r), (err), (d_pull), (sec), (usec), (desc_num))
+#define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data)
+#define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result))
-PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC);
+PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num);
-#define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data, 0 TSRMLS_CC)
-#define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_NO_COPY TSRMLS_CC)
-#define mysqlnd_store_result_ofs(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_COPY TSRMLS_CC)
-#define mysqlnd_next_result(conn) ((conn)->data)->m->next_result((conn)->data TSRMLS_CC)
-#define mysqlnd_more_results(conn) ((conn)->data)->m->more_results((conn)->data TSRMLS_CC)
-#define mysqlnd_free_result(r,e_or_i) ((MYSQLND_RES*)r)->m.free_result(((MYSQLND_RES*)(r)), (e_or_i) TSRMLS_CC)
-#define mysqlnd_data_seek(result, row) (result)->m.seek_data((result), (row) TSRMLS_CC)
+#define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data, 0)
+#define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_NO_COPY)
+#define mysqlnd_store_result_ofs(conn) ((conn)->data)->m->store_result((conn)->data, MYSQLND_STORE_COPY)
+#define mysqlnd_next_result(conn) ((conn)->data)->m->next_result((conn)->data)
+#define mysqlnd_more_results(conn) ((conn)->data)->m->more_results((conn)->data)
+#define mysqlnd_free_result(r,e_or_i) ((MYSQLND_RES*)r)->m.free_result(((MYSQLND_RES*)(r)), (e_or_i))
+#define mysqlnd_data_seek(result, row) (result)->m.seek_data((result), (row))
/* Errors */
-#define mysqlnd_errno(conn) ((conn)->data)->m->get_error_no((conn)->data TSRMLS_CC)
-#define mysqlnd_error(conn) ((conn)->data)->m->get_error_str((conn)->data TSRMLS_CC)
-#define mysqlnd_sqlstate(conn) ((conn)->data)->m->get_sqlstate((conn)->data TSRMLS_CC)
+#define mysqlnd_errno(conn) ((conn)->data)->m->get_error_no((conn)->data)
+#define mysqlnd_error(conn) ((conn)->data)->m->get_error_str((conn)->data)
+#define mysqlnd_sqlstate(conn) ((conn)->data)->m->get_sqlstate((conn)->data)
/* Charset */
-#define mysqlnd_character_set_name(conn) ((conn)->data)->m->charset_name((conn)->data TSRMLS_CC)
+#define mysqlnd_character_set_name(conn) ((conn)->data)->m->charset_name((conn)->data)
/* Simple metadata */
-#define mysqlnd_field_count(conn) ((conn)->data)->m->get_field_count((conn)->data TSRMLS_CC)
-#define mysqlnd_insert_id(conn) ((conn)->data)->m->get_last_insert_id((conn)->data TSRMLS_CC)
-#define mysqlnd_affected_rows(conn) ((conn)->data)->m->get_affected_rows((conn)->data TSRMLS_CC)
-#define mysqlnd_warning_count(conn) ((conn)->data)->m->get_warning_count((conn)->data TSRMLS_CC)
-#define mysqlnd_info(conn) ((conn)->data)->m->get_last_message((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_info(conn) ((conn)->data)->m->get_server_information((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_version(conn) ((conn)->data)->m->get_server_version((conn)->data TSRMLS_CC)
-#define mysqlnd_get_host_info(conn) ((conn)->data)->m->get_host_information((conn)->data TSRMLS_CC)
-#define mysqlnd_get_proto_info(conn) ((conn)->data)->m->get_protocol_information((conn)->data TSRMLS_CC)
-#define mysqlnd_thread_id(conn) ((conn)->data)->m->get_thread_id((conn)->data TSRMLS_CC)
-#define mysqlnd_get_server_status(conn) ((conn)->data)->m->get_server_status((conn)->data TSRMLS_CC)
-
-#define mysqlnd_num_rows(result) (result)->m.num_rows((result) TSRMLS_CC)
-#define mysqlnd_num_fields(result) (result)->m.num_fields((result) TSRMLS_CC)
-
-#define mysqlnd_fetch_lengths(result) (result)->m.fetch_lengths((result) TSRMLS_CC)
-
-#define mysqlnd_field_seek(result, ofs) (result)->m.seek_field((result), (ofs) TSRMLS_CC)
-#define mysqlnd_field_tell(result) (result)->m.field_tell((result) TSRMLS_CC)
-#define mysqlnd_fetch_field(result) (result)->m.fetch_field((result) TSRMLS_CC)
-#define mysqlnd_fetch_field_direct(result,fnr) (result)->m.fetch_field_direct((result), (fnr) TSRMLS_CC)
-#define mysqlnd_fetch_fields(result) (result)->m.fetch_fields((result) TSRMLS_CC)
+#define mysqlnd_field_count(conn) ((conn)->data)->m->get_field_count((conn)->data)
+#define mysqlnd_insert_id(conn) ((conn)->data)->m->get_last_insert_id((conn)->data)
+#define mysqlnd_affected_rows(conn) ((conn)->data)->m->get_affected_rows((conn)->data)
+#define mysqlnd_warning_count(conn) ((conn)->data)->m->get_warning_count((conn)->data)
+#define mysqlnd_info(conn) ((conn)->data)->m->get_last_message((conn)->data)
+#define mysqlnd_get_server_info(conn) ((conn)->data)->m->get_server_information((conn)->data)
+#define mysqlnd_get_server_version(conn) ((conn)->data)->m->get_server_version((conn)->data)
+#define mysqlnd_get_host_info(conn) ((conn)->data)->m->get_host_information((conn)->data)
+#define mysqlnd_get_proto_info(conn) ((conn)->data)->m->get_protocol_information((conn)->data)
+#define mysqlnd_thread_id(conn) ((conn)->data)->m->get_thread_id((conn)->data)
+#define mysqlnd_get_server_status(conn) ((conn)->data)->m->get_server_status((conn)->data)
+
+#define mysqlnd_num_rows(result) (result)->m.num_rows((result))
+#define mysqlnd_num_fields(result) (result)->m.num_fields((result))
+
+#define mysqlnd_fetch_lengths(result) (result)->m.fetch_lengths((result))
+
+#define mysqlnd_field_seek(result, ofs) (result)->m.seek_field((result), (ofs))
+#define mysqlnd_field_tell(result) (result)->m.field_tell((result))
+#define mysqlnd_fetch_field(result) (result)->m.fetch_field((result))
+#define mysqlnd_fetch_field_direct(result,fnr) (result)->m.fetch_field_direct((result), (fnr))
+#define mysqlnd_fetch_fields(result) (result)->m.fetch_fields((result))
/* mysqlnd metadata */
PHPAPI const char * mysqlnd_get_client_info();
PHPAPI unsigned int mysqlnd_get_client_version();
-#define mysqlnd_ssl_set(conn, key, cert, ca, capath, cipher) ((conn)->data)->m->ssl_set((conn)->data, (key), (cert), (ca), (capath), (cipher) TSRMLS_CC)
+#define mysqlnd_ssl_set(conn, key, cert, ca, capath, cipher) ((conn)->data)->m->ssl_set((conn)->data, (key), (cert), (ca), (capath), (cipher))
/* PS */
-#define mysqlnd_stmt_insert_id(stmt) (stmt)->m->get_last_insert_id((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_affected_rows(stmt) (stmt)->m->get_affected_rows((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_num_rows(stmt) (stmt)->m->get_num_rows((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_param_count(stmt) (stmt)->m->get_param_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_field_count(stmt) (stmt)->m->get_field_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_warning_count(stmt) (stmt)->m->get_warning_count((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_server_status(stmt) (stmt)->m->get_server_status((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_errno(stmt) (stmt)->m->get_error_no((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_error(stmt) (stmt)->m->get_error_str((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_sqlstate(stmt) (stmt)->m->get_sqlstate((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_insert_id(stmt) (stmt)->m->get_last_insert_id((stmt))
+#define mysqlnd_stmt_affected_rows(stmt) (stmt)->m->get_affected_rows((stmt))
+#define mysqlnd_stmt_num_rows(stmt) (stmt)->m->get_num_rows((stmt))
+#define mysqlnd_stmt_param_count(stmt) (stmt)->m->get_param_count((stmt))
+#define mysqlnd_stmt_field_count(stmt) (stmt)->m->get_field_count((stmt))
+#define mysqlnd_stmt_warning_count(stmt) (stmt)->m->get_warning_count((stmt))
+#define mysqlnd_stmt_server_status(stmt) (stmt)->m->get_server_status((stmt))
+#define mysqlnd_stmt_errno(stmt) (stmt)->m->get_error_no((stmt))
+#define mysqlnd_stmt_error(stmt) (stmt)->m->get_error_str((stmt))
+#define mysqlnd_stmt_sqlstate(stmt) (stmt)->m->get_sqlstate((stmt))
-PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC);
-PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC);
-PHPAPI void mysqlnd_free_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC);
-PHPAPI void mysqlnd_free_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC);
+PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind);
+PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind);
+PHPAPI void mysqlnd_free_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind);
+PHPAPI void mysqlnd_free_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind);
PHPAPI const char * mysqlnd_field_type_name(enum mysqlnd_field_types field_type);
@@ -191,69 +191,69 @@ PHPAPI const char * mysqlnd_field_type_name(enum mysqlnd_field_types field_type)
void mysqlnd_local_infile_default(MYSQLND_CONN_DATA * conn);
/* Simple commands */
-#define mysqlnd_autocommit(conn, mode) ((conn)->data)->m->set_autocommit((conn)->data, (mode) TSRMLS_CC)
-#define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name) TSRMLS_CC)
-#define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name) TSRMLS_CC)
-#define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name) TSRMLS_CC)
-#define mysqlnd_savepoint(conn, name) ((conn)->data)->m->tx_savepoint((conn)->data, (name) TSRMLS_CC)
-#define mysqlnd_release_savepoint(conn, name) ((conn)->data)->m->tx_savepoint_release((conn)->data, (name) TSRMLS_CC)
-#define mysqlnd_list_dbs(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW DATABASES LIKE %s":"SHOW DATABASES", (wild), NULL TSRMLS_CC)
-#define mysqlnd_list_fields(conn, tab,wild) ((conn)->data)->m->list_fields((conn)->data, (tab), (wild) TSRMLS_CC)
-#define mysqlnd_list_processes(conn) ((conn)->data)->m->list_method((conn)->data, "SHOW PROCESSLIST", NULL, NULL TSRMLS_CC)
-#define mysqlnd_list_tables(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW TABLES LIKE %s":"SHOW TABLES", (wild), NULL TSRMLS_CC)
-#define mysqlnd_dump_debug_info(conn) ((conn)->data)->m->server_dump_debug_information((conn)->data TSRMLS_CC)
-#define mysqlnd_select_db(conn, db, db_len) ((conn)->data)->m->select_db((conn)->data, (db), (db_len) TSRMLS_CC)
-#define mysqlnd_ping(conn) ((conn)->data)->m->ping((conn)->data TSRMLS_CC)
-#define mysqlnd_kill(conn, pid) ((conn)->data)->m->kill_connection((conn)->data, (pid) TSRMLS_CC)
-#define mysqlnd_refresh(conn, options) ((conn)->data)->m->refresh_server((conn)->data, (options) TSRMLS_CC)
-#define mysqlnd_shutdown(conn, level) ((conn)->data)->m->shutdown_server((conn)->data, (level) TSRMLS_CC)
-#define mysqlnd_set_character_set(conn, cs) ((conn)->data)->m->set_charset((conn)->data, (cs) TSRMLS_CC)
-#define mysqlnd_stat(conn, msg) ((conn)->data)->m->get_server_statistics(((conn)->data), (msg) TSRMLS_CC)
-#define mysqlnd_options(conn, opt, value) ((conn)->data)->m->set_client_option((conn)->data, (opt), (value) TSRMLS_CC)
-#define mysqlnd_options4(conn, opt, k, v) ((conn)->data)->m->set_client_option_2d((conn)->data, (opt), (k), (v) TSRMLS_CC)
-#define mysqlnd_set_server_option(conn, op) ((conn)->data)->m->set_server_option((conn)->data, (op) TSRMLS_CC)
+#define mysqlnd_autocommit(conn, mode) ((conn)->data)->m->set_autocommit((conn)->data, (mode))
+#define mysqlnd_begin_transaction(conn,flags,name) ((conn)->data)->m->tx_begin((conn)->data, (flags), (name))
+#define mysqlnd_commit(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, TRUE, (flags), (name))
+#define mysqlnd_rollback(conn, flags, name) ((conn)->data)->m->tx_commit_or_rollback((conn)->data, FALSE, (flags), (name))
+#define mysqlnd_savepoint(conn, name) ((conn)->data)->m->tx_savepoint((conn)->data, (name))
+#define mysqlnd_release_savepoint(conn, name) ((conn)->data)->m->tx_savepoint_release((conn)->data, (name))
+#define mysqlnd_list_dbs(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW DATABASES LIKE %s":"SHOW DATABASES", (wild), NULL)
+#define mysqlnd_list_fields(conn, tab,wild) ((conn)->data)->m->list_fields((conn)->data, (tab), (wild))
+#define mysqlnd_list_processes(conn) ((conn)->data)->m->list_method((conn)->data, "SHOW PROCESSLIST", NULL, NULL)
+#define mysqlnd_list_tables(conn, wild) ((conn)->data)->m->list_method((conn)->data, wild? "SHOW TABLES LIKE %s":"SHOW TABLES", (wild), NULL)
+#define mysqlnd_dump_debug_info(conn) ((conn)->data)->m->server_dump_debug_information((conn)->data)
+#define mysqlnd_select_db(conn, db, db_len) ((conn)->data)->m->select_db((conn)->data, (db), (db_len))
+#define mysqlnd_ping(conn) ((conn)->data)->m->ping((conn)->data)
+#define mysqlnd_kill(conn, pid) ((conn)->data)->m->kill_connection((conn)->data, (pid))
+#define mysqlnd_refresh(conn, options) ((conn)->data)->m->refresh_server((conn)->data, (options))
+#define mysqlnd_shutdown(conn, level) ((conn)->data)->m->shutdown_server((conn)->data, (level))
+#define mysqlnd_set_character_set(conn, cs) ((conn)->data)->m->set_charset((conn)->data, (cs))
+#define mysqlnd_stat(conn, msg) ((conn)->data)->m->get_server_statistics(((conn)->data), (msg))
+#define mysqlnd_options(conn, opt, value) ((conn)->data)->m->set_client_option((conn)->data, (opt), (value))
+#define mysqlnd_options4(conn, opt, k, v) ((conn)->data)->m->set_client_option_2d((conn)->data, (opt), (k), (v))
+#define mysqlnd_set_server_option(conn, op) ((conn)->data)->m->set_server_option((conn)->data, (op))
/* Escaping */
#define mysqlnd_real_escape_string(conn, newstr, escapestr, escapestr_len) \
- ((conn)->data)->m->escape_string((conn)->data, (newstr), (escapestr), (escapestr_len) TSRMLS_CC)
+ ((conn)->data)->m->escape_string((conn)->data, (newstr), (escapestr), (escapestr_len))
#define mysqlnd_escape_string(newstr, escapestr, escapestr_len) \
- mysqlnd_old_escape_string((newstr), (escapestr), (escapestr_len) TSRMLS_CC)
+ mysqlnd_old_escape_string((newstr), (escapestr), (escapestr_len))
-PHPAPI zend_ulong mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
+PHPAPI zend_ulong mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len);
/* PS */
-#define mysqlnd_stmt_init(conn) ((conn)->data)->m->stmt_init(((conn)->data) TSRMLS_CC)
-#define mysqlnd_stmt_store_result(stmt) (!mysqlnd_stmt_field_count((stmt)) ? PASS:((stmt)->m->store_result((stmt) TSRMLS_CC)? PASS:FAIL))
-#define mysqlnd_stmt_get_result(stmt) (stmt)->m->get_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_more_results(stmt) (stmt)->m->more_results((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_next_result(stmt) (stmt)->m->next_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_data_seek(stmt, row) (stmt)->m->seek_data((stmt), (row) TSRMLS_CC)
-#define mysqlnd_stmt_prepare(stmt, q, qlen) (stmt)->m->prepare((stmt), (q), (qlen) TSRMLS_CC)
-#define mysqlnd_stmt_execute(stmt) (stmt)->m->execute((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_send_long_data(stmt,p,d,l) (stmt)->m->send_long_data((stmt), (p), (d), (l) TSRMLS_CC)
-#define mysqlnd_stmt_alloc_param_bind(stmt) (stmt)->m->alloc_parameter_bind((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_free_param_bind(stmt,bind) (stmt)->m->free_parameter_bind((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_param(stmt,bind) (stmt)->m->bind_parameters((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_one_param(stmt,n,z,t) (stmt)->m->bind_one_parameter((stmt), (n), (z), (t) TSRMLS_CC)
-#define mysqlnd_stmt_refresh_bind_param(s) (s)->m->refresh_bind_param((s) TSRMLS_CC)
-#define mysqlnd_stmt_alloc_result_bind(stmt) (stmt)->m->alloc_result_bind((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_free_result_bind(stmt,bind) (stmt)->m->free_result_bind((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_result(stmt,bind) (stmt)->m->bind_result((stmt), (bind) TSRMLS_CC)
-#define mysqlnd_stmt_bind_one_result(s,no) (s)->m->bind_one_result((s), (no) TSRMLS_CC)
+#define mysqlnd_stmt_init(conn) ((conn)->data)->m->stmt_init(((conn)->data))
+#define mysqlnd_stmt_store_result(stmt) (!mysqlnd_stmt_field_count((stmt)) ? PASS:((stmt)->m->store_result((stmt))? PASS:FAIL))
+#define mysqlnd_stmt_get_result(stmt) (stmt)->m->get_result((stmt))
+#define mysqlnd_stmt_more_results(stmt) (stmt)->m->more_results((stmt))
+#define mysqlnd_stmt_next_result(stmt) (stmt)->m->next_result((stmt))
+#define mysqlnd_stmt_data_seek(stmt, row) (stmt)->m->seek_data((stmt), (row))
+#define mysqlnd_stmt_prepare(stmt, q, qlen) (stmt)->m->prepare((stmt), (q), (qlen))
+#define mysqlnd_stmt_execute(stmt) (stmt)->m->execute((stmt))
+#define mysqlnd_stmt_send_long_data(stmt,p,d,l) (stmt)->m->send_long_data((stmt), (p), (d), (l))
+#define mysqlnd_stmt_alloc_param_bind(stmt) (stmt)->m->alloc_parameter_bind((stmt))
+#define mysqlnd_stmt_free_param_bind(stmt,bind) (stmt)->m->free_parameter_bind((stmt), (bind))
+#define mysqlnd_stmt_bind_param(stmt,bind) (stmt)->m->bind_parameters((stmt), (bind))
+#define mysqlnd_stmt_bind_one_param(stmt,n,z,t) (stmt)->m->bind_one_parameter((stmt), (n), (z), (t))
+#define mysqlnd_stmt_refresh_bind_param(s) (s)->m->refresh_bind_param((s))
+#define mysqlnd_stmt_alloc_result_bind(stmt) (stmt)->m->alloc_result_bind((stmt))
+#define mysqlnd_stmt_free_result_bind(stmt,bind) (stmt)->m->free_result_bind((stmt), (bind))
+#define mysqlnd_stmt_bind_result(stmt,bind) (stmt)->m->bind_result((stmt), (bind))
+#define mysqlnd_stmt_bind_one_result(s,no) (s)->m->bind_one_result((s), (no))
#define mysqlnd_stmt_param_metadata(stmt) (stmt)->m->get_parameter_metadata((stmt))
-#define mysqlnd_stmt_result_metadata(stmt) (stmt)->m->get_result_metadata((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_result_metadata(stmt) (stmt)->m->get_result_metadata((stmt))
-#define mysqlnd_stmt_free_result(stmt) (stmt)->m->free_result((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_close(stmt, implicit) (stmt)->m->dtor((stmt), (implicit) TSRMLS_CC)
-#define mysqlnd_stmt_reset(stmt) (stmt)->m->reset((stmt) TSRMLS_CC)
-#define mysqlnd_stmt_flush(stmt) (stmt)->m->flush((stmt) TSRMLS_CC)
+#define mysqlnd_stmt_free_result(stmt) (stmt)->m->free_result((stmt))
+#define mysqlnd_stmt_close(stmt, implicit) (stmt)->m->dtor((stmt), (implicit))
+#define mysqlnd_stmt_reset(stmt) (stmt)->m->reset((stmt))
+#define mysqlnd_stmt_flush(stmt) (stmt)->m->flush((stmt))
-#define mysqlnd_stmt_attr_get(stmt, attr, value) (stmt)->m->get_attribute((stmt), (attr), (value) TSRMLS_CC)
-#define mysqlnd_stmt_attr_set(stmt, attr, value) (stmt)->m->set_attribute((stmt), (attr), (value) TSRMLS_CC)
+#define mysqlnd_stmt_attr_get(stmt, attr, value) (stmt)->m->get_attribute((stmt), (attr), (value))
+#define mysqlnd_stmt_attr_set(stmt, attr, value) (stmt)->m->set_attribute((stmt), (attr), (value))
-#define mysqlnd_stmt_fetch(stmt, fetched) (stmt)->m->fetch((stmt), (fetched) TSRMLS_CC)
+#define mysqlnd_stmt_fetch(stmt, fetched) (stmt)->m->fetch((stmt), (fetched))
/* Performance statistics */
diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c
index daa758c043..9b59d76b14 100644
--- a/ext/mysqlnd/mysqlnd_alloc.c
+++ b/ext/mysqlnd/mysqlnd_alloc.c
@@ -172,7 +172,7 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_orig_filename, __zend_orig_lineno);
}
#endif
- TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE));
#if PHP_DEBUG
/* -1 is also "true" */
@@ -186,7 +186,7 @@ void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
}
#endif
- TRACE_ALLOC_INF_FMT("after : %lu", zend_memory_usage(FALSE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("after : %lu", zend_memory_usage(FALSE));
TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret);
if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
@@ -482,7 +482,7 @@ void * _mysqlnd_realloc(void *ptr, size_t new_size MYSQLND_MEM_D)
}
#endif
TRACE_ALLOC_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
- TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE));
#if PHP_DEBUG
/* -1 is also "true" */
diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c
index 255098c4f3..2196278f2b 100644
--- a/ext/mysqlnd/mysqlnd_auth.c
+++ b/ext/mysqlnd/mysqlnd_auth.c
@@ -47,7 +47,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
size_t * switch_to_auth_protocol_len,
zend_uchar ** switch_to_auth_protocol_data,
size_t * switch_to_auth_protocol_data_len
- TSRMLS_DC)
+ )
{
enum_func_status ret = FAIL;
const MYSQLND_CHARSET * charset = NULL;
@@ -57,7 +57,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
DBG_ENTER("mysqlnd_auth_handshake");
- auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_resp_packet = conn->protocol->m.get_auth_response_packet(conn->protocol, FALSE);
if (!auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
@@ -65,7 +65,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
}
if (use_full_blown_auth_packet != TRUE) {
- change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE);
if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -80,7 +80,7 @@ mysqlnd_auth_handshake(MYSQLND_CONN_DATA * conn,
goto end;
}
} else {
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
auth_packet->client_flags = mysql_flags;
auth_packet->max_packet_size = options->max_allowed_packet;
@@ -178,7 +178,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
DBG_ENTER("mysqlnd_auth_change_user");
- chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ chg_user_resp = conn->protocol->m.get_change_user_response_packet(conn->protocol, FALSE);
if (!chg_user_resp) {
SET_OOM_ERROR(*conn->error_info);
@@ -186,7 +186,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
if (use_full_blown_auth_packet != TRUE) {
- change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ change_auth_resp_packet = conn->protocol->m.get_change_auth_response_packet(conn->protocol, FALSE);
if (!change_auth_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
goto end;
@@ -201,7 +201,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
goto end;
}
} else {
- auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE TSRMLS_CC);
+ auth_packet = conn->protocol->m.get_auth_packet(conn->protocol, FALSE);
if (!auth_packet) {
SET_OOM_ERROR(*conn->error_info);
@@ -219,7 +219,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
auth_packet->auth_plugin_name = auth_protocol;
- if (conn->m->get_server_version(conn TSRMLS_CC) >= 50123) {
+ if (conn->m->get_server_version(conn) >= 50123) {
auth_packet->charset_no = conn->charset->nr;
}
@@ -259,12 +259,12 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
bug#25371 mysql_change_user() triggers "packets out of sync"
When it gets fixed, there should be one more check here
*/
- if (conn->m->get_server_version(conn TSRMLS_CC) > 50113L &&conn->m->get_server_version(conn TSRMLS_CC) < 50118L) {
- MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE TSRMLS_CC);
+ if (conn->m->get_server_version(conn) > 50113L &&conn->m->get_server_version(conn) < 50118L) {
+ MYSQLND_PACKET_OK * redundant_error_packet = conn->protocol->m.get_ok_packet(conn->protocol, FALSE);
if (redundant_error_packet) {
PACKET_READ(redundant_error_packet, conn);
PACKET_FREE(redundant_error_packet);
- DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", conn->m->get_server_version(conn TSRMLS_CC));
+ DBG_INF_FMT("Server is %u, buggy, sends two ERR messages", conn->m->get_server_version(conn));
} else {
SET_OOM_ERROR(*conn->error_info);
}
@@ -291,8 +291,8 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
memset(conn->upsert_status, 0, sizeof(*conn->upsert_status));
/* set charset for old servers */
- if (conn->m->get_server_version(conn TSRMLS_CC) < 50123) {
- ret = conn->m->set_charset(conn, old_cs->name TSRMLS_CC);
+ if (conn->m->get_server_version(conn) < 50123) {
+ ret = conn->m->set_charset(conn, old_cs->name);
}
} else if (ret == FAIL && chg_user_resp->server_asked_323_auth == TRUE) {
/* old authentication with new server !*/
@@ -362,7 +362,7 @@ mysqlnd_native_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
zend_uchar * ret = NULL;
DBG_ENTER("mysqlnd_native_auth_get_auth_data");
@@ -422,7 +422,7 @@ mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
zend_uchar * ret = NULL;
@@ -482,7 +482,7 @@ static RSA *
mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options
- TSRMLS_DC)
+ )
{
RSA * ret = NULL;
const char * fname = (net_options->sha256_server_public_key && net_options->sha256_server_public_key[0] != '\0')?
@@ -499,12 +499,12 @@ mysqlnd_sha256_get_rsa_key(MYSQLND_CONN_DATA * conn,
do {
DBG_INF("requesting the public key from the server");
- pk_req_packet = conn->protocol->m.get_sha256_pk_request_packet(conn->protocol, FALSE TSRMLS_CC);
+ pk_req_packet = conn->protocol->m.get_sha256_pk_request_packet(conn->protocol, FALSE);
if (!pk_req_packet) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- pk_resp_packet = conn->protocol->m.get_sha256_pk_request_response_packet(conn->protocol, FALSE TSRMLS_CC);
+ pk_resp_packet = conn->protocol->m.get_sha256_pk_request_response_packet(conn->protocol, FALSE);
if (!pk_resp_packet) {
SET_OOM_ERROR(*conn->error_info);
PACKET_FREE(pk_req_packet);
@@ -572,7 +572,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
const MYSQLND_OPTIONS * const options,
const MYSQLND_NET_OPTIONS * const net_options,
zend_ulong mysql_flags
- TSRMLS_DC)
+ )
{
RSA * server_public_key;
zend_uchar * ret = NULL;
@@ -588,7 +588,7 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
memcpy(ret, passwd, passwd_len);
} else {
*auth_data_len = 0;
- server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options TSRMLS_CC);
+ server_public_key = mysqlnd_sha256_get_rsa_key(conn, options, net_options);
if (server_public_key) {
int server_public_key_len;
@@ -646,12 +646,12 @@ static struct st_mysqlnd_authentication_plugin mysqlnd_sha256_authentication_plu
/* {{{ mysqlnd_register_builtin_authentication_plugins */
void
-mysqlnd_register_builtin_authentication_plugins(TSRMLS_D)
+mysqlnd_register_builtin_authentication_plugins(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_native_auth_plugin TSRMLS_CC);
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_pam_authentication_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_native_auth_plugin);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_pam_authentication_plugin);
#ifdef MYSQLND_HAVE_SSL
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_sha256_authentication_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_sha256_authentication_plugin);
#endif
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c
index 705f52ea82..25e4040c0e 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.c
+++ b/ext/mysqlnd/mysqlnd_block_alloc.c
@@ -29,7 +29,7 @@
/* {{{ mysqlnd_mempool_free_chunk */
static void
-mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC)
+mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk)
{
MYSQLND_MEMORY_POOL * pool = chunk->pool;
DBG_ENTER("mysqlnd_mempool_free_chunk");
@@ -54,7 +54,7 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC)
/* {{{ mysqlnd_mempool_resize_chunk */
static enum_func_status
-mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC)
+mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size)
{
DBG_ENTER("mysqlnd_mempool_resize_chunk");
if (chunk->from_pool) {
@@ -112,7 +112,7 @@ mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int siz
/* {{{ mysqlnd_mempool_get_chunk */
static
-MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size TSRMLS_DC)
+MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, unsigned int size)
{
MYSQLND_MEMORY_POOL_CHUNK *chunk = NULL;
DBG_ENTER("mysqlnd_mempool_get_chunk");
@@ -132,7 +132,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
chunk->from_pool = FALSE;
chunk->ptr = mnd_malloc(size);
if (!chunk->ptr) {
- chunk->free_chunk(chunk TSRMLS_CC);
+ chunk->free_chunk(chunk);
chunk = NULL;
}
} else {
@@ -150,7 +150,7 @@ MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool
/* {{{ mysqlnd_mempool_create */
PHPAPI MYSQLND_MEMORY_POOL *
-mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
+mysqlnd_mempool_create(size_t arena_size)
{
/* We calloc, because we free(). We don't mnd_calloc() for a reason. */
MYSQLND_MEMORY_POOL * ret = mnd_calloc(1, sizeof(MYSQLND_MEMORY_POOL));
@@ -162,7 +162,7 @@ mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
/* OOM ? */
ret->arena = mnd_malloc(ret->arena_size);
if (!ret->arena) {
- mysqlnd_mempool_destroy(ret TSRMLS_CC);
+ mysqlnd_mempool_destroy(ret);
ret = NULL;
}
}
@@ -173,7 +173,7 @@ mysqlnd_mempool_create(size_t arena_size TSRMLS_DC)
/* {{{ mysqlnd_mempool_destroy */
PHPAPI void
-mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
+mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool)
{
DBG_ENTER("mysqlnd_mempool_destroy");
/* mnd_free will reference LOCK_access and might crash, depending on the caller...*/
diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h
index c0232d4286..acaae44eef 100644
--- a/ext/mysqlnd/mysqlnd_block_alloc.h
+++ b/ext/mysqlnd/mysqlnd_block_alloc.h
@@ -23,8 +23,8 @@
#ifndef MYSQLND_BLOCK_ALLOC_H
#define MYSQLND_BLOCK_ALLOC_H
-PHPAPI MYSQLND_MEMORY_POOL * mysqlnd_mempool_create(size_t arena_size TSRMLS_DC);
-PHPAPI void mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool TSRMLS_DC);
+PHPAPI MYSQLND_MEMORY_POOL * mysqlnd_mempool_create(size_t arena_size);
+PHPAPI void mysqlnd_mempool_destroy(MYSQLND_MEMORY_POOL * pool);
#endif /* MYSQLND_BLOCK_ALLOC_H */
diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c
index 97a49e1054..3a6c5f5fd2 100644
--- a/ext/mysqlnd/mysqlnd_charset.c
+++ b/ext/mysqlnd/mysqlnd_charset.c
@@ -727,7 +727,7 @@ PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const name
/* {{{ mysqlnd_cset_escape_quotes */
PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char * escapestr, size_t escapestr_len TSRMLS_DC)
+ const char * escapestr, size_t escapestr_len)
{
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
@@ -781,7 +781,7 @@ PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const cset,
/* {{{ mysqlnd_cset_escape_slashes */
PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char * escapestr, size_t escapestr_len TSRMLS_DC)
+ const char * escapestr, size_t escapestr_len)
{
const char *newstr_s = newstr;
const char *newstr_e = newstr + 2 * escapestr_len;
@@ -887,9 +887,9 @@ static struct st_mysqlnd_plugin_charsets mysqlnd_plugin_charsets_plugin =
/* {{{ mysqlnd_charsets_plugin_register */
void
-mysqlnd_charsets_plugin_register(TSRMLS_D)
+mysqlnd_charsets_plugin_register(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_charsets_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_charsets_plugin);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h
index ef77b2fb74..884dcb0e77 100644
--- a/ext/mysqlnd/mysqlnd_charset.h
+++ b/ext/mysqlnd/mysqlnd_charset.h
@@ -22,10 +22,10 @@
#define MYSQLND_CHARSET_H
PHPAPI zend_ulong mysqlnd_cset_escape_quotes(const MYSQLND_CHARSET * const charset, char *newstr,
- const char *escapestr, size_t escapestr_len TSRMLS_DC);
+ const char *escapestr, size_t escapestr_len);
PHPAPI zend_ulong mysqlnd_cset_escape_slashes(const MYSQLND_CHARSET * const cset, char *newstr,
- const char *escapestr, size_t escapestr_len TSRMLS_DC);
+ const char *escapestr, size_t escapestr_len);
struct st_mysqlnd_plugin_charsets
{
@@ -34,12 +34,12 @@ struct st_mysqlnd_plugin_charsets
{
const MYSQLND_CHARSET * (*const find_charset_by_nr)(unsigned int charsetnr);
const MYSQLND_CHARSET * (*const find_charset_by_name)(const char * const name);
- zend_ulong (*const escape_quotes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
- zend_ulong (*const escape_slashes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC);
+ zend_ulong (*const escape_quotes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len);
+ zend_ulong (*const escape_slashes)(const MYSQLND_CHARSET * const cset, char * newstr, const char * escapestr, size_t escapestr_len);
} methods;
};
-void mysqlnd_charsets_plugin_register(TSRMLS_D);
+void mysqlnd_charsets_plugin_register(void);
#endif /* MYSQLND_CHARSET_H */
diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c
index c8f682b8e2..b6ffca8d7f 100644
--- a/ext/mysqlnd/mysqlnd_debug.c
+++ b/ext/mysqlnd/mysqlnd_debug.c
@@ -556,7 +556,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
case ':':
#if 0
if (state != PARSER_WAIT_COLON) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Consecutive semicolons at position %u", i);
+ php_error_docref(NULL, E_WARNING, "Consecutive semicolons at position %u", i);
}
#endif
state = PARSER_WAIT_MODIFIER;
@@ -593,7 +593,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
i = j;
} else {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected list of functions for '%c' found none", mode[i]);
#endif
}
@@ -673,7 +673,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
default:
if (state == PARSER_WAIT_MODIFIER) {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized format '%c'", mode[i]);
+ php_error_docref(NULL, E_WARNING, "Unrecognized format '%c'", mode[i]);
#endif
if (i+1 < mode_len && mode[i+1] == ',') {
i+= 2;
@@ -687,7 +687,7 @@ MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char * const
state = PARSER_WAIT_COLON;
} else if (state == PARSER_WAIT_COLON) {
#if 0
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Colon expected, '%c' found", mode[i]);
+ php_error_docref(NULL, E_WARNING, "Colon expected, '%c' found", mode[i]);
#endif
}
break;
@@ -710,7 +710,7 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_debug_init */
PHPAPI MYSQLND_DEBUG *
-mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
+mysqlnd_debug_init(const char * skip_functions[])
{
MYSQLND_DEBUG *ret = calloc(1, sizeof(MYSQLND_DEBUG));
@@ -730,14 +730,14 @@ mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC)
/* {{{ _mysqlnd_debug */
-PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
+PHPAPI void _mysqlnd_debug(const char * mode)
{
#if PHP_DEBUG
MYSQLND_DEBUG * dbg = MYSQLND_G(dbg);
if (!dbg) {
struct st_mysqlnd_plugin_trace_log * trace_log_plugin = mysqlnd_plugin_find("debug_trace");
if (trace_log_plugin) {
- dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
+ dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs);
if (!dbg) {
return;
}
@@ -784,9 +784,9 @@ static struct st_mysqlnd_plugin_trace_log mysqlnd_plugin_trace_log_plugin =
/* {{{ mysqlnd_debug_trace_plugin_register */
void
-mysqlnd_debug_trace_plugin_register(TSRMLS_D)
+mysqlnd_debug_trace_plugin_register(void)
{
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_trace_log_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_trace_log_plugin);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index e8dfeb6c4a..636172882d 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -62,13 +62,13 @@ struct st_mysqlnd_plugin_trace_log
struct st_mysqlnd_plugin_header plugin_header;
struct
{
- MYSQLND_DEBUG * (*trace_instance_init)(const char * skip_functions[] TSRMLS_DC);
+ MYSQLND_DEBUG * (*trace_instance_init)(const char * skip_functions[]);
} methods;
};
-void mysqlnd_debug_trace_plugin_register(TSRMLS_D);
+void mysqlnd_debug_trace_plugin_register(void);
-PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[] TSRMLS_DC);
+PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[]);
#if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400))
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index a35474b9e6..58a974d75f 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -53,21 +53,21 @@ static struct st_mysqlnd_plugin_core mysqlnd_plugin_core =
/* {{{ mysqlnd_library_end */
-PHPAPI void mysqlnd_library_end(TSRMLS_D)
+PHPAPI void mysqlnd_library_end(void)
{
if (mysqlnd_library_initted == TRUE) {
- mysqlnd_plugin_subsystem_end(TSRMLS_C);
+ mysqlnd_plugin_subsystem_end();
mysqlnd_stats_end(mysqlnd_global_stats);
mysqlnd_global_stats = NULL;
mysqlnd_library_initted = FALSE;
- mysqlnd_reverse_api_end(TSRMLS_C);
+ mysqlnd_reverse_api_end();
}
}
/* }}} */
/* {{{ mysqlnd_library_init */
-PHPAPI void mysqlnd_library_init(TSRMLS_D)
+PHPAPI void mysqlnd_library_init(void)
{
if (mysqlnd_library_initted == FALSE) {
mysqlnd_library_initted = TRUE;
@@ -76,18 +76,18 @@ PHPAPI void mysqlnd_library_init(TSRMLS_D)
_mysqlnd_init_ps_subsystem();
/* Should be calloc, as mnd_calloc will reference LOCK_access*/
mysqlnd_stats_init(&mysqlnd_global_stats, STAT_LAST);
- mysqlnd_plugin_subsystem_init(TSRMLS_C);
+ mysqlnd_plugin_subsystem_init();
{
mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats;
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core);
}
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
- mysqlnd_example_plugin_register(TSRMLS_C);
+ mysqlnd_example_plugin_register();
#endif
- mysqlnd_debug_trace_plugin_register(TSRMLS_C);
- mysqlnd_register_builtin_authentication_plugins(TSRMLS_C);
+ mysqlnd_debug_trace_plugin_register();
+ mysqlnd_register_builtin_authentication_plugins();
- mysqlnd_reverse_api_init(TSRMLS_C);
+ mysqlnd_reverse_api_init();
}
}
/* }}} */
@@ -111,7 +111,7 @@ mysqlnd_error_list_pdtor(void * pDest)
/* {{{ mysqlnd_object_factory::get_connection */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent)
{
size_t alloc_size_ret = sizeof(MYSQLND) + mysqlnd_plugin_count() * sizeof(void *);
size_t alloc_size_ret_data = sizeof(MYSQLND_CONN_DATA) + mysqlnd_plugin_count() * sizeof(void *);
@@ -140,16 +140,16 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRM
data->persistent = persistent;
data->m = mysqlnd_conn_data_get_methods();
CONN_SET_STATE(data, CONN_ALLOCED);
- data->m->get_reference(data TSRMLS_CC);
+ data->m->get_reference(data);
- if (PASS != data->m->init(data TSRMLS_CC)) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ if (PASS != data->m->init(data)) {
+ new_object->m->dtor(new_object);
DBG_RETURN(NULL);
}
data->error_info->error_list = mnd_pecalloc(1, sizeof(zend_llist), persistent);
if (!data->error_info->error_list) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ new_object->m->dtor(new_object);
DBG_RETURN(NULL);
} else {
zend_llist_init(data->error_info->error_list, sizeof(MYSQLND_ERROR_LIST_ELEMENT), (llist_dtor_func_t)mysqlnd_error_list_pdtor, persistent);
@@ -162,7 +162,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_connection)(zend_bool persistent TSRM
/* {{{ mysqlnd_object_factory::clone_connection_object */
static MYSQLND *
-MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_cloned TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_cloned)
{
size_t alloc_size_ret = sizeof(MYSQLND) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND * new_object;
@@ -179,9 +179,9 @@ MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_
new_object->persistent = to_be_cloned->persistent;
new_object->m = to_be_cloned->m;
- new_object->data = to_be_cloned->data->m->get_reference(to_be_cloned->data TSRMLS_CC);
+ new_object->data = to_be_cloned->data->m->get_reference(to_be_cloned->data);
if (!new_object->data) {
- new_object->m->dtor(new_object TSRMLS_CC);
+ new_object->m->dtor(new_object);
new_object = NULL;
}
DBG_RETURN(new_object);
@@ -191,7 +191,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, clone_connection_object)(MYSQLND * to_be_
/* {{{ mysqlnd_object_factory::get_prepared_statement */
static MYSQLND_STMT *
-MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA * const conn)
{
size_t alloc_size = sizeof(MYSQLND_STMT) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_STMT * ret = mnd_pecalloc(1, alloc_size, conn->persistent);
@@ -226,7 +226,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
be destructed till there is open statements. The last statement
or normal query result will close it then.
*/
- stmt->conn = conn->m->get_reference(conn TSRMLS_CC);
+ stmt->conn = conn->m->get_reference(conn);
stmt->error_info->error_list = mnd_pecalloc(1, sizeof(zend_llist), ret->persistent);
if (!stmt->error_info->error_list) {
break;
@@ -239,7 +239,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
SET_OOM_ERROR(*conn->error_info);
if (ret) {
- ret->m->dtor(ret, TRUE TSRMLS_CC);
+ ret->m->dtor(ret, TRUE);
ret = NULL;
}
DBG_RETURN(NULL);
@@ -249,7 +249,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
/* {{{ mysqlnd_object_factory::get_io_channel */
PHPAPI MYSQLND_NET *
-MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
size_t net_alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
size_t net_data_alloc_size = sizeof(MYSQLND_NET_DATA) + mysqlnd_plugin_count() * sizeof(void *);
@@ -263,8 +263,8 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYS
net->persistent = net->data->persistent = persistent;
net->data->m = *mysqlnd_net_get_methods();
- if (PASS != net->data->m.init(net, stats, error_info TSRMLS_CC)) {
- net->data->m.dtor(net, stats, error_info TSRMLS_CC);
+ if (PASS != net->data->m.init(net, stats, error_info)) {
+ net->data->m.dtor(net, stats, error_info);
net = NULL;
}
} else {
@@ -284,7 +284,7 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYS
/* {{{ mysqlnd_object_factory::get_protocol_decoder */
static MYSQLND_PROTOCOL *
-MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_object_factory, get_protocol_decoder)(zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_PROTOCOL) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_PROTOCOL *ret = mnd_pecalloc(1, alloc_size, persistent);
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c
index 43f1318caa..b2b7833db1 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.c
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.c
@@ -31,7 +31,7 @@ static struct st_mysqlnd_stmt_methods * mysqlnd_stmt_methods;
/* {{{ _mysqlnd_plugin_get_plugin_connection_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -45,7 +45,7 @@ _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int pl
/* {{{ _mysqlnd_plugin_get_plugin_connection_data_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -58,7 +58,7 @@ _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn,
/* {{{ _mysqlnd_plugin_get_plugin_result_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -71,7 +71,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result
/* {{{ _mysqlnd_plugin_get_plugin_result_unbuffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -84,7 +84,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_R
/* {{{ _mysqlnd_plugin_get_plugin_result_buffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -96,7 +96,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLN
/* }}} */
/* {{{ _mysqlnd_plugin_get_plugin_result_buffered_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -110,7 +110,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_R
/* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -123,7 +123,7 @@ _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsi
/* {{{ _mysqlnd_plugin_get_plugin_stmt_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_stmt_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
@@ -136,7 +136,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, u
/* {{{ _mysqlnd_plugin_get_plugin_net_data */
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_net_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h
index c66043da83..82a02d5c50 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.h
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.h
@@ -22,32 +22,32 @@
#ifndef MYSQLND_EXT_PLUGIN_H
#define MYSQLND_EXT_PLUGIN_H
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_connection_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data((c), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_connection_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data((c), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_connection_data_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data_data((c), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_connection_data_data(c, p_id) _mysqlnd_plugin_get_plugin_connection_data_data((c), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_data(r, p_id) _mysqlnd_plugin_get_plugin_result_data((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_data(r, p_id) _mysqlnd_plugin_get_plugin_result_data((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_unbuffered_data(r, p_id) _mysqlnd_plugin_get_plugin_result_unbuffered_data((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_unbuffered_data(r, p_id) _mysqlnd_plugin_get_plugin_result_unbuffered_data((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_buffered_data_zval(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_zval((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_zval(const MYSQLND_RES_BUFFERED_ZVAL * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_buffered_data_zval(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_zval((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_result_buffered_data_c(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_c((r), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data_c(const MYSQLND_RES_BUFFERED_C * result, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_result_buffered_data_c(r, p_id) _mysqlnd_plugin_get_plugin_result_buffered_data_c((r), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_stmt_data(s, p_id) _mysqlnd_plugin_get_plugin_stmt_data((s), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_protocol_data(p, p_id) _mysqlnd_plugin_get_plugin_protocol_data((p), (p_id))
-PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC);
-#define mysqlnd_plugin_get_plugin_net_data(n, p_id) _mysqlnd_plugin_get_plugin_net_data((n), (p_id) TSRMLS_CC)
+PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id);
+#define mysqlnd_plugin_get_plugin_net_data(n, p_id) _mysqlnd_plugin_get_plugin_net_data((n), (p_id))
PHPAPI struct st_mysqlnd_conn_methods * mysqlnd_conn_get_methods();
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index a29a5a186d..f188abee6b 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -27,7 +27,7 @@
/* {{{ mysqlnd_local_infile_init */
static
-int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC)
+int mysqlnd_local_infile_init(void ** ptr, const char * const filename)
{
MYSQLND_INFILE_INFO *info;
php_stream_context *context = NULL;
@@ -43,7 +43,7 @@ int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC
/* check open_basedir */
if (PG(open_basedir)) {
- if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC) == -1) {
+ if (php_check_open_basedir_ex(filename, 0) == -1) {
strcpy(info->error_msg, "open_basedir restriction in effect. Unable to open file");
info->error_no = CR_UNKNOWN_ERROR;
DBG_RETURN(1);
@@ -66,7 +66,7 @@ int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC
/* {{{ mysqlnd_local_infile_read */
static
-int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len TSRMLS_DC)
+int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
int count;
@@ -87,7 +87,7 @@ int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len
/* {{{ mysqlnd_local_infile_error */
static
-int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_buf_len TSRMLS_DC)
+int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_buf_len)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
@@ -108,7 +108,7 @@ int mysqlnd_local_infile_error(void * ptr, char *error_buf, unsigned int error_b
/* {{{ mysqlnd_local_infile_end */
static
-void mysqlnd_local_infile_end(void * ptr TSRMLS_DC)
+void mysqlnd_local_infile_end(void * ptr)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
@@ -141,7 +141,7 @@ static const char *lost_conn = "Lost connection to MySQL server during LOAD DATA
/* {{{ mysqlnd_handle_local_infile */
enum_func_status
-mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning TSRMLS_DC)
+mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning)
{
zend_uchar *buf = NULL;
zend_uchar empty_packet[MYSQLND_HEADER_SIZE];
@@ -156,9 +156,9 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
DBG_ENTER("mysqlnd_handle_local_infile");
if (!(conn->options->flags & CLIENT_LOCAL_FILES)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
+ php_error_docref(NULL, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
/* write empty packet to server */
- ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+ ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info);
*is_warning = TRUE;
goto infile_error;
}
@@ -170,21 +170,21 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
*is_warning = FALSE;
/* init handler: allocate read buffer and open file */
- if (infile.local_infile_init(&info, (char *)filename TSRMLS_CC)) {
+ if (infile.local_infile_init(&info, (char *)filename)) {
char tmp_buf[sizeof(conn->error_info->error)];
int tmp_error_no;
*is_warning = TRUE;
/* error occurred */
- tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
+ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf));
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
/* write empty packet to server */
- ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+ ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info);
goto infile_error;
}
/* read data */
- while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE TSRMLS_CC)) > 0) {
- if ((ret = net->data->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+ while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE)) > 0) {
+ if ((ret = net->data->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info)) == 0) {
DBG_ERR_FMT("Error during read : %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
goto infile_error;
@@ -192,7 +192,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
}
/* send empty packet for eof */
- if ((ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+ if ((ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info)) == 0) {
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
goto infile_error;
}
@@ -203,7 +203,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
int tmp_error_no;
*is_warning = TRUE;
DBG_ERR_FMT("Bufsize < 0, warning, %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
- tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
+ tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf));
SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
goto infile_error;
}
@@ -212,11 +212,11 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
infile_error:
/* get response from server and update upsert values */
- if (FAIL == conn->m->simple_command_handle_response(conn, PROT_OK_PACKET, FALSE, COM_QUERY, FALSE TSRMLS_CC)) {
+ if (FAIL == conn->m->simple_command_handle_response(conn, PROT_OK_PACKET, FALSE, COM_QUERY, FALSE)) {
result = FAIL;
}
- (*conn->infile.local_infile_end)(info TSRMLS_CC);
+ (*conn->infile.local_infile_end)(info);
if (buf) {
mnd_efree(buf);
}
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index da92acfbff..a05c287807 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -42,7 +42,7 @@
/* {{{ mysqlnd_set_sock_no_delay */
static int
-mysqlnd_set_sock_no_delay(php_stream * stream TSRMLS_DC)
+mysqlnd_set_sock_no_delay(php_stream * stream)
{
int socketd = ((php_netstream_data_t*)stream->abstract)->socket;
@@ -64,10 +64,10 @@ mysqlnd_set_sock_no_delay(php_stream * stream TSRMLS_DC)
/* {{{ mysqlnd_net::network_read_ex */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
enum_func_status return_value = PASS;
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
size_t old_chunk_size = net_stream->chunk_size;
size_t to_read = count, ret;
zend_uchar * p = buffer;
@@ -95,12 +95,12 @@ MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar
/* {{{ mysqlnd_net::network_write_ex */
static size_t
MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
size_t ret;
DBG_ENTER("mysqlnd_net::network_write_ex");
DBG_INF_FMT("sending %u bytes", count);
- ret = php_stream_write(net->data->m.get_stream(net TSRMLS_CC), (char *)buffer, count);
+ ret = php_stream_write(net->data->m.get_stream(net), (char *)buffer, count);
DBG_RETURN(ret);
}
/* }}} */
@@ -110,7 +110,7 @@ MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zen
static php_stream *
MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
#if PHP_API_VERSION < 20100412
unsigned int streams_options = ENFORCE_SAFE_MODE;
@@ -150,7 +150,7 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
static php_stream *
MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
#if PHP_API_VERSION < 20100412
unsigned int streams_options = ENFORCE_SAFE_MODE;
@@ -244,9 +244,9 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
static void
MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
const char * const scheme, const size_t scheme_len,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream * net_stream = net->data->m.get_stream(net);
DBG_ENTER("mysqlnd_net::post_connect_set_opt");
if (net_stream) {
if (net->data->options.timeout_read) {
@@ -259,7 +259,7 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) {
/* TCP -> Set TCP_NODELAY */
- mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC);
+ mysqlnd_set_sock_no_delay(net_stream);
}
}
@@ -271,7 +271,7 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
/* {{{ mysqlnd_net::get_open_stream */
static func_mysqlnd_net__open_stream
MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
- MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_ERROR_INFO * const error_info)
{
func_mysqlnd_net__open_stream ret = NULL;
DBG_ENTER("mysqlnd_net::get_open_stream");
@@ -297,7 +297,7 @@ MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
const zend_bool persistent,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
enum_func_status ret = FAIL;
func_mysqlnd_net__open_stream open_stream = NULL;
@@ -305,14 +305,14 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
net->packet_no = net->compressed_envelope_packet_no = 0;
- net->data->m.close_stream(net, conn_stats, error_info TSRMLS_CC);
+ net->data->m.close_stream(net, conn_stats, error_info);
- open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info TSRMLS_CC);
+ open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info);
if (open_stream) {
- php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC);
+ php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info);
if (net_stream) {
- (void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
- net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC);
+ (void) net->data->m.set_stream(net, net_stream);
+ net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info);
ret = PASS;
}
}
@@ -345,7 +345,7 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
*/
static size_t
MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
zend_uchar safe_buf[((MYSQLND_HEADER_SIZE) + (sizeof(zend_uchar)) - 1) / (sizeof(zend_uchar))];
zend_uchar * safe_storage = safe_buf;
@@ -381,7 +381,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
int3store(uncompressed_payload, to_be_sent);
int1store(uncompressed_payload + 3, net->packet_no);
if (PASS == net->data->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen,
- uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE TSRMLS_CC))
+ uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE))
{
int3store(compress_buf + MYSQLND_HEADER_SIZE, to_be_sent + MYSQLND_HEADER_SIZE);
payload_size = tmp_complen;
@@ -396,7 +396,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
int1store(compress_buf + 3, net->packet_no);
DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
bytes_sent = net->data->m.network_write_ex(net, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE,
- conn_stats, error_info TSRMLS_CC);
+ conn_stats, error_info);
net->compressed_envelope_packet_no++;
#if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
if (res == Z_OK) {
@@ -427,7 +427,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
STORE_HEADER_SIZE(safe_storage, p);
int3store(p, to_be_sent);
int1store(p + 3, net->packet_no);
- bytes_sent = net->data->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC);
+ bytes_sent = net->data->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info);
RESTORE_HEADER_SIZE(p, safe_storage);
net->compressed_envelope_packet_no++;
}
@@ -500,7 +500,7 @@ php_mysqlnd_read_buffer_bytes_left(MYSQLND_READ_BUFFER * buffer)
/* {{{ php_mysqlnd_read_buffer_free */
static void
-php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer TSRMLS_DC)
+php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer)
{
DBG_ENTER("php_mysqlnd_read_buffer_free");
if (*buffer) {
@@ -515,7 +515,7 @@ php_mysqlnd_read_buffer_free(MYSQLND_READ_BUFFER ** buffer TSRMLS_DC)
/* {{{ php_mysqlnd_create_read_buffer */
static MYSQLND_READ_BUFFER *
-mysqlnd_create_read_buffer(size_t count TSRMLS_DC)
+mysqlnd_create_read_buffer(size_t count)
{
MYSQLND_READ_BUFFER * ret = mnd_emalloc(sizeof(MYSQLND_READ_BUFFER));
DBG_ENTER("mysqlnd_create_read_buffer");
@@ -534,7 +534,7 @@ mysqlnd_create_read_buffer(size_t count TSRMLS_DC)
/* {{{ mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffer */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buffer)
- (MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+ (MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info)
{
size_t decompressed_size;
enum_func_status retval = PASS;
@@ -543,7 +543,7 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffer");
/* Read the compressed header */
- if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
decompressed_size = uint3korr(comp_header);
@@ -553,19 +553,19 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
if (decompressed_size) {
compressed_data = mnd_emalloc(net_payload_size);
- if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info)) {
retval = FAIL;
goto end;
}
- net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size TSRMLS_CC);
- retval = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
+ net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size);
+ retval = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size);
if (FAIL == retval) {
goto end;
}
} else {
DBG_INF_FMT("The server decided not to compress the data. Our job is easy. Copying %u bytes", net_payload_size);
- net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size TSRMLS_CC);
- if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+ net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size);
+ if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info)) {
retval = FAIL;
goto end;
}
@@ -583,7 +583,7 @@ end:
/* {{{ mysqlnd_net::decode */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len,
- const zend_uchar * const compressed_data, const size_t compressed_data_len TSRMLS_DC)
+ const zend_uchar * const compressed_data, const size_t compressed_data_len)
{
#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
@@ -607,7 +607,7 @@ MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, const size_t
/* {{{ mysqlnd_net::encode */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len,
- const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len TSRMLS_DC)
+ const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len)
{
#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
@@ -634,7 +634,7 @@ MYSQLND_METHOD(mysqlnd_net, encode)(zend_uchar * compress_buffer, size_t * compr
/* {{{ mysqlnd_net::receive_ex */
static enum_func_status
MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count,
- MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+ MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
{
size_t to_read = count;
zend_uchar * p = buffer;
@@ -653,7 +653,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
DBG_INF_FMT("left "MYSQLND_SZ_T_SPEC" to read", to_read);
if (TRUE == net->uncompressed_data->is_empty(net->uncompressed_data)) {
/* Everything was consumed. This should never happen here, but for security */
- net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC);
+ net->uncompressed_data->free_buffer(&net->uncompressed_data);
}
}
if (to_read) {
@@ -661,7 +661,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
size_t net_payload_size;
zend_uchar packet_no;
- if (FAIL == net->data->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
net_payload_size = uint3korr(net_header);
@@ -679,7 +679,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
DBG_INF_FMT("HEADER: hwd_packet_no=%u size=%3u", packet_no, (zend_ulong) net_payload_size);
#endif
/* Now let's read from the wire, decompress it and fill the read buffer */
- net->data->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info TSRMLS_CC);
+ net->data->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info);
/*
Now a bit of recursion - read from the read buffer,
@@ -687,19 +687,19 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
is not enough, then the recursive call will try to
satisfy it until it is satisfied.
*/
- DBG_RETURN(net->data->m.receive_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+ DBG_RETURN(net->data->m.receive_ex(net, p, to_read, conn_stats, error_info));
}
DBG_RETURN(PASS);
}
#endif /* MYSQLND_COMPRESSION_ENABLED */
- DBG_RETURN(net->data->m.network_read_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+ DBG_RETURN(net->data->m.network_read_ex(net, p, to_read, conn_stats, error_info));
}
/* }}} */
/* {{{ mysqlnd_net::set_client_option */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mysqlnd_option option, const char * const value TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mysqlnd_option option, const char * const value)
{
DBG_ENTER("mysqlnd_net::set_client_option");
DBG_INF_FMT("option=%u", option);
@@ -812,7 +812,7 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys
/* {{{ mysqlnd_net::consume_uneaten_data */
size_t
-MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd)
{
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
/*
@@ -825,8 +825,8 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
char tmp_buf[256];
size_t skipped_bytes = 0;
int opt = PHP_STREAM_OPTION_BLOCKING;
- php_stream * net_stream = net->data->get_stream(net TSRMLS_CC);
- int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL TSRMLS_CC);
+ php_stream * net_stream = net->data->get_stream(net);
+ int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL);
DBG_ENTER("mysqlnd_net::consume_uneaten_data");
@@ -839,13 +839,13 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
} while (bytes_consumed == sizeof(tmp_buf));
if (was_blocked) {
- net_stream->ops->set_option(net_stream, opt, 1, NULL TSRMLS_CC);
+ net_stream->ops->set_option(net_stream, opt, 1, NULL);
}
if (bytes_consumed) {
DBG_ERR_FMT("Skipped %u bytes. Last command %s hasn't consumed all the output from the server",
bytes_consumed, mysqlnd_command_to_text[net->last_command]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
+ php_error_docref(NULL, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
"consumed all the output from the server",
bytes_consumed, mysqlnd_command_to_text[net->last_command]);
}
@@ -864,11 +864,11 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
*/
/* {{{ mysqlnd_net::enable_ssl */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net)
{
#ifdef MYSQLND_SSL_SUPPORTED
- php_stream_context * context = php_stream_context_alloc(TSRMLS_C);
- php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+ php_stream_context * context = php_stream_context_alloc();
+ php_stream * net_stream = net->data->m.get_stream(net);
DBG_ENTER("mysqlnd_net::enable_ssl");
if (!context) {
@@ -914,15 +914,15 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, context TSRMLS_CC);
+ php_stream_context_set(net_stream, context);
#else
php_stream_context_set(net_stream, context);
#endif
- if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
+ if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(net_stream, 1) < 0)
{
DBG_ERR("Cannot connect to MySQL by using SSL");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot connect to MySQL by using SSL");
+ php_error_docref(NULL, E_WARNING, "Cannot connect to MySQL by using SSL");
DBG_RETURN(FAIL);
}
net->data->ssl = TRUE;
@@ -934,7 +934,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
*/
#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, NULL TSRMLS_CC);
+ php_stream_context_set(net_stream, NULL);
#else
php_stream_context_set(net_stream, NULL);
#endif
@@ -959,7 +959,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::disable_ssl */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net)
{
DBG_ENTER("mysqlnd_net::disable_ssl");
DBG_RETURN(PASS);
@@ -969,14 +969,14 @@ MYSQLND_METHOD(mysqlnd_net, disable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::free_contents */
static void
-MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net)
{
zend_bool pers = net->persistent;
DBG_ENTER("mysqlnd_net::free_contents");
#ifdef MYSQLND_COMPRESSION_ENABLED
if (net->uncompressed_data) {
- net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC);
+ net->uncompressed_data->free_buffer(&net->uncompressed_data);
}
#endif
if (net->data->options.ssl_key) {
@@ -1011,11 +1011,11 @@ MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
/* {{{ mysqlnd_net::close_stream */
static void
-MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
php_stream * net_stream;
DBG_ENTER("mysqlnd_net::close_stream");
- if (net && (net_stream = net->data->m.get_stream(net TSRMLS_CC))) {
+ if (net && (net_stream = net->data->m.get_stream(net))) {
zend_bool pers = net->persistent;
DBG_INF_FMT("Freeing stream. abstract=%p", net_stream->abstract);
if (pers) {
@@ -1031,7 +1031,7 @@ MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS
} else {
php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE);
}
- (void) net->data->m.set_stream(net, NULL TSRMLS_CC);
+ (void) net->data->m.set_stream(net, NULL);
}
DBG_VOID_RETURN;
@@ -1041,19 +1041,19 @@ MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS
/* {{{ mysqlnd_net::init */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
unsigned int buf_size;
DBG_ENTER("mysqlnd_net::init");
buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size);
buf_size = MYSQLND_G(net_read_buffer_size); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size);
buf_size = MYSQLND_G(net_read_timeout); /* this is long, cast to unsigned int*/
- net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size TSRMLS_CC);
+ net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size);
DBG_RETURN(PASS);
}
@@ -1062,12 +1062,12 @@ MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const
/* {{{ mysqlnd_net::dtor */
static void
-MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info)
{
DBG_ENTER("mysqlnd_net::dtor");
if (net) {
- net->data->m.free_contents(net TSRMLS_CC);
- net->data->m.close_stream(net, stats, error_info TSRMLS_CC);
+ net->data->m.free_contents(net);
+ net->data->m.close_stream(net, stats, error_info);
if (net->cmd_buffer.buffer) {
DBG_INF("Freeing cmd buffer");
@@ -1085,7 +1085,7 @@ MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const
/* {{{ mysqlnd_net::get_stream */
static php_stream *
-MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net)
{
DBG_ENTER("mysqlnd_net::get_stream");
DBG_INF_FMT("%p", net? net->data->stream:NULL);
@@ -1096,7 +1096,7 @@ MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
/* {{{ mysqlnd_net::set_stream */
static php_stream *
-MYSQLND_METHOD(mysqlnd_net, set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_net, set_stream)(MYSQLND_NET * const net, php_stream * net_stream)
{
php_stream * ret = NULL;
DBG_ENTER("mysqlnd_net::set_stream");
@@ -1146,11 +1146,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_net_init */
PHPAPI MYSQLND_NET *
-mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
MYSQLND_NET * net;
DBG_ENTER("mysqlnd_net_init");
- net = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_io_channel(persistent, stats, error_info TSRMLS_CC);
+ net = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_io_channel(persistent, stats, error_info);
DBG_RETURN(net);
}
/* }}} */
@@ -1158,11 +1158,11 @@ mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO
/* {{{ mysqlnd_net_free */
PHPAPI void
-mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info)
{
DBG_ENTER("mysqlnd_net_free");
if (net) {
- net->data->m.dtor(net, stats, error_info TSRMLS_CC);
+ net->data->m.dtor(net, stats, error_info);
}
DBG_VOID_RETURN;
}
diff --git a/ext/mysqlnd/mysqlnd_net.h b/ext/mysqlnd/mysqlnd_net.h
index 699dd7f7d5..4f67697d51 100644
--- a/ext/mysqlnd/mysqlnd_net.h
+++ b/ext/mysqlnd/mysqlnd_net.h
@@ -23,8 +23,8 @@
#ifndef MYSQLND_NET_H
#define MYSQLND_NET_H
-PHPAPI MYSQLND_NET * mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
-PHPAPI void mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
+PHPAPI MYSQLND_NET * mysqlnd_net_init(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+PHPAPI void mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
#endif /* MYSQLND_NET_H */
diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c
index 3bb3c05147..f6c78ca0bc 100644
--- a/ext/mysqlnd/mysqlnd_plugin.c
+++ b/ext/mysqlnd/mysqlnd_plugin.c
@@ -27,7 +27,7 @@
/*--------------------------------------------------------------------*/
#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
-static enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC);
+static enum_func_status mysqlnd_example_plugin_end(void * p);
static MYSQLND_STATS * mysqlnd_plugin_example_stats = NULL;
@@ -67,7 +67,7 @@ static struct st_mysqlnd_typeii_plugin_example mysqlnd_example_plugin =
/* {{{ mysqlnd_example_plugin_end */
static
-enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
+enum_func_status mysqlnd_example_plugin_end(void * p)
{
struct st_mysqlnd_typeii_plugin_example * plugin = (struct st_mysqlnd_typeii_plugin_example *) p;
DBG_ENTER("mysqlnd_example_plugin_end");
@@ -80,11 +80,11 @@ enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
/* {{{ mysqlnd_example_plugin_register */
void
-mysqlnd_example_plugin_register(TSRMLS_D)
+mysqlnd_example_plugin_register(void)
{
mysqlnd_stats_init(&mysqlnd_plugin_example_stats, EXAMPLE_STAT_LAST);
mysqlnd_example_plugin.plugin_header.plugin_stats.values = mysqlnd_plugin_example_stats;
- mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin TSRMLS_CC);
+ mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin);
}
/* }}} */
#endif /* defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 */
@@ -97,7 +97,7 @@ static unsigned int mysqlnd_plugins_counter = 0;
/* {{{ mysqlnd_plugin_subsystem_init */
void
-mysqlnd_plugin_subsystem_init(TSRMLS_D)
+mysqlnd_plugin_subsystem_init(void)
{
zend_hash_init(&mysqlnd_registered_plugins, 4 /* initial hash size */, NULL /* hash_func */, NULL /* dtor */, TRUE /* pers */);
}
@@ -106,11 +106,11 @@ mysqlnd_plugin_subsystem_init(TSRMLS_D)
/* {{{ mysqlnd_plugin_end_apply_func */
int
-mysqlnd_plugin_end_apply_func(zval *el TSRMLS_DC)
+mysqlnd_plugin_end_apply_func(zval *el)
{
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
if (plugin_header->m.plugin_shutdown) {
- plugin_header->m.plugin_shutdown(plugin_header TSRMLS_CC);
+ plugin_header->m.plugin_shutdown(plugin_header);
}
return ZEND_HASH_APPLY_REMOVE;
}
@@ -119,9 +119,9 @@ mysqlnd_plugin_end_apply_func(zval *el TSRMLS_DC)
/* {{{ mysqlnd_plugin_subsystem_end */
void
-mysqlnd_plugin_subsystem_end(TSRMLS_D)
+mysqlnd_plugin_subsystem_end(void)
{
- zend_hash_apply(&mysqlnd_registered_plugins, mysqlnd_plugin_end_apply_func TSRMLS_CC);
+ zend_hash_apply(&mysqlnd_registered_plugins, mysqlnd_plugin_end_apply_func);
zend_hash_destroy(&mysqlnd_registered_plugins);
}
/* }}} */
@@ -130,20 +130,19 @@ mysqlnd_plugin_subsystem_end(TSRMLS_D)
/* {{{ mysqlnd_plugin_register */
PHPAPI unsigned int mysqlnd_plugin_register()
{
- TSRMLS_FETCH();
- return mysqlnd_plugin_register_ex(NULL TSRMLS_CC);
+ return mysqlnd_plugin_register_ex(NULL);
}
/* }}} */
/* {{{ mysqlnd_plugin_register_ex */
-PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin TSRMLS_DC)
+PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin)
{
if (plugin) {
if (plugin->plugin_api_version == MYSQLND_PLUGIN_API_VERSION) {
zend_hash_str_update_ptr(&mysqlnd_registered_plugins, plugin->plugin_name, strlen(plugin->plugin_name), plugin);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Plugin API version mismatch while loading plugin %s. Expected %d, got %d",
+ php_error_docref(NULL, E_WARNING, "Plugin API version mismatch while loading plugin %s. Expected %d, got %d",
plugin->plugin_name, MYSQLND_PLUGIN_API_VERSION, plugin->plugin_api_version);
return 0xCAFE;
}
@@ -154,7 +153,7 @@ PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header *
/* {{{ mysqlnd_plugin_find */
-PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC)
+PHPAPI void * _mysqlnd_plugin_find(const char * const name)
{
void * plugin;
if ((plugin = zend_hash_str_find_ptr(&mysqlnd_registered_plugins, name, strlen(name))) != NULL) {
@@ -167,7 +166,7 @@ PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC)
/* {{{ _mysqlnd_plugin_apply_with_argument */
-PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC)
+PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument)
{
/* Note: We want to be thread-safe (read-only), so we can use neither
* zend_hash_apply_with_argument nor zend_hash_internal_pointer_reset and
@@ -177,9 +176,9 @@ PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, voi
int result;
ZEND_HASH_FOREACH_VAL(&mysqlnd_registered_plugins, val) {
- result = apply_func(val, argument TSRMLS_CC);
+ result = apply_func(val, argument);
if (result & ZEND_HASH_APPLY_REMOVE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mysqlnd_plugin_apply_with_argument must not remove table entries");
+ php_error_docref(NULL, E_WARNING, "mysqlnd_plugin_apply_with_argument must not remove table entries");
}
if (result & ZEND_HASH_APPLY_STOP) {
break;
diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h
index f05e352baa..51e4b33813 100644
--- a/ext/mysqlnd/mysqlnd_priv.h
+++ b/ext/mysqlnd/mysqlnd_priv.h
@@ -148,11 +148,11 @@
#define SET_STMT_ERROR(stmt, a, b, c) SET_CLIENT_ERROR(*(stmt)->error_info, a, b, c)
-#define CONN_GET_STATE(c) (c)->m->get_state((c) TSRMLS_CC)
-#define CONN_SET_STATE(c, s) (c)->m->set_state((c), (s) TSRMLS_CC)
+#define CONN_GET_STATE(c) (c)->m->get_state((c))
+#define CONN_SET_STATE(c, s) (c)->m->set_state((c), (s))
/* PS stuff */
-typedef void (*ps_field_fetch_func)(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC);
+typedef void (*ps_field_fetch_func)(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row);
struct st_mysqlnd_perm_bind {
ps_field_fetch_func func;
/* should be signed int */
@@ -164,8 +164,8 @@ struct st_mysqlnd_perm_bind {
extern struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
-enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC);
-enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC);
+enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything);
+enum_func_status mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything);
PHPAPI extern const char * const mysqlnd_old_passwd;
@@ -182,21 +182,21 @@ PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol);
PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net);
-enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning TSRMLS_DC);
+enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning);
void _mysqlnd_init_ps_subsystem();/* This one is private, mysqlnd_library_init() will call it */
void _mysqlnd_init_ps_fetch_subsystem();
-void ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row, unsigned int byte_count TSRMLS_DC);
+void ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row, unsigned int byte_count);
-void mysqlnd_plugin_subsystem_init(TSRMLS_D);
-void mysqlnd_plugin_subsystem_end(TSRMLS_D);
+void mysqlnd_plugin_subsystem_init(void);
+void mysqlnd_plugin_subsystem_end(void);
-void mysqlnd_register_builtin_authentication_plugins(TSRMLS_D);
+void mysqlnd_register_builtin_authentication_plugins(void);
-void mysqlnd_example_plugin_register(TSRMLS_D);
+void mysqlnd_example_plugin_register(void);
struct st_mysqlnd_packet_greet;
struct st_mysqlnd_authentication_plugin;
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 1b2602e6b6..08e5776e7b 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -37,15 +37,15 @@ const char * const mysqlnd_not_bound_as_blob = "Can't send long data for non-str
const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
-enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
+enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
-static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
-static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
+static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt);
+static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no);
/* {{{ mysqlnd_stmt::store_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -67,7 +67,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->cursor_exists) {
/* Silently convert buffered to unbuffered, for now */
- DBG_RETURN(s->m->use_result(s TSRMLS_CC));
+ DBG_RETURN(s->m->use_result(s));
}
/* Nothing to store for UPSERT/LOAD DATA*/
@@ -89,13 +89,13 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
result->type = MYSQLND_RES_PS_BUF;
/* result->m.row_decoder = php_mysqlnd_rowp_read_binary_protocol; */
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, TRUE, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, TRUE, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
- ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buffers, TRUE TSRMLS_CC);
+ ret = result->m.store_result_fetch_data(conn, result, result->meta, &result->stored_data->row_buffers, TRUE);
result->stored_data->m.fetch_row = mysqlnd_stmt_fetch_row_buffered;
@@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED;
} else {
COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info);
- stmt->result->m.free_result_contents(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
@@ -142,7 +142,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::get_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -163,7 +163,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->cursor_exists) {
/* Silently convert buffered to unbuffered, for now */
- DBG_RETURN(s->m->use_result(s TSRMLS_CC));
+ DBG_RETURN(s->m->use_result(s));
}
/* Nothing to store for UPSERT/LOAD DATA*/
@@ -178,19 +178,19 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_BUFFERED_SETS);
do {
- result = conn->m->result_init(stmt->result->field_count, stmt->persistent TSRMLS_CC);
+ result = conn->m->result_init(stmt->result->field_count, stmt->persistent);
if (!result) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE TSRMLS_CC);
+ result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE);
if (!result->meta) {
SET_OOM_ERROR(*conn->error_info);
break;
}
- if ((result = result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY TSRMLS_CC))) {
+ if ((result = result->m.store_result(result, conn, MYSQLND_STORE_PS | MYSQLND_STORE_NO_COPY))) {
stmt->upsert_status->affected_rows = result->stored_data->row_count;
stmt->state = MYSQLND_STMT_PREPARED;
result->type = MYSQLND_RES_PS_BUF;
@@ -203,7 +203,7 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
} while (0);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
DBG_RETURN(NULL);
}
@@ -212,12 +212,12 @@ MYSQLND_METHOD(mysqlnd_stmt, get_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::more_results */
static zend_bool
-MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::more_results");
/* (conn->state == CONN_NEXT_RESULT_PENDING) too */
- DBG_RETURN((stmt && stmt->conn && (stmt->conn->m->get_server_status(stmt->conn TSRMLS_CC) & SERVER_MORE_RESULTS_EXISTS))?
+ DBG_RETURN((stmt && stmt->conn && (stmt->conn->m->get_server_status(stmt->conn) & SERVER_MORE_RESULTS_EXISTS))?
TRUE:
FALSE);
}
@@ -226,7 +226,7 @@ MYSQLND_METHOD(mysqlnd_stmt, more_results)(const MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt::next_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -245,9 +245,9 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
/* Free space for next result */
- s->m->free_stmt_result(s TSRMLS_CC);
+ s->m->free_stmt_result(s);
{
- enum_func_status ret = s->m->parse_execute_response(s TSRMLS_CC);
+ enum_func_status ret = s->m->parse_execute_response(s);
DBG_RETURN(ret);
}
}
@@ -256,7 +256,7 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt_skip_metadata */
static enum_func_status
-mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
/* Follows parameter metadata, we have just to skip it, as libmysql does */
@@ -270,7 +270,7 @@ mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ field_packet = stmt->conn->protocol->m.get_result_field_packet(stmt->conn->protocol, FALSE);
if (!field_packet) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
@@ -293,7 +293,7 @@ mysqlnd_stmt_skip_metadata(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt_read_prepare_response */
static enum_func_status
-mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_PACKET_PREPARE_RESPONSE * prepare_resp;
@@ -305,7 +305,7 @@ mysqlnd_stmt_read_prepare_response(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ prepare_resp = stmt->conn->protocol->m.get_prepare_response_packet(stmt->conn->protocol, FALSE);
if (!prepare_resp) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
@@ -337,7 +337,7 @@ done:
/* {{{ mysqlnd_stmt_prepare_read_eof */
static enum_func_status
-mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_PACKET_EOF * fields_eof;
@@ -349,14 +349,14 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
}
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
- fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE TSRMLS_CC);
+ fields_eof = stmt->conn->protocol->m.get_eof_packet(stmt->conn->protocol, FALSE);
if (!fields_eof) {
SET_OOM_ERROR(*stmt->error_info);
SET_OOM_ERROR(*stmt->conn->error_info);
} else {
if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) {
if (stmt->result) {
- stmt->result->m.free_result_contents(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
memset(stmt, 0, sizeof(MYSQLND_STMT_DATA));
stmt->state = MYSQLND_STMT_INITTED;
@@ -376,7 +376,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_stmt::prepare */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const query, unsigned int query_len TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const query, unsigned int query_len)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_STMT * s_to_prepare = s;
@@ -400,32 +400,32 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
/* Do implicit use_result and then flush the result */
stmt->default_rset_handler = s->m->use_result;
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
/* No 'else' here please :) */
if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE && stmt->result) {
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
/*
Create a new test statement, which we will prepare, but if anything
fails, we will scrap it.
*/
- s_to_prepare = stmt->conn->m->stmt_init(stmt->conn TSRMLS_CC);
+ s_to_prepare = stmt->conn->m->stmt_init(stmt->conn);
if (!s_to_prepare) {
goto fail;
}
stmt_to_prepare = s_to_prepare->data;
}
- if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (const zend_uchar *) query, query_len, PROT_LAST, FALSE, TRUE TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_read_prepare_response(s_to_prepare TSRMLS_CC))
+ if (FAIL == stmt_to_prepare->conn->m->simple_command(stmt_to_prepare->conn, COM_STMT_PREPARE, (const zend_uchar *) query, query_len, PROT_LAST, FALSE, TRUE) ||
+ FAIL == mysqlnd_stmt_read_prepare_response(s_to_prepare))
{
goto fail;
}
if (stmt_to_prepare->param_count) {
- if (FAIL == mysqlnd_stmt_skip_metadata(s_to_prepare TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC))
+ if (FAIL == mysqlnd_stmt_skip_metadata(s_to_prepare) ||
+ FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare))
{
goto fail;
}
@@ -437,7 +437,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
no metadata at prepare.
*/
if (stmt_to_prepare->field_count) {
- MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->persistent TSRMLS_CC);
+ MYSQLND_RES * result = stmt->conn->m->result_init(stmt_to_prepare->field_count, stmt_to_prepare->persistent);
if (!result) {
SET_OOM_ERROR(*stmt->conn->error_info);
goto fail;
@@ -445,12 +445,12 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
/* Allocate the result now as it is needed for the reading of metadata */
stmt_to_prepare->result = result;
- result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn TSRMLS_CC);
+ result->conn = stmt_to_prepare->conn->m->get_reference(stmt_to_prepare->conn);
result->type = MYSQLND_RES_PS_BUF;
- if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn TSRMLS_CC) ||
- FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare TSRMLS_CC))
+ if (FAIL == result->m.read_result_metadata(result, stmt_to_prepare->conn) ||
+ FAIL == mysqlnd_stmt_prepare_read_eof(s_to_prepare))
{
goto fail;
}
@@ -469,7 +469,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
stmt_to_prepare = stmt;
stmt = tmp_swap_data;
}
- s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
+ s_to_prepare->m->dtor(s_to_prepare, TRUE);
}
stmt->state = MYSQLND_STMT_PREPARED;
DBG_INF("PASS");
@@ -477,7 +477,7 @@ MYSQLND_METHOD(mysqlnd_stmt, prepare)(MYSQLND_STMT * const s, const char * const
fail:
if (stmt_to_prepare != stmt && s_to_prepare) {
- s_to_prepare->m->dtor(s_to_prepare, TRUE TSRMLS_CC);
+ s_to_prepare->m->dtor(s_to_prepare, TRUE);
}
stmt->state = MYSQLND_STMT_INITTED;
@@ -489,7 +489,7 @@ fail:
/* {{{ mysqlnd_stmt_execute_parse_response */
static enum_func_status
-mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
+mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -502,7 +502,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
conn = stmt->conn;
CONN_SET_STATE(conn, CONN_QUERY_SENT);
- ret = mysqlnd_query_read_result_set_header(stmt->conn, s TSRMLS_CC);
+ ret = mysqlnd_query_read_result_set_header(stmt->conn, s);
if (ret == FAIL) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
memset(stmt->upsert_status, 0, sizeof(*stmt->upsert_status));
@@ -535,7 +535,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
For SHOW we don't create (bypasses PS in server)
a result set at prepare and thus a connection was missing
*/
- stmt->result->conn = stmt->conn->m->get_reference(stmt->conn TSRMLS_CC);
+ stmt->result->conn = stmt->conn->m->get_reference(stmt->conn);
}
/* Update stmt->field_count as SHOW sets it to 0 at prepare */
@@ -587,10 +587,10 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
}
#ifndef MYSQLND_DONT_SKIP_OUT_PARAMS_RESULTSET
if (stmt->upsert_status->server_status & SERVER_PS_OUT_PARAMS) {
- s->m->free_stmt_content(s TSRMLS_CC);
+ s->m->free_stmt_content(s);
DBG_INF("PS OUT Variable RSet, skipping");
/* OUT params result set. Skip for now to retain compatibility */
- ret = mysqlnd_stmt_execute_parse_response(s TSRMLS_CC);
+ ret = mysqlnd_stmt_execute_parse_response(s);
}
#endif
@@ -602,7 +602,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::execute */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -655,14 +655,14 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
}
#endif
- s->m->flush(s TSRMLS_CC);
+ s->m->flush(s);
/*
Executed, but the user hasn't started to fetch
This will clean also the metadata, but after the EXECUTE call we will
have it again.
*/
- stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_buffers(stmt->result);
stmt->state = MYSQLND_STMT_PREPARED;
} else if (stmt->state < MYSQLND_STMT_PREPARED) {
@@ -699,12 +699,12 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
DBG_RETURN(FAIL);
}
}
- ret = s->m->generate_execute_request(s, &request, &request_len, &free_request TSRMLS_CC);
+ ret = s->m->generate_execute_request(s, &request, &request_len, &free_request);
if (ret == PASS) {
/* support for buffer types should be added here ! */
ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, request, request_len,
PROT_LAST /* we will handle the response packet*/,
- FALSE, FALSE TSRMLS_CC);
+ FALSE, FALSE);
} else {
SET_STMT_ERROR(stmt, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, "Couldn't generate the request. Possibly OOM.");
}
@@ -720,7 +720,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
}
stmt->execute_count++;
- ret = s->m->parse_execute_response(s TSRMLS_CC);
+ ret = s->m->parse_execute_response(s);
DBG_INF_FMT("server_status=%u cursor=%u", stmt->upsert_status->server_status, stmt->upsert_status->server_status & SERVER_STATUS_CURSOR_EXISTS);
@@ -734,7 +734,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_fetch_row_buffered */
enum_func_status
-mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
@@ -763,7 +763,7 @@ mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int
meta->field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -835,7 +835,7 @@ mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES * result, void * param, unsigned int
/* {{{ mysqlnd_stmt_fetch_row_unbuffered */
enum_func_status
-mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
@@ -873,7 +873,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
unsigned int i, field_count = result->field_count;
if (!row_packet->skip_extraction) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -885,7 +885,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
row_packet->field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC))
+ result->conn->stats))
{
DBG_RETURN(FAIL);
}
@@ -923,7 +923,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
the bound variables. Thus we need to do part of what it does or Zend will
report leaks.
*/
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
@@ -962,7 +962,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, unsigned i
/* {{{ mysqlnd_stmt::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_RES * result;
@@ -992,7 +992,7 @@ MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_PS_UNBUFFERED_SETS);
result = stmt->result;
- result->m.use_result(stmt->result, TRUE TSRMLS_CC);
+ result->m.use_result(stmt->result, TRUE);
result->unbuf->m.fetch_row = stmt->cursor_exists? mysqlnd_fetch_stmt_row_cursor:
mysqlnd_stmt_fetch_row_unbuffered;
stmt->state = MYSQLND_STMT_USE_OR_STORE_CALLED;
@@ -1007,7 +1007,7 @@ MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s TSRMLS_DC)
/* {{{ mysqlnd_fetch_row_cursor */
enum_func_status
-mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
@@ -1043,7 +1043,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
if (FAIL == stmt->conn->m->simple_command(stmt->conn, COM_STMT_FETCH, buf, sizeof(buf),
PROT_LAST /* we will handle the response packet*/,
- FALSE, TRUE TSRMLS_CC)) {
+ FALSE, TRUE)) {
COPY_CLIENT_ERROR(*stmt->error_info, *stmt->conn->error_info);
DBG_RETURN(FAIL);
}
@@ -1056,7 +1056,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
unsigned int i, field_count = result->field_count;
if (!row_packet->skip_extraction) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -1068,7 +1068,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
row_packet->field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC))
+ result->conn->stats))
{
DBG_RETURN(FAIL);
}
@@ -1110,13 +1110,13 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
the bound variables. Thus we need to do part of what it does or Zend will
report leaks.
*/
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
/* We asked for one row, the next one should be EOF, eat it */
ret = PACKET_READ(row_packet, result->conn);
if (row_packet->row_buffer) {
- row_packet->row_buffer->free_chunk(row_packet->row_buffer TSRMLS_CC);
+ row_packet->row_buffer->free_chunk(row_packet->row_buffer);
row_packet->row_buffer = NULL;
}
MYSQLND_INC_CONN_STATISTIC(stmt->conn->stats, STAT_ROWS_FETCHED_FROM_CLIENT_PS_CURSOR);
@@ -1154,7 +1154,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int f
/* {{{ mysqlnd_stmt::fetch */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fetched_anything)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret;
@@ -1173,7 +1173,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
} else if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
/* Execute only once. We have to free the previous contents of user's bound vars */
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
stmt->state = MYSQLND_STMT_USER_FETCHING;
@@ -1202,7 +1202,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
stmt->result_zvals_separated_once = TRUE;
}
- ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything TSRMLS_CC);
+ ret = stmt->result->m.fetch_row(stmt->result, (void*)s, 0, fetched_anything);
DBG_RETURN(ret);
}
/* }}} */
@@ -1210,7 +1210,7 @@ MYSQLND_METHOD(mysqlnd_stmt, fetch)(MYSQLND_STMT * const s, zend_bool * const fe
/* {{{ mysqlnd_stmt::reset */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = PASS;
@@ -1238,7 +1238,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
}
}
- s->m->flush(s TSRMLS_CC);
+ s->m->flush(s);
/*
Don't free now, let the result be usable. When the stmt will again be
@@ -1250,7 +1250,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
if (CONN_GET_STATE(conn) == CONN_READY &&
FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf,
sizeof(cmd_buf), PROT_OK_PACKET,
- FALSE, TRUE TSRMLS_CC))) {
+ FALSE, TRUE))) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
}
*stmt->upsert_status = *conn->upsert_status;
@@ -1263,7 +1263,7 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::flush */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = PASS;
@@ -1283,13 +1283,13 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
do {
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("fetching result set header");
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
stmt->state = MYSQLND_STMT_USER_FETCHING;
}
if (stmt->result) {
DBG_INF("skipping result");
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
}
@@ -1302,7 +1302,7 @@ MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::send_long_data */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned int param_no,
- const char * const data, zend_ulong length TSRMLS_DC)
+ const char * const data, zend_ulong length)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
enum_func_status ret = FAIL;
@@ -1363,7 +1363,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);
/* COM_STMT_SEND_LONG_DATA doesn't send an OK packet*/
- ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE TSRMLS_CC);
+ ret = conn->m->simple_command(conn, cmd, cmd_buf, packet_len, PROT_LAST , FALSE, TRUE);
mnd_efree(cmd_buf);
if (FAIL == ret) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
@@ -1393,8 +1393,8 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
#if HAVE_USLEEP && !defined(PHP_WIN32)
usleep(120000);
#endif
- if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error "
+ if ((packet_len = conn->net->m.consume_uneaten_data(conn->net, cmd))) {
+ php_error_docref(NULL, E_WARNING, "There was an error "
"while sending long data. Probably max_allowed_packet_size "
"is smaller than the data. You have to increase it or send "
"smaller chunks of data. Answer was "MYSQLND_SZ_T_SPEC" bytes long.", packet_len);
@@ -1413,7 +1413,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
/* {{{ mysqlnd_stmt::bind_parameters */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * const param_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_param");
@@ -1426,7 +1426,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared);
DBG_ERR("not prepared");
if (param_bind) {
- s->m->free_parameter_bind(s, param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, param_bind);
}
DBG_RETURN(FAIL);
}
@@ -1455,7 +1455,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
zval_ptr_dtor(&stmt->param_bind[i].zv);
}
if (stmt->param_bind != param_bind) {
- s->m->free_parameter_bind(s, stmt->param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, stmt->param_bind);
}
}
@@ -1482,7 +1482,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const s, MYSQLND_PA
/* {{{ mysqlnd_stmt::bind_one_parameter */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigned int param_no,
- zval * const zv, zend_uchar type TSRMLS_DC)
+ zval * const zv, zend_uchar type)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_one_parameter");
@@ -1536,7 +1536,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
/* {{{ mysqlnd_stmt::refresh_bind_param */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::refresh_bind_param");
@@ -1565,7 +1565,7 @@ MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const s TSRMLS_D
/* {{{ mysqlnd_stmt::bind_result */
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
- MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC)
+ MYSQLND_RESULT_BIND * const result_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_result");
@@ -1577,7 +1577,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
if (stmt->state < MYSQLND_STMT_PREPARED) {
SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared);
if (result_bind) {
- s->m->free_result_bind(s, result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, result_bind);
}
DBG_ERR("not prepared");
DBG_RETURN(FAIL);
@@ -1594,7 +1594,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
DBG_RETURN(FAIL);
}
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
stmt->result_zvals_separated_once = FALSE;
stmt->result_bind = result_bind;
for (i = 0; i < stmt->field_count; i++) {
@@ -1611,7 +1611,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
stmt->result_bind[i].bound = TRUE;
}
} else if (result_bind) {
- s->m->free_result_bind(s, result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, result_bind);
}
DBG_INF("PASS");
DBG_RETURN(PASS);
@@ -1621,7 +1621,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const s,
/* {{{ mysqlnd_stmt::bind_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned int param_no TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned int param_no)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::bind_result");
@@ -1646,7 +1646,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned i
SET_EMPTY_ERROR(*stmt->conn->error_info);
if (stmt->field_count) {
- mysqlnd_stmt_separate_one_result_bind(s, param_no TSRMLS_CC);
+ mysqlnd_stmt_separate_one_result_bind(s, param_no);
/* Guaranteed is that stmt->result_bind is NULL */
if (!stmt->result_bind) {
stmt->result_bind = mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent);
@@ -1672,7 +1672,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned i
/* {{{ mysqlnd_stmt::insert_id */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->last_insert_id : 0;
@@ -1682,7 +1682,7 @@ MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::affected_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->affected_rows : 0;
@@ -1692,7 +1692,7 @@ MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt && stmt->result? mysqlnd_num_rows(stmt->result):0;
@@ -1702,7 +1702,7 @@ MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::warning_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->warning_count : 0;
@@ -1712,7 +1712,7 @@ MYSQLND_METHOD(mysqlnd_stmt, warning_count)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::server_status */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->upsert_status->server_status : 0;
@@ -1722,7 +1722,7 @@ MYSQLND_METHOD(mysqlnd_stmt, server_status)(const MYSQLND_STMT * const s TSRMLS_
/* {{{ mysqlnd_stmt::field_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->field_count : 0;
@@ -1732,7 +1732,7 @@ MYSQLND_METHOD(mysqlnd_stmt, field_count)(const MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::param_count */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->param_count : 0;
@@ -1742,7 +1742,7 @@ MYSQLND_METHOD(mysqlnd_stmt, param_count)(const MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::errno */
static unsigned int
-MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->error_info->error_no : 0;
@@ -1752,7 +1752,7 @@ MYSQLND_METHOD(mysqlnd_stmt, errno)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::error */
static const char *
-MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt? stmt->error_info->error : 0;
@@ -1762,7 +1762,7 @@ MYSQLND_METHOD(mysqlnd_stmt, error)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::sqlstate */
static const char *
-MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
return stmt && stmt->error_info->sqlstate[0] ? stmt->error_info->sqlstate:MYSQLND_SQLSTATE_NULL;
@@ -1772,17 +1772,17 @@ MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const s, uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const s, uint64_t row)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
- return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row TSRMLS_CC) : FAIL;
+ return stmt && stmt->result? stmt->result->m.seek_data(stmt->result, row) : FAIL;
}
/* }}} */
/* {{{ mysqlnd_stmt::param_metadata */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (!stmt || !stmt->param_count) {
@@ -1795,7 +1795,7 @@ MYSQLND_METHOD(mysqlnd_stmt, param_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::result_metadata */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_RES *result;
@@ -1814,7 +1814,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
if (stmt->update_max_length && stmt->result->stored_data) {
/* stored result, we have to update the max_length before we clone the meta data :( */
stmt->result->stored_data->m.initialize_result_set_rest(stmt->result->stored_data, stmt->result->meta, stmt->conn->stats,
- stmt->conn->options->int_and_float_native TSRMLS_CC);
+ stmt->conn->options->int_and_float_native);
}
/*
TODO: This implementation is kind of a hack,
@@ -1826,17 +1826,17 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
result set, so we don't get one.
*/
do {
- result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent TSRMLS_CC);
+ result = stmt->conn->m->result_init(stmt->field_count, stmt->persistent);
if (!result) {
break;
}
result->type = MYSQLND_RES_NORMAL;
- result->unbuf = mysqlnd_result_unbuffered_init(stmt->field_count, TRUE, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(stmt->field_count, TRUE, result->persistent);
if (!result->unbuf) {
break;
}
result->unbuf->eof_reached = TRUE;
- result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE TSRMLS_CC);
+ result->meta = stmt->result->meta->m->clone_metadata(stmt->result->meta, FALSE);
if (!result->meta) {
break;
}
@@ -1847,7 +1847,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
SET_OOM_ERROR(*stmt->conn->error_info);
if (result) {
- result->m.free_result(result, TRUE TSRMLS_CC);
+ result->m.free_result(result, TRUE);
}
DBG_RETURN(NULL);
}
@@ -1858,7 +1858,7 @@ MYSQLND_METHOD(mysqlnd_stmt, result_metadata)(MYSQLND_STMT * const s TSRMLS_DC)
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
enum mysqlnd_stmt_attr attr_type,
- const void * const value TSRMLS_DC)
+ const void * const value)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::attr_set");
@@ -1913,7 +1913,7 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
static enum_func_status
MYSQLND_METHOD(mysqlnd_stmt, attr_get)(const MYSQLND_STMT * const s,
enum mysqlnd_stmt_attr attr_type,
- void * const value TSRMLS_DC)
+ void * const value)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::attr_set");
@@ -1944,7 +1944,7 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_get)(const MYSQLND_STMT * const s,
/* free_result() doesn't actually free stmt->result but only the buffers */
/* {{{ mysqlnd_stmt::free_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_result");
@@ -1966,21 +1966,21 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
DBG_INF("fetching result set header");
/* Do implicit use_result and then flush the result */
stmt->default_rset_handler = s->m->use_result;
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
}
if (stmt->state > MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("skipping result");
/* Flush if anything is left and unbuffered set */
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
/*
Separate the bound variables, which point to the result set, then
destroy the set.
*/
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
/* Now we can destroy the result set */
- stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_buffers(stmt->result);
}
if (stmt->state > MYSQLND_STMT_PREPARED) {
@@ -1998,7 +1998,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_separate_result_bind */
static void
-mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
+mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
unsigned int i;
@@ -2027,7 +2027,7 @@ mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
}
}
- s->m->free_result_bind(s, stmt->result_bind TSRMLS_CC);
+ s->m->free_result_bind(s, stmt->result_bind);
stmt->result_bind = NULL;
DBG_VOID_RETURN;
@@ -2037,7 +2037,7 @@ mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt_separate_one_result_bind */
static void
-mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param_no TSRMLS_DC)
+mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param_no)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt_separate_one_result_bind");
@@ -2070,7 +2070,7 @@ mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const s, unsigned int param
/* {{{ mysqlnd_stmt::free_stmt_result */
static void
-MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_stmt_result");
@@ -2082,10 +2082,10 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
First separate the bound variables, which point to the result set, then
destroy the set.
*/
- mysqlnd_stmt_separate_result_bind(s TSRMLS_CC);
+ mysqlnd_stmt_separate_result_bind(s);
/* Not every statement has a result set attached */
if (stmt->result) {
- stmt->result->m.free_result_internal(stmt->result TSRMLS_CC);
+ stmt->result->m.free_result_internal(stmt->result);
stmt->result = NULL;
}
if (stmt->error_info->error_list) {
@@ -2101,7 +2101,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::free_stmt_content */
static void
-MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::free_stmt_content");
@@ -2125,11 +2125,11 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
*/
zval_ptr_dtor(&stmt->param_bind[i].zv);
}
- s->m->free_parameter_bind(s, stmt->param_bind TSRMLS_CC);
+ s->m->free_parameter_bind(s, stmt->param_bind);
stmt->param_bind = NULL;
}
- s->m->free_stmt_result(s TSRMLS_CC);
+ s->m->free_stmt_result(s);
DBG_VOID_RETURN;
}
/* }}} */
@@ -2137,7 +2137,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC
/* {{{ mysqlnd_stmt::net_close */
static enum_func_status
-MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_bool implicit)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
MYSQLND_CONN_DATA * conn;
@@ -2163,14 +2163,14 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
do {
if (stmt->state == MYSQLND_STMT_WAITING_USE_OR_STORE) {
DBG_INF("fetching result set header");
- stmt->default_rset_handler(s TSRMLS_CC);
+ stmt->default_rset_handler(s);
stmt->state = MYSQLND_STMT_USER_FETCHING;
}
/* unbuffered set not fetched to the end ? Clean the line */
if (stmt->result) {
DBG_INF("skipping result");
- stmt->result->m.skip_result(stmt->result TSRMLS_CC);
+ stmt->result->m.skip_result(stmt->result);
}
} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
/*
@@ -2185,7 +2185,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
if (CONN_GET_STATE(conn) == CONN_READY &&
FAIL == conn->m->simple_command(conn, COM_STMT_CLOSE, cmd_buf, sizeof(cmd_buf),
PROT_LAST /* COM_STMT_CLOSE doesn't send an OK packet*/,
- FALSE, TRUE TSRMLS_CC)) {
+ FALSE, TRUE)) {
COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
DBG_RETURN(FAIL);
}
@@ -2209,10 +2209,10 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
stmt->execute_cmd_buffer.buffer = NULL;
}
- s->m->free_stmt_content(s TSRMLS_CC);
+ s->m->free_stmt_content(s);
if (stmt->conn) {
- stmt->conn->m->free_reference(stmt->conn TSRMLS_CC);
+ stmt->conn->m->free_reference(stmt->conn);
stmt->conn = NULL;
}
@@ -2222,7 +2222,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_stmt, net_close)(MYSQLND_STMT * const s, zend_boo
/* {{{ mysqlnd_stmt::dtor */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit)
{
MYSQLND_STMT_DATA * stmt = (s != NULL) ? s->data:NULL;
enum_func_status ret = FAIL;
@@ -2235,7 +2235,7 @@ MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TS
MYSQLND_INC_GLOBAL_STATISTIC(implicit == TRUE? STAT_STMT_CLOSE_IMPLICIT:
STAT_STMT_CLOSE_EXPLICIT);
- ret = s->m->net_close(s, implicit TSRMLS_CC);
+ ret = s->m->net_close(s, implicit);
mnd_pefree(stmt, persistent);
}
mnd_pefree(s, persistent);
@@ -2248,7 +2248,7 @@ MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TS
/* {{{ mysqlnd_stmt::alloc_param_bind */
static MYSQLND_PARAM_BIND *
-MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::alloc_param_bind");
@@ -2262,7 +2262,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_param_bind)(MYSQLND_STMT * const s TSRMLS_DC)
/* {{{ mysqlnd_stmt::alloc_result_bind */
static MYSQLND_RESULT_BIND *
-MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
DBG_ENTER("mysqlnd_stmt::alloc_result_bind");
@@ -2276,7 +2276,7 @@ MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind)(MYSQLND_STMT * const s TSRMLS_DC
/* {{{ param_bind::free_parameter_bind */
PHPAPI void
-MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * param_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLND_PARAM_BIND * param_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (stmt) {
@@ -2288,7 +2288,7 @@ MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind)(MYSQLND_STMT * const s, MYSQLN
/* {{{ mysqlnd_stmt::free_result_bind */
PHPAPI void
-MYSQLND_METHOD(mysqlnd_stmt, free_result_bind)(MYSQLND_STMT * const s, MYSQLND_RESULT_BIND * result_bind TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, free_result_bind)(MYSQLND_STMT * const s, MYSQLND_RESULT_BIND * result_bind)
{
MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
if (stmt) {
@@ -2355,11 +2355,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ _mysqlnd_stmt_init */
MYSQLND_STMT *
-_mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
+_mysqlnd_stmt_init(MYSQLND_CONN_DATA * const conn)
{
MYSQLND_STMT * ret;
DBG_ENTER("_mysqlnd_stmt_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_prepared_statement(conn);
DBG_RETURN(ret);
}
/* }}} */
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index e98d1c3a52..4a68970d50 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -55,7 +55,7 @@ struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
/* {{{ ps_fetch_from_1_to_8_bytes */
void
ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len,
- zend_uchar ** row, unsigned int byte_count TSRMLS_DC)
+ zend_uchar ** row, unsigned int byte_count)
{
char tmp[22];
size_t tmp_len = 0;
@@ -127,7 +127,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne
/* {{{ ps_fetch_null */
static void
-ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
ZVAL_NULL(zv);
}
@@ -136,43 +136,43 @@ ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field, unsigned int pack_len
/* {{{ ps_fetch_int8 */
static void
-ps_fetch_int8(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int8(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 1 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 1);
}
/* }}} */
/* {{{ ps_fetch_int16 */
static void
-ps_fetch_int16(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int16(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 2 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 2);
}
/* }}} */
/* {{{ ps_fetch_int32 */
static void
-ps_fetch_int32(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int32(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 4 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 4);
}
/* }}} */
/* {{{ ps_fetch_int64 */
static void
-ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_int64(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 8 TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, 8);
}
/* }}} */
/* {{{ ps_fetch_float */
static void
-ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
float fval;
double dval;
@@ -238,7 +238,7 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
/* {{{ ps_fetch_double */
static void
-ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
double value;
DBG_ENTER("ps_fetch_double");
@@ -253,7 +253,7 @@ ps_fetch_double(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_
/* {{{ ps_fetch_time */
static void
-ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t;
zend_ulong length; /* First byte encodes the length*/
@@ -296,7 +296,7 @@ ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_le
/* {{{ ps_fetch_date */
static void
-ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t = {0};
zend_ulong length; /* First byte encodes the length*/
@@ -333,7 +333,7 @@ ps_fetch_date(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_le
/* {{{ ps_fetch_datetime */
static void
-ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
struct st_mysqlnd_time t;
zend_ulong length; /* First byte encodes the length*/
@@ -377,7 +377,7 @@ ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, unsigned int pac
/* {{{ ps_fetch_string */
static void
-ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
/*
For now just copy, before we make it possible
@@ -397,10 +397,10 @@ ps_fetch_string(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_
/* {{{ ps_fetch_bit */
static void
-ps_fetch_bit(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row TSRMLS_DC)
+ps_fetch_bit(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_len, zend_uchar ** row)
{
zend_ulong length = php_mysqlnd_net_field_length(row);
- ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, length TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, length);
}
/* }}} */
@@ -550,7 +550,7 @@ void _mysqlnd_init_ps_fetch_subsystem()
/* {{{ mysqlnd_stmt_copy_it */
static enum_func_status
-mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count, unsigned int current TSRMLS_DC)
+mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count, unsigned int current)
{
if (!*copies) {
*copies = mnd_ecalloc(param_count, sizeof(zval));
@@ -566,7 +566,7 @@ mysqlnd_stmt_copy_it(zval ** copies, zval * original, unsigned int param_count,
/* {{{ mysqlnd_stmt_free_copies */
static void
-mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies TSRMLS_DC)
+mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies)
{
if (copies) {
unsigned int i;
@@ -581,7 +581,7 @@ mysqlnd_stmt_free_copies(MYSQLND_STMT_DATA * stmt, zval *copies TSRMLS_DC)
/* {{{ mysqlnd_stmt_execute_check_n_enlarge_buffer */
static enum_func_status
-mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, size_t * buf_len, zend_uchar * const provided_buffer, size_t needed_bytes TSRMLS_DC)
+mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, size_t * buf_len, zend_uchar * const provided_buffer, size_t needed_bytes)
{
const size_t overalloc = 5;
size_t left = (*buf_len - (*p - *buf));
@@ -609,7 +609,7 @@ mysqlnd_stmt_execute_check_n_enlarge_buffer(zend_uchar **buf, zend_uchar **p, si
/* {{{ mysqlnd_stmt_execute_prepare_param_types */
static enum_func_status
-mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copies_param, int * resend_types_next_time TSRMLS_DC)
+mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copies_param, int * resend_types_next_time)
{
unsigned int i;
DBG_ENTER("mysqlnd_stmt_execute_prepare_param_types");
@@ -621,7 +621,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) {
/* always copy the var, because we do many conversions */
if (Z_TYPE_P(parameter) != IS_LONG &&
- PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i TSRMLS_CC))
+ PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i))
{
SET_OOM_ERROR(*stmt->error_info);
goto end;
@@ -710,7 +710,7 @@ mysqlnd_stmt_execute_store_types(MYSQLND_STMT_DATA * stmt, zval * copies, zend_u
/* {{{ mysqlnd_stmt_execute_calculate_param_values_size */
static enum_func_status
-mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval ** copies_param, size_t * data_size TSRMLS_DC)
+mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval ** copies_param, size_t * data_size)
{
unsigned int i;
DBG_ENTER("mysqlnd_stmt_execute_calculate_param_values_size");
@@ -730,7 +730,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval
if (Z_ISREF(stmt->param_bind[j].zv) && Z_REFVAL(stmt->param_bind[j].zv) == the_var) {
/* Double binding of the same zval, make a copy */
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -745,7 +745,7 @@ mysqlnd_stmt_execute_calculate_param_values_size(MYSQLND_STMT_DATA * stmt, zval
*data_size += 8;
if (Z_TYPE_P(the_var) != IS_DOUBLE) {
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -780,7 +780,7 @@ use_string:
*data_size += 8; /* max 8 bytes for size */
if (Z_TYPE_P(the_var) != IS_STRING) {
if (!*copies_param || Z_ISUNDEF((*copies_param)[i])) {
- if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i TSRMLS_CC)) {
+ if (PASS != mysqlnd_stmt_copy_it(copies_param, the_var, stmt->param_count, i)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -866,7 +866,7 @@ send_string:
/* {{{ mysqlnd_stmt_execute_store_params */
static enum_func_status
-mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar **p, size_t *buf_len TSRMLS_DC)
+mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar **p, size_t *buf_len )
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar * provided_buffer = *buf;
@@ -880,7 +880,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
{
unsigned int null_count = (stmt->param_count + 7) / 8;
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, null_count TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, null_count)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -898,7 +898,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
won't expect it and interpret the value as 0. Thus we need to resend the types, if any such values
occur, and force resend for the next execution.
*/
- if (FAIL == mysqlnd_stmt_execute_prepare_param_types(stmt, &copies, &resend_types_next_time TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_prepare_param_types(stmt, &copies, &resend_types_next_time)) {
goto end;
}
@@ -906,7 +906,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
(*p)++;
if (stmt->send_types_to_server) {
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, stmt->param_count * 2 TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, stmt->param_count * 2)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -917,12 +917,12 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
/* 2. Store data */
/* 2.1 Calculate how much space we need */
- if (FAIL == mysqlnd_stmt_execute_calculate_param_values_size(stmt, &copies, &data_size TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_calculate_param_values_size(stmt, &copies, &data_size)) {
goto end;
}
/* 2.2 Enlarge the buffer, if needed */
- if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, data_size TSRMLS_CC)) {
+ if (FAIL == mysqlnd_stmt_execute_check_n_enlarge_buffer(buf, p, buf_len, provided_buffer, data_size)) {
SET_OOM_ERROR(*stmt->error_info);
goto end;
}
@@ -932,7 +932,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar
ret = PASS;
end:
- mysqlnd_stmt_free_copies(stmt, copies TSRMLS_CC);
+ mysqlnd_stmt_free_copies(stmt, copies);
DBG_INF_FMT("ret=%s", ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -942,7 +942,7 @@ end:
/* {{{ mysqlnd_stmt_execute_generate_request */
enum_func_status
-mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC)
+mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer)
{
MYSQLND_STMT_DATA * stmt = s->data;
zend_uchar *p = stmt->execute_cmd_buffer.buffer,
@@ -965,7 +965,7 @@ mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** requ
int1store(p, 1); /* and send 1 for iteration count */
p+= 4;
- ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length TSRMLS_CC);
+ ret = mysqlnd_stmt_execute_store_params(s, &cmd_buffer, &p, &cmd_buffer_length);
*free_buffer = (cmd_buffer != stmt->execute_cmd_buffer.buffer);
*request_len = (p - cmd_buffer);
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index 610642d8de..5ad5837875 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -35,7 +35,7 @@
/* {{{ mysqlnd_result_buffered_zval::initialize_result_set_rest */
static enum_func_status
MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC)
+ MYSQLND_STATS * stats, zend_bool int_and_float_native)
{
unsigned int i;
enum_func_status ret = PASS;
@@ -58,7 +58,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND
field_count,
meta->fields,
int_and_float_native,
- stats TSRMLS_CC);
+ stats);
if (rc != PASS) {
ret = FAIL;
break;
@@ -88,7 +88,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, initialize_result_set_rest)(MYSQLND
/* {{{ mysqlnd_result_buffered_c::initialize_result_set_rest */
static enum_func_status
MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC)
+ MYSQLND_STATS * stats, zend_bool int_and_float_native)
{
unsigned int i;
enum_func_status ret = PASS;
@@ -111,7 +111,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RE
continue;
}
- rc = result->m.row_decoder(result->row_buffers[i], current_row, field_count, meta->fields, int_and_float_native, stats TSRMLS_CC);
+ rc = result->m.row_decoder(result->row_buffers[i], current_row, field_count, meta->fields, int_and_float_native, stats);
if (rc != PASS) {
ret = FAIL;
@@ -143,7 +143,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, initialize_result_set_rest)(MYSQLND_RE
/* {{{ mysqlnd_result_unbuffered::free_last_data */
static void
-MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED * unbuf, MYSQLND_STATS * const global_stats TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED * unbuf, MYSQLND_STATS * const global_stats)
{
DBG_ENTER("mysqlnd_res::unbuffered_free_last_data");
@@ -165,7 +165,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED
if (unbuf->last_row_buffer) {
DBG_INF("Freeing last row buffer");
/* Nothing points to this buffer now, free it */
- unbuf->last_row_buffer->free_chunk(unbuf->last_row_buffer TSRMLS_CC);
+ unbuf->last_row_buffer->free_chunk(unbuf->last_row_buffer);
unbuf->last_row_buffer = NULL;
}
@@ -176,10 +176,10 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_last_data)(MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_result_unbuffered::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats)
{
DBG_ENTER("mysqlnd_result_unbuffered, free_result");
- result->m.free_last_data(result, global_stats TSRMLS_CC);
+ result->m.free_last_data(result, global_stats);
if (result->lengths) {
mnd_pefree(result->lengths, result->persistent);
@@ -193,7 +193,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED *
}
if (result->result_set_memory_pool) {
- mysqlnd_mempool_destroy(result->result_set_memory_pool TSRMLS_CC);
+ mysqlnd_mempool_destroy(result->result_set_memory_pool);
result->result_set_memory_pool = NULL;
}
@@ -206,7 +206,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, free_result)(MYSQLND_RES_UNBUFFERED *
/* {{{ mysqlnd_result_buffered_zval::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_ZVAL * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_ZVAL * const set)
{
zval * data = set->data;
@@ -237,7 +237,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)(MYSQLND_RES_BUFFERED_Z
/* {{{ mysqlnd_result_buffered_c::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C * const set)
{
DBG_ENTER("mysqlnd_result_buffered_c::free_result");
mnd_pefree(set->initialized, set->persistent);
@@ -249,7 +249,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)(MYSQLND_RES_BUFFERED_C *
/* {{{ mysqlnd_result_buffered::free_result */
static void
-MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * const set TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * const set)
{
int64_t row;
@@ -257,14 +257,14 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);
if (set->type == MYSQLND_BUFFERED_TYPE_ZVAL) {
- MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)((MYSQLND_RES_BUFFERED_ZVAL *) set TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered_zval, free_result)((MYSQLND_RES_BUFFERED_ZVAL *) set);
} if (set->type == MYSQLND_BUFFERED_TYPE_C) {
- MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)((MYSQLND_RES_BUFFERED_C *) set TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered_c, free_result)((MYSQLND_RES_BUFFERED_C *) set);
}
for (row = set->row_count - 1; row >= 0; row--) {
MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row];
- current_buffer->free_chunk(current_buffer TSRMLS_CC);
+ current_buffer->free_chunk(current_buffer);
}
if (set->lengths) {
@@ -278,7 +278,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
}
if (set->result_set_memory_pool) {
- mysqlnd_mempool_destroy(set->result_set_memory_pool TSRMLS_CC);
+ mysqlnd_mempool_destroy(set->result_set_memory_pool);
set->result_set_memory_pool = NULL;
}
@@ -294,16 +294,16 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
/* {{{ mysqlnd_res::free_result_buffers */
static void
-MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_buffers");
DBG_INF_FMT("%s", result->unbuf? "unbuffered":(result->stored_data? "buffered":"unknown"));
if (result->unbuf) {
- result->unbuf->m.free_result(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_result(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf = NULL;
} else if (result->stored_data) {
- result->stored_data->m.free_result(result->stored_data TSRMLS_CC);
+ result->stored_data->m.free_result(result->stored_data);
result->stored_data = NULL;
}
@@ -315,14 +315,14 @@ MYSQLND_METHOD(mysqlnd_res, free_result_buffers)(MYSQLND_RES * result TSRMLS_DC)
/* {{{ mysqlnd_res::free_result_contents_internal */
static
-void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * result TSRMLS_DC)
+void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_contents_internal");
- result->m.free_result_buffers(result TSRMLS_CC);
+ result->m.free_result_buffers(result);
if (result->meta) {
- result->meta->m->free_metadata(result->meta TSRMLS_CC);
+ result->meta->m->free_metadata(result->meta);
result->meta = NULL;
}
@@ -333,15 +333,15 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * re
/* {{{ mysqlnd_res::free_result_internal */
static
-void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result TSRMLS_DC)
+void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result)
{
DBG_ENTER("mysqlnd_res::free_result_internal");
- result->m.skip_result(result TSRMLS_CC);
+ result->m.skip_result(result);
- result->m.free_result_contents(result TSRMLS_CC);
+ result->m.free_result_contents(result);
if (result->conn) {
- result->conn->m->free_reference(result->conn TSRMLS_CC);
+ result->conn->m->free_reference(result->conn);
result->conn = NULL;
}
@@ -354,7 +354,7 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_internal)(MYSQLND_RES * result TSRM
/* {{{ mysqlnd_res::read_result_metadata */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn)
{
DBG_ENTER("mysqlnd_res::read_result_metadata");
@@ -365,11 +365,11 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
infrastructure!
*/
if (result->meta) {
- result->meta->m->free_metadata(result->meta TSRMLS_CC);
+ result->meta->m->free_metadata(result->meta);
result->meta = NULL;
}
- result->meta = result->m.result_meta_init(result->field_count, result->persistent TSRMLS_CC);
+ result->meta = result->m.result_meta_init(result->field_count, result->persistent);
if (!result->meta) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -378,8 +378,8 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
/* 1. Read all fields metadata */
/* It's safe to reread without freeing */
- if (FAIL == result->meta->m->read_metadata(result->meta, conn TSRMLS_CC)) {
- result->m.free_result_contents(result TSRMLS_CC);
+ if (FAIL == result->meta->m->read_metadata(result->meta, conn)) {
+ result->m.free_result_contents(result);
DBG_RETURN(FAIL);
}
/* COM_FIELD_LIST is broken and has premature EOF, thus we need to hack here and in mysqlnd_res_meta.c */
@@ -399,7 +399,7 @@ MYSQLND_METHOD(mysqlnd_res, read_result_metadata)(MYSQLND_RES * result, MYSQLND_
/* {{{ mysqlnd_query_read_result_set_header */
enum_func_status
-mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s TSRMLS_DC)
+mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s)
{
MYSQLND_STMT_DATA * stmt = s ? s->data:NULL;
enum_func_status ret;
@@ -411,7 +411,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
ret = FAIL;
do {
- rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE TSRMLS_CC);
+ rset_header = conn->protocol->m.get_rset_header_packet(conn->protocol, FALSE);
if (!rset_header) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -421,7 +421,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
SET_ERROR_AFF_ROWS(conn);
if (FAIL == (ret = PACKET_READ(rset_header, conn))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading result set's header");
+ php_error_docref(NULL, E_WARNING, "Error reading result set's header");
break;
}
@@ -456,7 +456,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
conn->last_query_type = QUERY_LOAD_LOCAL;
conn->field_count = 0; /* overwrite previous value, or the last value could be used and lead to bug#53503 */
CONN_SET_STATE(conn, CONN_SENDING_LOAD_DATA);
- ret = mysqlnd_handle_local_infile(conn, rset_header->info_or_local_file, &is_warning TSRMLS_CC);
+ ret = mysqlnd_handle_local_infile(conn, rset_header->info_or_local_file, &is_warning);
CONN_SET_STATE(conn, (ret == PASS || is_warning == TRUE)? CONN_READY:CONN_QUIT_SENT);
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_NON_RSET_QUERY);
break;
@@ -499,7 +499,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
/* PS has already allocated it */
conn->field_count = rset_header->field_count;
if (!stmt) {
- result = conn->current_result = conn->m->result_init(rset_header->field_count, conn->persistent TSRMLS_CC);
+ result = conn->current_result = conn->m->result_init(rset_header->field_count, conn->persistent);
} else {
if (!stmt->result) {
DBG_INF("This is 'SHOW'/'EXPLAIN'-like query.");
@@ -508,7 +508,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
- result = stmt->result = conn->m->result_init(rset_header->field_count, stmt->persistent TSRMLS_CC);
+ result = stmt->result = conn->m->result_init(rset_header->field_count, stmt->persistent);
} else {
/*
Update result set metadata if it for some reason changed between
@@ -531,7 +531,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
break;
}
- if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
+ if (FAIL == (ret = result->m.read_result_metadata(result, conn))) {
/* For PS, we leave them in Prepared state */
if (!stmt && conn->current_result) {
mnd_efree(conn->current_result);
@@ -542,7 +542,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
}
/* Check for SERVER_STATUS_MORE_RESULTS if needed */
- fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE TSRMLS_CC);
+ fields_eof = conn->protocol->m.get_eof_packet(conn->protocol, FALSE);
if (!fields_eof) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -550,7 +550,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
}
if (FAIL == (ret = PACKET_READ(fields_eof, conn))) {
DBG_ERR("Error occurred while reading the EOF packet");
- result->m.free_result_contents(result TSRMLS_CC);
+ result->m.free_result_contents(result);
mnd_efree(result);
if (!stmt) {
conn->current_result = NULL;
@@ -600,7 +600,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
completeness.
*/
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED * const result)
{
const MYSQLND_RES_BUFFERED_ZVAL * set = (MYSQLND_RES_BUFFERED_ZVAL *) result;
/*
@@ -632,7 +632,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_lengths)(MYSQLND_RES_BUFFERED
completeness.
*/
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED * const result)
{
const MYSQLND_RES_BUFFERED_C * set = (MYSQLND_RES_BUFFERED_C *) result;
DBG_ENTER("mysqlnd_result_buffered_c::fetch_lengths");
@@ -649,7 +649,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_lengths)(MYSQLND_RES_BUFFERED *
/* {{{ mysqlnd_result_unbuffered::fetch_lengths */
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result)
{
/* simulate output of libmysql */
return (result->last_row_data || result->eof_reached)? result->lengths : NULL;
@@ -659,14 +659,14 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_lengths)(MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_res::fetch_lengths */
static zend_ulong *
-MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result)
{
zend_ulong * ret;
DBG_ENTER("mysqlnd_res::fetch_lengths");
ret = result->stored_data && result->stored_data->m.fetch_lengths ?
- result->stored_data->m.fetch_lengths(result->stored_data TSRMLS_CC) :
+ result->stored_data->m.fetch_lengths(result->stored_data) :
(result->unbuf && result->unbuf->m.fetch_lengths ?
- result->unbuf->m.fetch_lengths(result->unbuf TSRMLS_CC) :
+ result->unbuf->m.fetch_lengths(result->unbuf) :
NULL
);
DBG_RETURN(ret);
@@ -676,7 +676,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_result_unbuffered::fetch_row_c */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
MYSQLND_ROW_C *row = (MYSQLND_ROW_C *) param;
@@ -706,7 +706,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
result->m.unbuffered_free_last_data() before it. The function returns always true.
*/
if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -723,7 +723,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -784,7 +784,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
} else {
CONN_SET_STATE(result->conn, CONN_READY);
}
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
}
DBG_INF_FMT("ret=%s fetched=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
@@ -795,7 +795,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
/* {{{ mysqlnd_result_unbuffered::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
enum_func_status ret;
zval *row = (zval *) param;
@@ -825,7 +825,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
result->m.unbuffered_free_last_data() before it. The function returns always true.
*/
if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) {
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
result->unbuf->last_row_data = row_packet->fields;
result->unbuf->last_row_buffer = row_packet->row_buffer;
@@ -842,7 +842,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
field_count,
row_packet->fields_metadata,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (PASS != rc) {
DBG_RETURN(FAIL);
}
@@ -910,7 +910,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
} else {
CONN_SET_STATE(result->conn, CONN_READY);
}
- result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL TSRMLS_CC);
+ result->unbuf->m.free_last_data(result->unbuf, result->conn? result->conn->stats : NULL);
}
DBG_INF_FMT("ret=%s fetched=%u", ret == PASS? "PASS":"FAIL", *fetched_anything);
@@ -921,7 +921,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
/* {{{ mysqlnd_res::use_result */
static MYSQLND_RES *
-MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps)
{
DBG_ENTER("mysqlnd_res::use_result");
@@ -933,7 +933,7 @@ MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps
result->type = MYSQLND_RES_PS_UNBUF;
}
- result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, ps, result->persistent TSRMLS_CC);
+ result->unbuf = mysqlnd_result_unbuffered_init(result->field_count, ps, result->persistent);
if (!result->unbuf) {
goto oom;
}
@@ -944,7 +944,7 @@ MYSQLND_METHOD(mysqlnd_res, use_result)(MYSQLND_RES * const result, zend_bool ps
this to be not NULL.
*/
/* FALSE = non-persistent */
- result->unbuf->row_packet = result->conn->protocol->m.get_row_packet(result->conn->protocol, FALSE TSRMLS_CC);
+ result->unbuf->row_packet = result->conn->protocol->m.get_row_packet(result->conn->protocol, FALSE);
if (!result->unbuf->row_packet) {
goto oom;
}
@@ -965,7 +965,7 @@ oom:
/* {{{ mysqlnd_result_buffered::fetch_row_c */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
{
MYSQLND_ROW_C * row = (MYSQLND_ROW_C *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -990,7 +990,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1057,7 +1057,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(MYSQLND_RES * result, void
/* {{{ mysqlnd_result_buffered_zval::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
zval * row = (zval *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -1081,7 +1081,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, vo
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1144,7 +1144,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)(MYSQLND_RES * result, vo
/* {{{ mysqlnd_result_buffered_c::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
{
zval * row = (zval *) param;
const MYSQLND_RES_METADATA * const meta = result->meta;
@@ -1172,7 +1172,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void
field_count,
meta->fields,
result->conn->options->int_and_float_native,
- result->conn->stats TSRMLS_CC);
+ result->conn->stats);
if (rc != PASS) {
DBG_RETURN(FAIL);
}
@@ -1250,11 +1250,11 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, fetch_row)(MYSQLND_RES * result, void
/* {{{ mysqlnd_res::fetch_row */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool *fetched_anything TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_row)(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool *fetched_anything)
{
const mysqlnd_fetch_row_func f = result->stored_data? result->stored_data->m.fetch_row:(result->unbuf? result->unbuf->m.fetch_row:NULL);
if (f) {
- return f(result, param, flags, fetched_anything TSRMLS_CC);
+ return f(result, param, flags, fetched_anything);
}
*fetched_anything = FALSE;
return PASS;
@@ -1269,7 +1269,7 @@ enum_func_status
MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result,
MYSQLND_RES_METADATA * meta,
MYSQLND_MEMORY_POOL_CHUNK ***row_buffers,
- zend_bool binary_protocol TSRMLS_DC)
+ zend_bool binary_protocol)
{
enum_func_status ret;
MYSQLND_PACKET_ROW * row_packet = NULL;
@@ -1295,7 +1295,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
set->references = 1;
/* non-persistent */
- row_packet = conn->protocol->m.get_row_packet(conn->protocol, FALSE TSRMLS_CC);
+ row_packet = conn->protocol->m.get_row_packet(conn->protocol, FALSE);
if (!row_packet) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
@@ -1395,7 +1395,7 @@ end:
static MYSQLND_RES *
MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
MYSQLND_CONN_DATA * const conn,
- const unsigned int flags TSRMLS_DC)
+ const unsigned int flags)
{
enum_func_status ret;
MYSQLND_MEMORY_POOL_CHUNK ***row_buffers = NULL;
@@ -1404,27 +1404,27 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
/* We need the conn because we are doing lazy zval initialization in buffered_fetch_row */
/* In case of error the reference will be released in free_result_internal() called indirectly by our caller */
- result->conn = conn->m->get_reference(conn TSRMLS_CC);
+ result->conn = conn->m->get_reference(conn);
result->type = MYSQLND_RES_NORMAL;
CONN_SET_STATE(conn, CONN_FETCHING_DATA);
if (flags & MYSQLND_STORE_NO_COPY) {
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_zval_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
row_buffers = &result->stored_data->row_buffers;
} else if (flags & MYSQLND_STORE_COPY) {
- result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_c_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent TSRMLS_CC);
+ result->stored_data = (MYSQLND_RES_BUFFERED *) mysqlnd_result_buffered_c_init(result->field_count, flags & MYSQLND_STORE_PS, result->persistent);
if (!result->stored_data) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(NULL);
}
row_buffers = &result->stored_data->row_buffers;
}
- ret = result->m.store_result_fetch_data(conn, result, result->meta, row_buffers, flags & MYSQLND_STORE_PS TSRMLS_CC);
+ ret = result->m.store_result_fetch_data(conn, result, result->meta, row_buffers, flags & MYSQLND_STORE_PS);
if (FAIL == ret) {
if (result->stored_data) {
@@ -1471,7 +1471,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
/* {{{ mysqlnd_res::skip_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result)
{
zend_bool fetched_anything;
@@ -1488,7 +1488,7 @@ MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
result->type == MYSQLND_RES_NORMAL? STAT_FLUSHED_NORMAL_SETS:
STAT_FLUSHED_PS_SETS);
- while ((PASS == result->m.fetch_row(result, NULL, 0, &fetched_anything TSRMLS_CC)) && fetched_anything == TRUE) {
+ while ((PASS == result->m.fetch_row(result, NULL, 0, &fetched_anything)) && fetched_anything == TRUE) {
/* do nothing */;
}
}
@@ -1499,7 +1499,7 @@ MYSQLND_METHOD(mysqlnd_res, skip_result)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::free_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implicit)
{
DBG_ENTER("mysqlnd_res::free_result");
@@ -1507,7 +1507,7 @@ MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implici
implicit == TRUE? STAT_FREE_RESULT_IMPLICIT:
STAT_FREE_RESULT_EXPLICIT);
- result->m.free_result_internal(result TSRMLS_CC);
+ result->m.free_result_internal(result);
DBG_RETURN(PASS);
}
/* }}} */
@@ -1515,19 +1515,19 @@ MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES * result, zend_bool implici
/* {{{ mysqlnd_res::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * const result, const uint64_t row)
{
DBG_ENTER("mysqlnd_res::data_seek");
DBG_INF_FMT("row=%lu", row);
- DBG_RETURN(result->stored_data? result->stored_data->m.data_seek(result->stored_data, row TSRMLS_CC) : FAIL);
+ DBG_RETURN(result->stored_data? result->stored_data->m.data_seek(result->stored_data, row) : FAIL);
}
/* }}} */
/* {{{ mysqlnd_result_buffered_zval::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row)
{
MYSQLND_RES_BUFFERED_ZVAL * set = (MYSQLND_RES_BUFFERED_ZVAL *) result;
DBG_ENTER("mysqlnd_result_buffered_zval::data_seek");
@@ -1545,7 +1545,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_zval, data_seek)(MYSQLND_RES_BUFFERED * c
/* {{{ mysqlnd_result_buffered_c::data_seek */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row)
{
MYSQLND_RES_BUFFERED_C * set = (MYSQLND_RES_BUFFERED_C *) result;
DBG_ENTER("mysqlnd_result_buffered_c::data_seek");
@@ -1563,7 +1563,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered_c, data_seek)(MYSQLND_RES_BUFFERED * cons
/* {{{ mysqlnd_result_unbuffered::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED * const result)
{
/* Be compatible with libmysql. We count row_count, but will return 0 */
return result->eof_reached? result->row_count:0;
@@ -1573,7 +1573,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, num_rows)(const MYSQLND_RES_UNBUFFERED
/* {{{ mysqlnd_result_buffered::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * const result)
{
return result->row_count;
}
@@ -1582,18 +1582,18 @@ MYSQLND_METHOD(mysqlnd_result_buffered, num_rows)(const MYSQLND_RES_BUFFERED * c
/* {{{ mysqlnd_res::num_rows */
static uint64_t
-MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result)
{
return result->stored_data?
- result->stored_data->m.num_rows(result->stored_data TSRMLS_CC) :
- (result->unbuf? result->unbuf->m.num_rows(result->unbuf TSRMLS_CC) : 0);
+ result->stored_data->m.num_rows(result->stored_data) :
+ (result->unbuf? result->unbuf->m.num_rows(result->unbuf) : 0);
}
/* }}} */
/* {{{ mysqlnd_res::num_fields */
static unsigned int
-MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result)
{
return result->field_count;
}
@@ -1602,7 +1602,7 @@ MYSQLND_METHOD(mysqlnd_res, num_fields)(const MYSQLND_RES * const result TSRMLS_
/* {{{ mysqlnd_res::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result)
{
DBG_ENTER("mysqlnd_res::fetch_field");
do {
@@ -1621,12 +1621,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request");
/* we have to initialize the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_field(result->meta TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_field(result->meta));
}
} while (0);
DBG_RETURN(NULL);
@@ -1636,7 +1636,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::fetch_field_direct */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr)
{
DBG_ENTER("mysqlnd_res::fetch_field_direct");
do {
@@ -1655,12 +1655,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, cons
DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request");
/* we have to initialized the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_field_direct(result->meta, fieldnr TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_field_direct(result->meta, fieldnr));
}
} while (0);
@@ -1671,7 +1671,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_direct)(MYSQLND_RES * const result, cons
/* {{{ mysqlnd_res::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result)
{
DBG_ENTER("mysqlnd_res::fetch_fields");
do {
@@ -1679,12 +1679,12 @@ MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) {
/* we have to initialize the rest to get the updated max length */
if (PASS != result->stored_data->m.initialize_result_set_rest(result->stored_data, result->meta, result->conn->stats,
- result->conn->options->int_and_float_native TSRMLS_CC))
+ result->conn->options->int_and_float_native))
{
break;
}
}
- DBG_RETURN(result->meta->m->fetch_fields(result->meta TSRMLS_CC));
+ DBG_RETURN(result->meta->m->fetch_fields(result->meta));
}
} while (0);
DBG_RETURN(NULL);
@@ -1694,18 +1694,18 @@ MYSQLND_METHOD(mysqlnd_res, fetch_fields)(MYSQLND_RES * const result TSRMLS_DC)
/* {{{ mysqlnd_res::field_seek */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res, field_seek)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, field_seek)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset)
{
- return result->meta? result->meta->m->field_seek(result->meta, field_offset TSRMLS_CC) : 0;
+ return result->meta? result->meta->m->field_seek(result->meta, field_offset) : 0;
}
/* }}} */
/* {{{ mysqlnd_res::field_tell */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result)
{
- return result->meta? result->meta->m->field_tell(result->meta TSRMLS_CC) : 0;
+ return result->meta? result->meta->m->field_tell(result->meta) : 0;
}
/* }}} */
@@ -1725,8 +1725,8 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
extend and rehash the hash constantly.
*/
array_init_size(return_value, mysqlnd_num_fields(result) * 2);
- if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading a row");
+ if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything)) {
+ php_error_docref(NULL, E_WARNING, "Error while reading a row");
zval_dtor(return_value);
RETVAL_FALSE;
} else if (fetched_anything == FALSE) {
@@ -1752,19 +1752,19 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
/* {{{ mysqlnd_res::fetch_row_c */
static MYSQLND_ROW_C
-MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_row_c)(MYSQLND_RES * result)
{
zend_bool fetched_anything;
MYSQLND_ROW_C ret = NULL;
DBG_ENTER("mysqlnd_res::fetch_row_c");
if (result->stored_data && result->stored_data->m.fetch_row == MYSQLND_METHOD(mysqlnd_result_buffered_zval, fetch_row)) {
- MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_buffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything);
} else if (result->unbuf && result->unbuf->m.fetch_row == MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)) {
- MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything TSRMLS_CC);
+ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(result, (void *) &ret, 0, &fetched_anything);
} else {
ret = NULL;
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "result->m.fetch_row has invalid value. Report to the developers");
+ php_error_docref(NULL, E_ERROR, "result->m.fetch_row has invalid value. Report to the developers");
}
DBG_RETURN(ret);
}
@@ -1782,7 +1782,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int
DBG_ENTER("mysqlnd_res::fetch_all");
if ((!result->unbuf && !set)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fetch_all can be used only with buffered sets");
+ php_error_docref(NULL, E_WARNING, "fetch_all can be used only with buffered sets");
if (result->conn) {
SET_CLIENT_ERROR(*result->conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "fetch_all can be used only with buffered sets");
}
@@ -1809,7 +1809,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int
/* {{{ mysqlnd_res::fetch_field_data */
static void
-MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int offset, zval *return_value TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES * result, unsigned int offset, zval *return_value)
{
zval row;
zval *entry;
@@ -1894,7 +1894,7 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_result_init */
PHPAPI MYSQLND_RES *
-mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_init(unsigned int field_count, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1916,7 +1916,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
/* {{{ mysqlnd_result_unbuffered_init */
PHPAPI MYSQLND_RES_UNBUFFERED *
-mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_UNBUFFERED) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_UNBUFFERED * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1931,7 +1931,7 @@ mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
@@ -1957,7 +1957,7 @@ mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool
/* {{{ mysqlnd_result_buffered_zval_init */
PHPAPI MYSQLND_RES_BUFFERED_ZVAL *
-mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_BUFFERED_ZVAL) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_BUFFERED_ZVAL * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -1971,7 +1971,7 @@ mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_b
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
@@ -2000,7 +2000,7 @@ mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_b
/* {{{ mysqlnd_result_buffered_c_init */
PHPAPI MYSQLND_RES_BUFFERED_C *
-mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_BUFFERED_C) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_BUFFERED_C * ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -2014,7 +2014,7 @@ mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
}
- if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC))) {
+ if (!(ret->result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size)))) {
mnd_efree(ret->lengths);
mnd_pefree(ret, persistent);
DBG_RETURN(NULL);
diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h
index 700efed83e..d8ae4db0f7 100644
--- a/ext/mysqlnd/mysqlnd_result.h
+++ b/ext/mysqlnd/mysqlnd_result.h
@@ -23,12 +23,12 @@
#ifndef MYSQLND_RESULT_H
#define MYSQLND_RESULT_H
-PHPAPI MYSQLND_RES * mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_UNBUFFERED * mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_BUFFERED_ZVAL * mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
-PHPAPI MYSQLND_RES_BUFFERED_C * mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent TSRMLS_DC);
+PHPAPI MYSQLND_RES * mysqlnd_result_init(unsigned int field_count, zend_bool persistent);
+PHPAPI MYSQLND_RES_UNBUFFERED * mysqlnd_result_unbuffered_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
+PHPAPI MYSQLND_RES_BUFFERED_ZVAL * mysqlnd_result_buffered_zval_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
+PHPAPI MYSQLND_RES_BUFFERED_C * mysqlnd_result_buffered_c_init(unsigned int field_count, zend_bool ps, zend_bool persistent);
-enum_func_status mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt TSRMLS_DC);
+enum_func_status mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt);
#endif /* MYSQLND_RESULT_H */
diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c
index 447de33ac9..9cdde04504 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.c
+++ b/ext/mysqlnd/mysqlnd_result_meta.c
@@ -30,7 +30,7 @@
/* {{{ php_mysqlnd_free_field_metadata */
static void
-php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent TSRMLS_DC)
+php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent)
{
if (meta) {
if (meta->root) {
@@ -50,14 +50,14 @@ php_mysqlnd_free_field_metadata(MYSQLND_FIELD *meta, zend_bool persistent TSRMLS
/* {{{ mysqlnd_res_meta::read_metadata */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn)
{
unsigned int i = 0;
MYSQLND_PACKET_RES_FIELD * field_packet;
DBG_ENTER("mysqlnd_res_meta::read_metadata");
- field_packet = conn->protocol->m.get_result_field_packet(conn->protocol, FALSE TSRMLS_CC);
+ field_packet = conn->protocol->m.get_result_field_packet(conn->protocol, FALSE);
if (!field_packet) {
SET_OOM_ERROR(*conn->error_info);
DBG_RETURN(FAIL);
@@ -92,7 +92,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
if (mysqlnd_ps_fetch_functions[meta->fields[i].type].func == NULL) {
DBG_ERR_FMT("Unknown type %u sent by the server. Please send a report to the developers",
meta->fields[i].type);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unknown type %u sent by the server. "
"Please send a report to the developers",
meta->fields[i].type);
@@ -148,7 +148,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, read_metadata)(MYSQLND_RES_METADATA * const met
/* {{{ mysqlnd_res_meta::free */
static void
-MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta)
{
int i;
MYSQLND_FIELD *fields;
@@ -159,7 +159,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
DBG_INF("Freeing fields metadata");
i = meta->field_count;
while (i--) {
- php_mysqlnd_free_field_metadata(fields++, meta->persistent TSRMLS_CC);
+ php_mysqlnd_free_field_metadata(fields++, meta->persistent);
}
mnd_pefree(meta->fields, meta->persistent);
meta->fields = NULL;
@@ -180,7 +180,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, free)(MYSQLND_RES_METADATA * meta TSRMLS_DC)
/* {{{ mysqlnd_res::clone_metadata */
static MYSQLND_RES_METADATA *
-MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent)
{
unsigned int i;
/* +1 is to have empty marker at the end */
@@ -267,7 +267,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, clone_metadata)(const MYSQLND_RES_METADATA * co
DBG_RETURN(new_meta);
oom:
if (new_meta) {
- new_meta->m->free_metadata(new_meta TSRMLS_CC);
+ new_meta->m->free_metadata(new_meta);
new_meta = NULL;
}
DBG_RETURN(NULL);
@@ -277,7 +277,7 @@ oom:
/* {{{ mysqlnd_res_meta::fetch_field */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field");
if (meta->current_field >= meta->field_count) {
@@ -294,7 +294,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_field)(MYSQLND_RES_METADATA * const meta
/* {{{ mysqlnd_res_meta::fetch_field_direct */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr)
{
DBG_ENTER("mysqlnd_res_meta::fetch_field_direct");
DBG_INF_FMT("fieldnr=%u", fieldnr);
@@ -308,7 +308,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_field_direct)(const MYSQLND_RES_METADATA
/* {{{ mysqlnd_res_meta::fetch_fields */
static const MYSQLND_FIELD *
-MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta)
{
DBG_ENTER("mysqlnd_res_meta::fetch_fields");
DBG_RETURN(meta->fields);
@@ -318,7 +318,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, fetch_fields)(MYSQLND_RES_METADATA * const meta
/* {{{ mysqlnd_res_meta::field_tell */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const meta TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const meta)
{
return meta->current_field;
}
@@ -327,7 +327,7 @@ MYSQLND_METHOD(mysqlnd_res_meta, field_tell)(const MYSQLND_RES_METADATA * const
/* {{{ mysqlnd_res_meta::field_seek */
static MYSQLND_FIELD_OFFSET
-MYSQLND_METHOD(mysqlnd_res_meta, field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res_meta, field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset)
{
MYSQLND_FIELD_OFFSET return_value = 0;
DBG_ENTER("mysqlnd_res_meta::fetch_fields");
@@ -352,7 +352,7 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_result_meta_init */
PHPAPI MYSQLND_RES_METADATA *
-mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_DC)
+mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent)
{
size_t alloc_size = sizeof(MYSQLND_RES_METADATA) + mysqlnd_plugin_count() * sizeof(void *);
MYSQLND_RES_METADATA *ret = mnd_pecalloc(1, alloc_size, persistent);
@@ -377,7 +377,7 @@ mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_D
DBG_RETURN(ret);
} while (0);
if (ret) {
- ret->m->free_metadata(ret TSRMLS_CC);
+ ret->m->free_metadata(ret);
}
DBG_RETURN(NULL);
}
@@ -395,7 +395,7 @@ mysqlnd_result_metadata_get_methods()
/* {{{ _mysqlnd_plugin_get_plugin_result_metadata_data */
PHPAPI void **
-_mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id TSRMLS_DC)
+_mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id)
{
DBG_ENTER("_mysqlnd_plugin_get_plugin_result_metadata_data");
DBG_INF_FMT("plugin_id=%u", plugin_id);
diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h
index 91388b65a5..b1165a184a 100644
--- a/ext/mysqlnd/mysqlnd_result_meta.h
+++ b/ext/mysqlnd/mysqlnd_result_meta.h
@@ -23,9 +23,9 @@
#ifndef MYSQLND_RESULT_META_H
#define MYSQLND_RESULT_META_H
-PHPAPI MYSQLND_RES_METADATA * mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent TSRMLS_DC);
+PHPAPI MYSQLND_RES_METADATA * mysqlnd_result_meta_init(unsigned int field_count, zend_bool persistent);
PHPAPI struct st_mysqlnd_res_meta_methods * mysqlnd_result_metadata_get_methods();
-PHPAPI void ** _mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id TSRMLS_DC);
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_metadata_data(const MYSQLND_RES_METADATA * meta, unsigned int plugin_id);
#endif /* MYSQLND_RESULT_META_H */
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c
index 553a507818..b358b6d2f2 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.c
+++ b/ext/mysqlnd/mysqlnd_reverse_api.c
@@ -31,7 +31,7 @@ static HashTable mysqlnd_api_ext_ht;
/* {{{ mysqlnd_reverse_api_init */
PHPAPI void
-mysqlnd_reverse_api_init(TSRMLS_D)
+mysqlnd_reverse_api_init(void)
{
zend_hash_init(&mysqlnd_api_ext_ht, 3, NULL, NULL, 1);
}
@@ -40,7 +40,7 @@ mysqlnd_reverse_api_init(TSRMLS_D)
/* {{{ mysqlnd_reverse_api_end */
PHPAPI void
-mysqlnd_reverse_api_end(TSRMLS_D)
+mysqlnd_reverse_api_end(void)
{
zend_hash_destroy(&mysqlnd_api_ext_ht);
}
@@ -49,7 +49,7 @@ mysqlnd_reverse_api_end(TSRMLS_D)
/* {{{ myslqnd_get_api_extensions */
PHPAPI HashTable *
-mysqlnd_reverse_api_get_api_list(TSRMLS_D)
+mysqlnd_reverse_api_get_api_list(void)
{
return &mysqlnd_api_ext_ht;
}
@@ -58,7 +58,7 @@ mysqlnd_reverse_api_get_api_list(TSRMLS_D)
/* {{{ mysqlnd_reverse_api_register_api */
PHPAPI void
-mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
+mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext)
{
zend_hash_str_add_ptr(&mysqlnd_api_ext_ht, apiext->module->name, strlen(apiext->module->name), apiext);
}
@@ -67,17 +67,17 @@ mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC)
/* {{{ zval_to_mysqlnd */
PHPAPI MYSQLND *
-zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities TSRMLS_DC)
+zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities)
{
MYSQLND * retval;
#ifdef OLD_CODE
MYSQLND_REVERSE_API * elem;
ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, elem) {
if (elem->conversion_cb) {
- retval = elem->conversion_cb(zv TSRMLS_CC);
+ retval = elem->conversion_cb(zv);
if (retval) {
if (retval->data) {
- *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
+ *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
}
return retval;
}
@@ -87,10 +87,10 @@ zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned
MYSQLND_REVERSE_API * api;
ZEND_HASH_FOREACH_PTR(&mysqlnd_api_ext_ht, api) {
if (api && api->conversion_cb) {
- retval = api->conversion_cb(zv TSRMLS_CC);
+ retval = api->conversion_cb(zv);
if (retval) {
if (retval->data) {
- *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities TSRMLS_CC);
+ *save_client_api_capabilities = retval->data->m->negotiate_client_api_capabilities(retval->data, client_api_capabilities);
}
return retval;
}
diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h
index 58a1ddd087..2ea0cfd33d 100644
--- a/ext/mysqlnd/mysqlnd_reverse_api.h
+++ b/ext/mysqlnd/mysqlnd_reverse_api.h
@@ -24,17 +24,17 @@
typedef struct st_mysqlnd_reverse_api
{
zend_module_entry * module;
- MYSQLND *(*conversion_cb)(zval * zv TSRMLS_DC);
+ MYSQLND *(*conversion_cb)(zval * zv);
} MYSQLND_REVERSE_API;
-PHPAPI void mysqlnd_reverse_api_init(TSRMLS_D);
-PHPAPI void mysqlnd_reverse_api_end(TSRMLS_D);
+PHPAPI void mysqlnd_reverse_api_init(void);
+PHPAPI void mysqlnd_reverse_api_end(void);
-PHPAPI HashTable * mysqlnd_reverse_api_get_api_list(TSRMLS_D);
+PHPAPI HashTable * mysqlnd_reverse_api_get_api_list(void);
-PHPAPI void mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext TSRMLS_DC);
-PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities TSRMLS_DC);
+PHPAPI void mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext);
+PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities);
#endif /* MYSQLND_REVERSE_API_H */
diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c
index e25befbc15..048a5fe199 100644
--- a/ext/mysqlnd/mysqlnd_statistics.c
+++ b/ext/mysqlnd/mysqlnd_statistics.c
@@ -264,7 +264,7 @@ mysqlnd_stats_end(MYSQLND_STATS * stats)
/* {{{ mysqlnd_stats_set_trigger */
PHPAPI mysqlnd_stat_trigger
-mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats statistic, mysqlnd_stat_trigger trigger TSRMLS_DC)
+mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats statistic, mysqlnd_stat_trigger trigger)
{
mysqlnd_stat_trigger ret = NULL;
DBG_ENTER("mysqlnd_stats_set_trigger");
@@ -281,7 +281,7 @@ mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_st
/* {{{ mysqlnd_stats_set_handler */
PHPAPI mysqlnd_stat_trigger
-mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats TSRMLS_DC)
+mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats)
{
mysqlnd_stat_trigger ret = NULL;
DBG_ENTER("mysqlnd_stats_reset_trigger");
diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h
index bfc316ec59..db83dda4cb 100644
--- a/ext/mysqlnd/mysqlnd_statistics.h
+++ b/ext/mysqlnd/mysqlnd_statistics.h
@@ -42,7 +42,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
(s_array)->in_trigger = TRUE; \
MYSQLND_STATS_UNLOCK((s_array)); \
\
- (s_array)->triggers[(statistic)]((s_array), (statistic), (val) TSRMLS_CC); \
+ (s_array)->triggers[(statistic)]((s_array), (statistic), (val)); \
\
MYSQLND_STATS_LOCK((s_array)); \
(s_array)->in_trigger = FALSE; \
@@ -162,8 +162,8 @@ PHPAPI void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYS
PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, size_t statistic_count);
PHPAPI void mysqlnd_stats_end(MYSQLND_STATS * stats);
-PHPAPI mysqlnd_stat_trigger mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats stat, mysqlnd_stat_trigger trigger TSRMLS_DC);
-PHPAPI mysqlnd_stat_trigger mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats TSRMLS_DC);
+PHPAPI mysqlnd_stat_trigger mysqlnd_stats_set_trigger(MYSQLND_STATS * const stats, enum_mysqlnd_collected_stats stat, mysqlnd_stat_trigger trigger);
+PHPAPI mysqlnd_stat_trigger mysqlnd_stats_reset_triggers(MYSQLND_STATS * const stats);
#endif /* MYSQLND_STATISTICS_H */
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 6be8b68034..c7fc0a87be 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -48,7 +48,7 @@ struct st_mysqlnd_memory_pool
unsigned int arena_size;
unsigned int free_size;
- MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL * pool, unsigned int size TSRMLS_DC);
+ MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL * pool, unsigned int size);
};
struct st_mysqlnd_memory_pool_chunk
@@ -56,8 +56,8 @@ struct st_mysqlnd_memory_pool_chunk
size_t app;
MYSQLND_MEMORY_POOL *pool;
zend_uchar *ptr;
- enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
- void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk TSRMLS_DC);
+ enum_func_status (*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size);
+ void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk);
unsigned int size;
zend_bool from_pool;
};
@@ -150,10 +150,10 @@ typedef struct st_mysqlnd_charset
/* local infile handler */
typedef struct st_mysqlnd_infile
{
- int (*local_infile_init)(void **ptr, const char * const filename TSRMLS_DC);
- int (*local_infile_read)(void *ptr, zend_uchar * buf, unsigned int buf_len TSRMLS_DC);
- int (*local_infile_error)(void *ptr, char * error_msg, unsigned int error_msg_len TSRMLS_DC);
- void (*local_infile_end)(void *ptr TSRMLS_DC);
+ int (*local_infile_init)(void **ptr, const char * const filename);
+ int (*local_infile_read)(void *ptr, zend_uchar * buf, unsigned int buf_len);
+ int (*local_infile_error)(void *ptr, char * error_msg, unsigned int error_msg_len);
+ void (*local_infile_end)(void *ptr);
} MYSQLND_INFILE;
typedef struct st_mysqlnd_options
@@ -242,7 +242,7 @@ typedef struct st_mysqlnd_unbuffered_result MYSQLND_RES_UNBUFFERED;
typedef struct st_mysqlnd_debug MYSQLND_DEBUG;
-typedef MYSQLND_RES* (*mysqlnd_stmt_use_or_store_func)(MYSQLND_STMT * const TSRMLS_DC);
+typedef MYSQLND_RES* (*mysqlnd_stmt_use_or_store_func)(MYSQLND_STMT * const);
typedef enum_func_status (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
void * param,
const unsigned int flags,
@@ -252,7 +252,7 @@ typedef enum_func_status (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
typedef struct st_mysqlnd_stats MYSQLND_STATS;
-typedef void (*mysqlnd_stat_trigger)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change TSRMLS_DC);
+typedef void (*mysqlnd_stat_trigger)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change);
struct st_mysqlnd_stats
{
@@ -274,32 +274,32 @@ typedef struct st_mysqlnd_read_buffer {
zend_bool (*is_empty)(struct st_mysqlnd_read_buffer *);
void (*read)(struct st_mysqlnd_read_buffer *, size_t count, zend_uchar * dest);
size_t (*bytes_left)(struct st_mysqlnd_read_buffer *);
- void (*free_buffer)(struct st_mysqlnd_read_buffer ** TSRMLS_DC);
+ void (*free_buffer)(struct st_mysqlnd_read_buffer **);
} MYSQLND_READ_BUFFER;
-typedef enum_func_status (*func_mysqlnd_net__set_client_option)(MYSQLND_NET * const net, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len, const zend_uchar * const compressed_data, const size_t compressed_data_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd TSRMLS_DC);
-typedef void (*func_mysqlnd_net__free_contents)(MYSQLND_NET * net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__enable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__disable_ssl)(MYSQLND_NET * const net TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buf, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef size_t (*func_mysqlnd_net__send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net TSRMLS_DC);
-typedef php_stream * (*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC);
-typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void (*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_net__set_client_option)(MYSQLND_NET * const net, enum_mysqlnd_option option, const char * const value);
+typedef enum_func_status (*func_mysqlnd_net__decode)(zend_uchar * uncompressed_data, const size_t uncompressed_data_len, const zend_uchar * const compressed_data, const size_t compressed_data_len);
+typedef enum_func_status (*func_mysqlnd_net__encode)(zend_uchar * compress_buffer, size_t * compress_buffer_len, const zend_uchar * const uncompressed_data, const size_t uncompressed_data_len);
+typedef size_t (*func_mysqlnd_net__consume_uneaten_data)(MYSQLND_NET * const net, enum php_mysqlnd_server_command cmd);
+typedef void (*func_mysqlnd_net__free_contents)(MYSQLND_NET * net);
+typedef enum_func_status (*func_mysqlnd_net__enable_ssl)(MYSQLND_NET * const net);
+typedef enum_func_status (*func_mysqlnd_net__disable_ssl)(MYSQLND_NET * const net);
+typedef enum_func_status (*func_mysqlnd_net__network_read_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef size_t (*func_mysqlnd_net__network_write_ex)(MYSQLND_NET * const net, const zend_uchar * const buf, const size_t count, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef size_t (*func_mysqlnd_net__send_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__receive_ex)(MYSQLND_NET * const net, zend_uchar * const buffer, const size_t count, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef php_stream * (*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef php_stream * (*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net);
+typedef php_stream * (*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream);
+typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info);
+typedef void (*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info);
+typedef enum_func_status (*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info);
struct st_mysqlnd_net_methods
{
@@ -355,21 +355,21 @@ struct st_mysqlnd_packet_auth_pam;
struct st_mysqlnd_packet_sha256_pk_request;
struct st_mysqlnd_packet_sha256_pk_request_response;
-typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol__get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol__get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
-typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC);
+typedef struct st_mysqlnd_packet_greet * (*func_mysqlnd_protocol__get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_auth * (*func_mysqlnd_protocol__get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_auth_response *(*func_mysqlnd_protocol__get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_change_auth_response * (*func_mysqlnd_protocol__get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_ok * (*func_mysqlnd_protocol__get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_command * (*func_mysqlnd_protocol__get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_eof * (*func_mysqlnd_protocol__get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_rset_header * (*func_mysqlnd_protocol__get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_res_field * (*func_mysqlnd_protocol__get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_row * (*func_mysqlnd_protocol__get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_stats * (*func_mysqlnd_protocol__get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_prepare_response *(*func_mysqlnd_protocol__get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol__get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
+typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent);
struct st_mysqlnd_protocol_methods
{
@@ -395,11 +395,11 @@ struct st_mysqlnd_protocol_methods
};
-typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(zend_bool persistent TSRMLS_DC);
-typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn TSRMLS_DC);
-typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
-typedef MYSQLND_PROTOCOL * (*func_mysqlnd_object_factory__get_protocol_decoder)(zend_bool persistent TSRMLS_DC);
+typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(zend_bool persistent);
+typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn);
+typedef MYSQLND_STMT * (*func_mysqlnd_object_factory__get_prepared_statement)(MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info);
+typedef MYSQLND_PROTOCOL * (*func_mysqlnd_object_factory__get_protocol_decoder)(zend_bool persistent);
struct st_mysqlnd_object_factory_methods
@@ -412,98 +412,98 @@ struct st_mysqlnd_object_factory_methods
};
-typedef enum_func_status (*func_mysqlnd_conn_data__init)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__connect)(MYSQLND_CONN_DATA * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
-typedef zend_ulong (*func_mysqlnd_conn_data__escape_string)(MYSQLND_CONN_DATA * const conn, char *newstr, const char *escapestr, size_t escapestr_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_charset)(MYSQLND_CONN_DATA * const conn, const char * const charset TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_query)(MYSQLND_CONN_DATA * conn, const char *query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__next_result)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef zend_bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef MYSQLND_STMT * (*func_mysqlnd_conn_data__stmt_init)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__shutdown_server)(MYSQLND_CONN_DATA * const conn, uint8_t level TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__refresh_server)(MYSQLND_CONN_DATA * const conn, uint8_t options TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_conn_data__ping)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__kill_connection)(MYSQLND_CONN_DATA * conn, unsigned int pid TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__server_dump_debug_information)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, zend_bool silent, size_t passwd_len TSRMLS_DC);
-
-typedef unsigned int (*func_mysqlnd_conn_data__get_error_no)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_error_str)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_sqlstate)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_conn_data__get_thread_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__init)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__connect)(MYSQLND_CONN_DATA * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags);
+typedef zend_ulong (*func_mysqlnd_conn_data__escape_string)(MYSQLND_CONN_DATA * const conn, char *newstr, const char *escapestr, size_t escapestr_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_charset)(MYSQLND_CONN_DATA * const conn, const char * const charset);
+typedef enum_func_status (*func_mysqlnd_conn_data__query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_query)(MYSQLND_CONN_DATA * conn, const char *query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__reap_query)(MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__next_result)(MYSQLND_CONN_DATA * const conn);
+typedef zend_bool (*func_mysqlnd_conn_data__more_results)(const MYSQLND_CONN_DATA * const conn);
+
+typedef MYSQLND_STMT * (*func_mysqlnd_conn_data__stmt_init)(MYSQLND_CONN_DATA * const conn);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__shutdown_server)(MYSQLND_CONN_DATA * const conn, uint8_t level);
+typedef enum_func_status (*func_mysqlnd_conn_data__refresh_server)(MYSQLND_CONN_DATA * const conn, uint8_t options);
+
+typedef enum_func_status (*func_mysqlnd_conn_data__ping)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__kill_connection)(MYSQLND_CONN_DATA * conn, unsigned int pid);
+typedef enum_func_status (*func_mysqlnd_conn_data__select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len);
+typedef enum_func_status (*func_mysqlnd_conn_data__server_dump_debug_information)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__change_user)(MYSQLND_CONN_DATA * const conn, const char * user, const char * passwd, const char * db, zend_bool silent, size_t passwd_len);
+
+typedef unsigned int (*func_mysqlnd_conn_data__get_error_no)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_error_str)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_sqlstate)(const MYSQLND_CONN_DATA * const conn);
+typedef uint64_t (*func_mysqlnd_conn_data__get_thread_id)(const MYSQLND_CONN_DATA * const conn);
typedef void (*func_mysqlnd_conn_data__get_statistics)(const MYSQLND_CONN_DATA * const conn, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
-typedef zend_ulong (*func_mysqlnd_conn_data__get_server_version)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_server_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__get_server_statistics)(MYSQLND_CONN_DATA * conn, zend_string **message TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_host_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_protocol_information)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__get_last_message)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef const char * (*func_mysqlnd_conn_data__charset_name)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_fields)(MYSQLND_CONN_DATA * conn, const char * table, const char * achtung_wild TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char * achtung_wild, char *par1 TSRMLS_DC);
+typedef zend_ulong (*func_mysqlnd_conn_data__get_server_version)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_server_information)(const MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__get_server_statistics)(MYSQLND_CONN_DATA * conn, zend_string **message);
+typedef const char * (*func_mysqlnd_conn_data__get_host_information)(const MYSQLND_CONN_DATA * const conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_protocol_information)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__get_last_message)(const MYSQLND_CONN_DATA * const conn);
+typedef const char * (*func_mysqlnd_conn_data__charset_name)(const MYSQLND_CONN_DATA * const conn);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_fields)(MYSQLND_CONN_DATA * conn, const char * table, const char * achtung_wild);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char * achtung_wild, char *par1);
-typedef uint64_t (*func_mysqlnd_conn_data__get_last_insert_id)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_conn_data__get_affected_rows)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_warning_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+typedef uint64_t (*func_mysqlnd_conn_data__get_last_insert_id)(const MYSQLND_CONN_DATA * const conn);
+typedef uint64_t (*func_mysqlnd_conn_data__get_affected_rows)(const MYSQLND_CONN_DATA * const conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_warning_count)(const MYSQLND_CONN_DATA * const conn);
-typedef unsigned int (*func_mysqlnd_conn_data__get_field_count)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+typedef unsigned int (*func_mysqlnd_conn_data__get_field_count)(const MYSQLND_CONN_DATA * const conn);
-typedef unsigned int (*func_mysqlnd_conn_data__get_server_status)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_option option, const char * const value TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__free_contents)(MYSQLND_CONN_DATA * conn TSRMLS_DC);/* private */
-typedef void (*func_mysqlnd_conn_data__free_options)(MYSQLND_CONN_DATA * conn TSRMLS_DC); /* private */
-typedef void (*func_mysqlnd_conn_data__dtor)(MYSQLND_CONN_DATA * conn TSRMLS_DC); /* private */
+typedef unsigned int (*func_mysqlnd_conn_data__get_server_status)(const MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_option option, const char * const value);
+typedef void (*func_mysqlnd_conn_data__free_contents)(MYSQLND_CONN_DATA * conn);/* private */
+typedef void (*func_mysqlnd_conn_data__free_options)(MYSQLND_CONN_DATA * conn); /* private */
+typedef void (*func_mysqlnd_conn_data__dtor)(MYSQLND_CONN_DATA * conn); /* private */
-typedef enum_func_status (*func_mysqlnd_conn_data__query_read_result_set_header)(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__query_read_result_set_header)(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt);
-typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state TSRMLS_DC);
+typedef MYSQLND_CONN_DATA * (*func_mysqlnd_conn_data__get_reference)(MYSQLND_CONN_DATA * const conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__free_reference)(MYSQLND_CONN_DATA * const conn);
+typedef enum mysqlnd_connection_state (*func_mysqlnd_conn_data__get_state)(const MYSQLND_CONN_DATA * const conn);
+typedef void (*func_mysqlnd_conn_data__set_state)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_connection_state new_state);
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet, zend_bool silent, enum php_mysqlnd_server_command command, zend_bool ignore_upsert_status TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent, zend_bool ignore_upsert_status);
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_handle_response)(MYSQLND_CONN_DATA * conn, enum mysqlnd_packet_type ok_packet, zend_bool silent, enum php_mysqlnd_server_command command, zend_bool ignore_upsert_status);
-typedef enum_func_status (*func_mysqlnd_conn_data__restart_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__send_close)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__restart_psession)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__end_psession)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__send_close)(MYSQLND_CONN_DATA * conn);
-typedef enum_func_status (*func_mysqlnd_conn_data__ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher);
-typedef MYSQLND_RES * (*func_mysqlnd_conn_data__result_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
+typedef MYSQLND_RES * (*func_mysqlnd_conn_data__result_init)(unsigned int field_count, zend_bool persistent);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name TSRMLS_DC);
-typedef void (*func_mysqlnd_conn_data__tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * tmp_str, const unsigned int mode TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DATA * conn);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name);
+typedef void (*func_mysqlnd_conn_data__tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * tmp_str, const unsigned int mode);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name);
+typedef enum_func_status (*func_mysqlnd_conn_data__tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name);
-typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
-typedef struct st_mysqlnd_authentication_plugin * (*func_mysqlnd_conn_data__fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func);
+typedef enum_func_status (*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status);
+typedef enum_func_status (*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn);
+typedef unsigned int (*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags);
+typedef enum_func_status (*func_mysqlnd_conn_data__simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status);
+typedef struct st_mysqlnd_authentication_plugin * (*func_mysqlnd_conn_data__fetch_auth_plugin_by_name)(const char * const requested_protocol);
-typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option_2d)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_option option, const char * const key, const char * const value TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_conn_data__set_client_option_2d)(MYSQLND_CONN_DATA * const conn, enum mysqlnd_option option, const char * const key, const char * const value);
-typedef unsigned int (*func_mysqlnd_conn_data__negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn TSRMLS_DC);
+typedef unsigned int (*func_mysqlnd_conn_data__negotiate_client_api_capabilities)(MYSQLND_CONN_DATA * const conn, const unsigned int flags);
+typedef unsigned int (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn);
struct st_mysqlnd_conn_data_methods
@@ -603,10 +603,10 @@ struct st_mysqlnd_conn_data_methods
};
-typedef enum_func_status (*func_mysqlnd_data__connect)(MYSQLND * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags TSRMLS_DC);
-typedef MYSQLND * (*func_mysqlnd_conn__clone_object)(MYSQLND * const conn TSRMLS_DC);
-typedef void (*func_mysqlnd_conn__dtor)(MYSQLND * conn TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_conn__close)(MYSQLND * conn, enum_connection_close_type close_type TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_data__connect)(MYSQLND * conn, const char * host, const char * user, const char * passwd, unsigned int passwd_len, const char * db, unsigned int db_len, unsigned int port, const char * socket_or_pipe, unsigned int mysql_flags);
+typedef MYSQLND * (*func_mysqlnd_conn__clone_object)(MYSQLND * const conn);
+typedef void (*func_mysqlnd_conn__dtor)(MYSQLND * conn);
+typedef enum_func_status (*func_mysqlnd_conn__close)(MYSQLND * conn, enum_connection_close_type close_type);
struct st_mysqlnd_conn_methods
{
@@ -619,38 +619,38 @@ struct st_mysqlnd_conn_methods
/* for decoding - binary or text protocol */
typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
-typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, zend_bool ps_protocol TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA * const conn, const unsigned int flags TSRMLS_DC);
+typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, zend_bool ps_protocol);
+typedef MYSQLND_RES * (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA * const conn, const unsigned int flags);
typedef void (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int flags, zval *return_value, enum_mysqlnd_extension ext TSRMLS_DC ZEND_FILE_LINE_DC);
-typedef MYSQLND_ROW_C (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result TSRMLS_DC);
+typedef MYSQLND_ROW_C (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result);
typedef void (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, const unsigned int flags, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
-typedef void (*func_mysqlnd_res__fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_res__num_fields)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__skip_result)(MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__seek_data)(MYSQLND_RES * const result, const uint64_t row TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__seek_field)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__field_tell)(const MYSQLND_RES * const result TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field)(MYSQLND_RES * const result TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
-typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_fields)(MYSQLND_RES * const result TSRMLS_DC);
-
-typedef enum_func_status (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_res__fetch_lengths)(MYSQLND_RES * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_MEMORY_POOL_CHUNK *** row_buffers, zend_bool binary_protocol TSRMLS_DC);
-
-typedef void (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result TSRMLS_DC); /* private */
-typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, zend_bool implicit TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_result_internal)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result TSRMLS_DC);
-typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *result TSRMLS_DC);
-
-
-typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC);
+typedef void (*func_mysqlnd_res__fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value);
+typedef uint64_t (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result);
+typedef unsigned int (*func_mysqlnd_res__num_fields)(const MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__skip_result)(MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__seek_data)(MYSQLND_RES * const result, const uint64_t row);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__seek_field)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET field_offset);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res__field_tell)(const MYSQLND_RES * const result);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field)(MYSQLND_RES * const result);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_field_direct)(MYSQLND_RES * const result, const MYSQLND_FIELD_OFFSET fieldnr);
+typedef const MYSQLND_FIELD *(*func_mysqlnd_res__fetch_fields)(MYSQLND_RES * const result);
+
+typedef enum_func_status (*func_mysqlnd_res__read_result_metadata)(MYSQLND_RES * result, MYSQLND_CONN_DATA * conn);
+typedef zend_ulong * (*func_mysqlnd_res__fetch_lengths)(MYSQLND_RES * const result);
+typedef enum_func_status (*func_mysqlnd_res__store_result_fetch_data)(MYSQLND_CONN_DATA * const conn, MYSQLND_RES * result, MYSQLND_RES_METADATA * meta, MYSQLND_MEMORY_POOL_CHUNK *** row_buffers, zend_bool binary_protocol);
+
+typedef void (*func_mysqlnd_res__free_result_buffers)(MYSQLND_RES * result); /* private */
+typedef enum_func_status (*func_mysqlnd_res__free_result)(MYSQLND_RES * result, zend_bool implicit);
+typedef void (*func_mysqlnd_res__free_result_internal)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__free_result_contents)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__free_buffered_data)(MYSQLND_RES *result);
+typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *result);
+
+
+typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent);
struct st_mysqlnd_res_methods
{
@@ -689,10 +689,10 @@ struct st_mysqlnd_res_methods
};
-typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result TSRMLS_DC);
-typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats TSRMLS_DC);
-typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats TSRMLS_DC);
+typedef uint64_t (*func_mysqlnd_result_unbuffered__num_rows)(const MYSQLND_RES_UNBUFFERED * const result);
+typedef zend_ulong * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_RES_UNBUFFERED * const result);
+typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats);
+typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats);
struct st_mysqlnd_result_unbuffered_methods
{
@@ -704,12 +704,12 @@ struct st_mysqlnd_result_unbuffered_methods
func_mysqlnd_result_unbuffered__free_result free_result;
};
-typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
+typedef uint64_t (*func_mysqlnd_result_buffered__num_rows)(const MYSQLND_RES_BUFFERED * const result);
typedef enum_func_status (*func_mysqlnd_result_buffered__initialize_result_set_rest)(MYSQLND_RES_BUFFERED * const result, MYSQLND_RES_METADATA * const meta,
- MYSQLND_STATS * stats, zend_bool int_and_float_native TSRMLS_DC);
-typedef zend_ulong * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row TSRMLS_DC);
-typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result TSRMLS_DC);
+ MYSQLND_STATS * stats, zend_bool int_and_float_native);
+typedef zend_ulong * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES_BUFFERED * const result);
+typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row);
+typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result);
struct st_mysqlnd_result_buffered_methods
{
@@ -723,14 +723,14 @@ struct st_mysqlnd_result_buffered_methods
};
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr TSRMLS_DC);
-typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_fields)(MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_tell)(const MYSQLND_RES_METADATA * const meta TSRMLS_DC);
-typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn TSRMLS_DC);
-typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent TSRMLS_DC);
-typedef void (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta TSRMLS_DC);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field)(MYSQLND_RES_METADATA * const meta);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_field_direct)(const MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET fieldnr);
+typedef const MYSQLND_FIELD * (*func_mysqlnd_res_meta__fetch_fields)(MYSQLND_RES_METADATA * const meta);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_tell)(const MYSQLND_RES_METADATA * const meta);
+typedef MYSQLND_FIELD_OFFSET (*func_mysqlnd_res_meta__field_seek)(MYSQLND_RES_METADATA * const meta, const MYSQLND_FIELD_OFFSET field_offset);
+typedef enum_func_status (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_METADATA * const meta, MYSQLND_CONN_DATA * conn);
+typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent);
+typedef void (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta);
struct st_mysqlnd_res_meta_methods
{
@@ -745,48 +745,48 @@ struct st_mysqlnd_res_meta_methods
};
-typedef enum_func_status (*func_mysqlnd_stmt__prepare)(MYSQLND_STMT * const stmt, const char * const query, unsigned int query_len TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__execute)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef zend_bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__net_close)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* private */
-typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* use this for mysqlnd_stmt_close */
-typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, zend_ulong length TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_parameter_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_last_insert_id)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_affected_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef uint64_t (*func_mysqlnd_stmt__get_num_rows)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_param_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_field_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_warning_count)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__get_error_no)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef const char * (*func_mysqlnd_stmt__get_error_str)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef const char * (*func_mysqlnd_stmt__get_sqlstate)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__get_attribute)(const MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, void * const value TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__set_attribute)(MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, const void * const value TSRMLS_DC);
-typedef MYSQLND_PARAM_BIND *(*func_mysqlnd_stmt__alloc_param_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * TSRMLS_DC);
-typedef unsigned int (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s TSRMLS_DC);
-typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt TSRMLS_DC);
-typedef void (*func_mysqlnd_stmt__free_stmt_result)(MYSQLND_STMT * const s TSRMLS_DC);
+typedef enum_func_status (*func_mysqlnd_stmt__prepare)(MYSQLND_STMT * const stmt, const char * const query, unsigned int query_len);
+typedef enum_func_status (*func_mysqlnd_stmt__execute)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__use_result)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__store_result)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result)(MYSQLND_STMT * const stmt);
+typedef zend_bool (*func_mysqlnd_stmt__more_results)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__next_result)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__free_result)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__seek_data)(const MYSQLND_STMT * const stmt, uint64_t row);
+typedef enum_func_status (*func_mysqlnd_stmt__reset)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__net_close)(MYSQLND_STMT * const stmt, zend_bool implicit); /* private */
+typedef enum_func_status (*func_mysqlnd_stmt__dtor)(MYSQLND_STMT * const stmt, zend_bool implicit); /* use this for mysqlnd_stmt_close */
+typedef enum_func_status (*func_mysqlnd_stmt__fetch)(MYSQLND_STMT * const stmt, zend_bool * const fetched_anything);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type);
+typedef enum_func_status (*func_mysqlnd_stmt__refresh_bind_param)(MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind);
+typedef enum_func_status (*func_mysqlnd_stmt__bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no);
+typedef enum_func_status (*func_mysqlnd_stmt__send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, zend_ulong length);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_parameter_metadata)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RES * (*func_mysqlnd_stmt__get_result_metadata)(MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_last_insert_id)(const MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_affected_rows)(const MYSQLND_STMT * const stmt);
+typedef uint64_t (*func_mysqlnd_stmt__get_num_rows)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_param_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_field_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_warning_count)(const MYSQLND_STMT * const stmt);
+typedef unsigned int (*func_mysqlnd_stmt__get_error_no)(const MYSQLND_STMT * const stmt);
+typedef const char * (*func_mysqlnd_stmt__get_error_str)(const MYSQLND_STMT * const stmt);
+typedef const char * (*func_mysqlnd_stmt__get_sqlstate)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__get_attribute)(const MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, void * const value);
+typedef enum_func_status (*func_mysqlnd_stmt__set_attribute)(MYSQLND_STMT * const stmt, enum mysqlnd_stmt_attr attr_type, const void * const value);
+typedef MYSQLND_PARAM_BIND *(*func_mysqlnd_stmt__alloc_param_bind)(MYSQLND_STMT * const stmt);
+typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT * const stmt);
+typedef void (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND *);
+typedef void (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND *);
+typedef unsigned int (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt);
+typedef enum_func_status (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer);
+typedef enum_func_status (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s);
+typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s);
+typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt);
+typedef void (*func_mysqlnd_stmt__free_stmt_result)(MYSQLND_STMT * const s);
struct st_mysqlnd_stmt_methods
{
@@ -1182,7 +1182,7 @@ struct st_mysqlnd_plugin_header
struct
{
- enum_func_status (*plugin_shutdown)(void * plugin TSRMLS_DC);
+ enum_func_status (*plugin_shutdown)(void * plugin);
} m;
};
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 1d86df7859..9f6463b9f9 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -35,10 +35,10 @@
#define PACKET_READ_HEADER_AND_BODY(packet, conn, buf, buf_size, packet_type_as_text, packet_type) \
{ \
DBG_INF_FMT("buf=%p size=%u", (buf), (buf_size)); \
- if (FAIL == mysqlnd_read_header((conn)->net, &((packet)->header), (conn)->stats, ((conn)->error_info) TSRMLS_CC)) {\
+ if (FAIL == mysqlnd_read_header((conn)->net, &((packet)->header), (conn)->stats, ((conn)->error_info))) {\
CONN_SET_STATE(conn, CONN_QUIT_SENT); \
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysqlnd_server_gone); \
+ php_error_docref(NULL, E_WARNING, "%s", mysqlnd_server_gone); \
DBG_ERR_FMT("Can't read %s's header", (packet_type_as_text)); \
DBG_RETURN(FAIL);\
}\
@@ -47,10 +47,10 @@
(buf_size), (packet)->header.size, (packet)->header.size - (buf_size)); \
DBG_RETURN(FAIL); \
}\
- if (FAIL == conn->net->data->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info) TSRMLS_CC)) { \
+ if (FAIL == conn->net->data->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info))) { \
CONN_SET_STATE(conn, CONN_QUIT_SENT); \
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);\
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysqlnd_server_gone); \
+ php_error_docref(NULL, E_WARNING, "%s", mysqlnd_server_gone); \
DBG_ERR_FMT("Empty '%s' packet body", (packet_type_as_text)); \
DBG_RETURN(FAIL);\
} \
@@ -63,7 +63,7 @@
#define BAIL_IF_NO_MORE_DATA \
if ((size_t)(p - begin) > packet->header.size) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%u)", __LINE__); \
+ php_error_docref(NULL, E_WARNING, "Premature end of data (mysqlnd_wireprotocol.c:%u)", __LINE__); \
goto premature_end; \
} \
@@ -233,7 +233,7 @@ php_mysqlnd_net_store_length_size(uint64_t length)
static enum_func_status
php_mysqlnd_read_error_from_line(zend_uchar *buf, size_t buf_len,
char *error, int error_buf_len,
- unsigned int *error_no, char *sqlstate TSRMLS_DC)
+ unsigned int *error_no, char *sqlstate)
{
zend_uchar *p = buf;
int error_msg_len= 0;
@@ -276,13 +276,13 @@ end:
/* {{{ mysqlnd_read_header */
static enum_func_status
mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
- MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
+ MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info)
{
zend_uchar buffer[MYSQLND_HEADER_SIZE];
DBG_ENTER(mysqlnd_read_header_name);
DBG_INF_FMT("compressed=%u", net->data->compressed);
- if (FAIL == net->data->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+ if (FAIL == net->data->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info)) {
DBG_RETURN(FAIL);
}
@@ -318,7 +318,7 @@ mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
/* {{{ php_mysqlnd_greet_read */
static enum_func_status
-php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buf[2048];
zend_uchar *p = buf;
@@ -350,7 +350,7 @@ php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
/*
The server doesn't send sqlstate in the greet packet.
It's a bug#26426 , so we have to set it correctly ourselves.
@@ -445,7 +445,7 @@ php_mysqlnd_greet_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -454,7 +454,7 @@ premature_end:
/* {{{ php_mysqlnd_greet_free_mem */
static
-void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet;
if (p->server_version) {
@@ -480,7 +480,7 @@ void php_mysqlnd_greet_free_mem(void * _packet, zend_bool stack_allocation TSRML
/* {{{ php_mysqlnd_auth_write */
static
-size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buffer[AUTH_WRITE_BUFFER_LEN];
zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */
@@ -517,7 +517,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
const char * const msg = "Authentication data too long. "
"Won't fit into the buffer and will be truncated. Authentication will thus fail";
SET_CLIENT_ERROR(*conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, msg);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", msg);
+ php_error_docref(NULL, E_WARNING, "%s", msg);
DBG_RETURN(0);
}
@@ -647,12 +647,12 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
if (packet->is_change_user_packet) {
if (PASS != conn->m->simple_command(conn, COM_CHANGE_USER, buffer + MYSQLND_HEADER_SIZE, p - buffer - MYSQLND_HEADER_SIZE,
PROT_LAST /* the caller will handle the OK packet */,
- packet->silent, TRUE TSRMLS_CC)) {
+ packet->silent, TRUE)) {
DBG_RETURN(0);
}
DBG_RETURN(p - buffer - MYSQLND_HEADER_SIZE);
} else {
- size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (!sent) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
}
@@ -664,7 +664,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
/* {{{ php_mysqlnd_auth_free_mem */
static
-void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_AUTH * p = (MYSQLND_PACKET_AUTH *) _packet;
@@ -678,7 +678,7 @@ void php_mysqlnd_auth_free_mem(void * _packet, zend_bool stack_allocation TSRMLS
/* {{{ php_mysqlnd_auth_response_read */
static enum_func_status
-php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar local_buf[AUTH_RESP_BUFFER_SIZE];
size_t buf_len = conn->net->cmd_buffer.buffer? conn->net->cmd_buffer.length: AUTH_RESP_BUFFER_SIZE;
@@ -710,7 +710,7 @@ php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_D
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
if (0xFE == packet->response_code) {
@@ -761,7 +761,7 @@ php_mysqlnd_auth_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_D
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "AUTH_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "AUTH_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -770,7 +770,7 @@ premature_end:
/* {{{ php_mysqlnd_auth_response_free_mem */
static void
-php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet;
if (p->message) {
@@ -798,7 +798,7 @@ php_mysqlnd_auth_response_free_mem(void * _packet, zend_bool stack_allocation TS
/* {{{ php_mysqlnd_change_auth_response_write */
static size_t
-php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *packet= (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet;
zend_uchar * buffer = conn->net->cmd_buffer.length >= packet->auth_data_len? conn->net->cmd_buffer.buffer : mnd_emalloc(packet->auth_data_len);
@@ -812,7 +812,7 @@ php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn
}
{
- size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (buffer != conn->net->cmd_buffer.buffer) {
mnd_efree(buffer);
}
@@ -827,7 +827,7 @@ php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn
/* {{{ php_mysqlnd_change_auth_response_free_mem */
static void
-php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_CHANGE_AUTH_RESPONSE * p = (MYSQLND_PACKET_CHANGE_AUTH_RESPONSE *) _packet;
@@ -841,7 +841,7 @@ php_mysqlnd_change_auth_response_free_mem(void * _packet, zend_bool stack_alloca
/* {{{ php_mysqlnd_ok_read */
static enum_func_status
-php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar local_buf[OK_BUFFER_SIZE];
size_t buf_len = conn->net->cmd_buffer.buffer? conn->net->cmd_buffer.length : OK_BUFFER_SIZE;
@@ -865,7 +865,7 @@ php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(PASS);
}
@@ -902,7 +902,7 @@ php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -911,7 +911,7 @@ premature_end:
/* {{{ php_mysqlnd_ok_free_mem */
static void
-php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet;
if (p->message) {
@@ -927,7 +927,7 @@ php_mysqlnd_ok_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
/* {{{ php_mysqlnd_eof_read */
static enum_func_status
-php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/*
EOF packet is since 4.1 five bytes long,
@@ -955,7 +955,7 @@ php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error, sizeof(packet->error),
&packet->error_no, packet->sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
@@ -985,7 +985,7 @@ php_mysqlnd_eof_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -994,7 +994,7 @@ premature_end:
/* {{{ php_mysqlnd_eof_free_mem */
static
-void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
mnd_pefree(_packet, ((MYSQLND_PACKET_EOF *)_packet)->header.persistent);
@@ -1004,7 +1004,7 @@ void php_mysqlnd_eof_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_cmd_write */
-size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* Let's have some space, which we can use, if not enough, we will allocate new buffer */
MYSQLND_PACKET_COMMAND * packet= (MYSQLND_PACKET_COMMAND *) _packet;
@@ -1027,14 +1027,14 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PACKETS_SENT_CMD);
#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
- net->data->m.consume_uneaten_data(net, packet->command TSRMLS_CC);
+ net->data->m.consume_uneaten_data(net, packet->command);
#endif
if (!packet->argument || !packet->arg_len) {
zend_uchar buffer[MYSQLND_HEADER_SIZE + 1];
int1store(buffer + MYSQLND_HEADER_SIZE, packet->command);
- sent = net->data->m.send_ex(net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
+ sent = net->data->m.send_ex(net, buffer, 1, conn->stats, conn->error_info);
} else {
size_t tmp_len = packet->arg_len + 1 + MYSQLND_HEADER_SIZE;
zend_uchar *tmp, *p;
@@ -1049,7 +1049,7 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
memcpy(p, packet->argument, packet->arg_len);
- sent = net->data->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+ sent = net->data->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info);
if (tmp != net->cmd_buffer.buffer) {
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CMD_BUFFER_TOO_SMALL);
mnd_efree(tmp);
@@ -1070,7 +1070,7 @@ end:
/* {{{ php_mysqlnd_cmd_free_mem */
static
-void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_COMMAND * p = (MYSQLND_PACKET_COMMAND *) _packet;
@@ -1082,7 +1082,7 @@ void php_mysqlnd_cmd_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_rset_header_read */
static enum_func_status
-php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
enum_func_status ret = PASS;
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1108,7 +1108,7 @@ php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error_info.error, sizeof(packet->error_info.error),
&packet->error_info.error_no, packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status);
DBG_RETURN(PASS);
}
@@ -1178,7 +1178,7 @@ php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(ret);
premature_end:
DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "RSET_HEADER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -1187,7 +1187,7 @@ premature_end:
/* {{{ php_mysqlnd_rset_header_free_mem */
static
-void php_mysqlnd_rset_header_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_rset_header_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet;
DBG_ENTER("php_mysqlnd_rset_header_free_mem");
@@ -1221,7 +1221,7 @@ static size_t rset_field_offsets[] =
/* {{{ php_mysqlnd_rset_field_read */
static enum_func_status
-php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* Should be enough for the metadata of a single row */
MYSQLND_PACKET_RES_FIELD *packet = (MYSQLND_PACKET_RES_FIELD *) _packet;
@@ -1250,7 +1250,7 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
php_mysqlnd_read_error_from_line(p, packet->header.size - 1,
packet->error_info.error, sizeof(packet->error_info.error),
&packet->error_info.error_no, packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_ERR_FMT("Server error : (%u) %s", packet->error_info.error_no, packet->error_info.error);
DBG_RETURN(PASS);
} else if (EODATA_MARKER == *p && packet->header.size < 8) {
@@ -1285,7 +1285,7 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
/* 1 byte length */
if (12 != *p) {
DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol error. Server sent false length. Expected 12");
+ php_error_docref(NULL, E_WARNING, "Protocol error. Server sent false length. Expected 12");
}
p++;
@@ -1408,12 +1408,12 @@ php_mysqlnd_rset_field_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
faulty_or_fake:
DBG_ERR_FMT("Protocol error. Server sent NULL_LENGTH. The server is faulty");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol error. Server sent NULL_LENGTH."
+ php_error_docref(NULL, E_WARNING, "Protocol error. Server sent NULL_LENGTH."
" The server is faulty");
DBG_RETURN(FAIL);
premature_end:
DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
+ php_error_docref(NULL, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
"shorter than expected", p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -1422,7 +1422,7 @@ premature_end:
/* {{{ php_mysqlnd_rset_field_free_mem */
static
-void php_mysqlnd_rset_field_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_rset_field_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_RES_FIELD *p = (MYSQLND_PACKET_RES_FIELD *) _packet;
/* p->metadata was passed to us as temporal buffer */
@@ -1438,7 +1438,7 @@ static enum_func_status
php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_set_memory_pool,
MYSQLND_MEMORY_POOL_CHUNK ** buffer,
size_t * data_size, zend_bool persistent_alloc,
- unsigned int prealloc_more_bytes TSRMLS_DC)
+ unsigned int prealloc_more_bytes)
{
enum_func_status ret = PASS;
MYSQLND_PACKET_HEADER header;
@@ -1457,7 +1457,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
*data_size = prealloc_more_bytes;
while (1) {
- if (FAIL == mysqlnd_read_header(conn->net, &header, conn->stats, conn->error_info TSRMLS_CC)) {
+ if (FAIL == mysqlnd_read_header(conn->net, &header, conn->stats, conn->error_info)) {
ret = FAIL;
break;
}
@@ -1466,7 +1466,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
if (first_iteration) {
first_iteration = FALSE;
- *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size TSRMLS_CC);
+ *buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size);
if (!*buffer) {
ret = FAIL;
break;
@@ -1481,7 +1481,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
/*
We have to realloc the buffer.
*/
- if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size TSRMLS_CC)) {
+ if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size)) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
break;
@@ -1490,7 +1490,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
p = (*buffer)->ptr + (*data_size - header.size);
}
- if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info TSRMLS_CC))) {
+ if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info))) {
DBG_ERR("Empty row packet body");
php_error(E_WARNING, "Empty row packet body");
break;
@@ -1501,7 +1501,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
}
}
if (ret == FAIL && *buffer) {
- (*buffer)->free_chunk((*buffer) TSRMLS_CC);
+ (*buffer)->free_chunk((*buffer));
*buffer = NULL;
}
*data_size -= prealloc_more_bytes;
@@ -1514,7 +1514,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
enum_func_status
php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
unsigned int i;
zend_uchar *p = row_buffer->ptr;
@@ -1549,7 +1549,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
statistic = STAT_BINARY_TYPE_FETCHED_NULL;
} else {
enum_mysqlnd_field_types type = fields_metadata[i].type;
- mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p TSRMLS_CC);
+ mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p);
if (MYSQLND_G(collect_statistics)) {
switch (fields_metadata[i].type) {
@@ -1604,7 +1604,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
enum_func_status
php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
unsigned int i;
zval *current_field, *end_field, *start_field;
@@ -1724,7 +1724,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
Definitely not nice, _hackish_ :(, but works.
*/
zend_uchar *start = bit_area;
- ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, &p, len TSRMLS_CC);
+ ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, &p, len);
/*
We have advanced in ps_fetch_from_1_to_8_bytes. We should go back because
later in this function there will be an advancement.
@@ -1756,11 +1756,11 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
enum_func_status
php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
enum_func_status ret;
DBG_ENTER("php_mysqlnd_rowp_read_text_protocol_zval");
- ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats TSRMLS_CC);
+ ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats);
DBG_RETURN(ret);
}
/* }}} */
@@ -1770,11 +1770,11 @@ php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
enum_func_status
php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
+ zend_bool as_int_or_float, MYSQLND_STATS * stats)
{
enum_func_status ret;
DBG_ENTER("php_mysqlnd_rowp_read_text_protocol_c");
- ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats TSRMLS_CC);
+ ret = php_mysqlnd_rowp_read_text_protocol_aux(row_buffer, fields, field_count, fields_metadata, as_int_or_float, stats);
DBG_RETURN(ret);
}
/* }}} */
@@ -1786,7 +1786,7 @@ php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
if PS => packet->fields is passed from outside
*/
static enum_func_status
-php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar *p;
enum_func_status ret = PASS;
@@ -1803,7 +1803,7 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
ret = php_mysqlnd_read_row_ex(conn, packet->result_set_memory_pool, &packet->row_buffer, &data_size,
packet->persistent_alloc, post_alloc_for_bit_fields
- TSRMLS_CC);
+ );
if (FAIL == ret) {
goto end;
}
@@ -1828,7 +1828,7 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
} else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */
packet->eof = TRUE;
p++;
@@ -1878,14 +1878,14 @@ end:
/* {{{ php_mysqlnd_rowp_free_mem */
static void
-php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_ROW *p;
DBG_ENTER("php_mysqlnd_rowp_free_mem");
p = (MYSQLND_PACKET_ROW *) _packet;
if (p->row_buffer) {
- p->row_buffer->free_chunk(p->row_buffer TSRMLS_CC);
+ p->row_buffer->free_chunk(p->row_buffer);
p->row_buffer = NULL;
}
DBG_INF_FMT("stack_allocation=%u persistent=%u", (int)stack_allocation, (int)p->header.persistent);
@@ -1906,7 +1906,7 @@ php_mysqlnd_rowp_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
/* {{{ php_mysqlnd_stats_read */
static enum_func_status
-php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
MYSQLND_PACKET_STATS *packet= (MYSQLND_PACKET_STATS *) _packet;
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1928,7 +1928,7 @@ php_mysqlnd_stats_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
/* {{{ php_mysqlnd_stats_free_mem */
static
-void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet;
if (p->message) {
@@ -1948,7 +1948,7 @@ void php_mysqlnd_stats_free_mem(void * _packet, zend_bool stack_allocation TSRML
/* {{{ php_mysqlnd_prepare_read */
static enum_func_status
-php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* In case of an error, we should have place to put it */
size_t buf_len = conn->net->cmd_buffer.length;
@@ -1974,7 +1974,7 @@ php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
DBG_RETURN(PASS);
}
@@ -2015,7 +2015,7 @@ php_mysqlnd_prepare_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2024,7 +2024,7 @@ premature_end:
/* {{{ php_mysqlnd_prepare_free_mem */
static void
-php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_PREPARE_RESPONSE *p= (MYSQLND_PACKET_PREPARE_RESPONSE *) _packet;
if (!stack_allocation) {
@@ -2036,7 +2036,7 @@ php_mysqlnd_prepare_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_D
/* {{{ php_mysqlnd_chg_user_read */
static enum_func_status
-php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
/* There could be an error message */
size_t buf_len = conn->net->cmd_buffer.length;
@@ -2071,7 +2071,7 @@ php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
sizeof(packet->error_info.error),
&packet->error_info.error_no,
packet->error_info.sqlstate
- TSRMLS_CC);
+ );
}
BAIL_IF_NO_MORE_DATA;
if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) {
@@ -2090,7 +2090,7 @@ php_mysqlnd_chg_user_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
DBG_RETURN(PASS);
premature_end:
DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2099,7 +2099,7 @@ premature_end:
/* {{{ php_mysqlnd_chg_user_free_mem */
static void
-php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet;
@@ -2124,7 +2124,7 @@ php_mysqlnd_chg_user_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_
/* {{{ php_mysqlnd_sha256_pk_request_write */
static
-size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buffer[MYSQLND_HEADER_SIZE + 1];
size_t sent;
@@ -2132,7 +2132,7 @@ size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * c
DBG_ENTER("php_mysqlnd_sha256_pk_request_write");
int1store(buffer + MYSQLND_HEADER_SIZE, '\1');
- sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
+ sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info);
DBG_RETURN(sent);
}
@@ -2141,7 +2141,7 @@ size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * c
/* {{{ php_mysqlnd_sha256_pk_request_free_mem */
static
-void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allocation)
{
if (!stack_allocation) {
MYSQLND_PACKET_SHA256_PK_REQUEST * p = (MYSQLND_PACKET_SHA256_PK_REQUEST *) _packet;
@@ -2155,7 +2155,7 @@ void php_mysqlnd_sha256_pk_request_free_mem(void * _packet, zend_bool stack_allo
/* {{{ php_mysqlnd_sha256_pk_request_response_read */
static enum_func_status
-php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
+php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA * conn)
{
zend_uchar buf[SHA256_PK_REQUEST_RESP_BUFFER_SIZE];
zend_uchar *p = buf;
@@ -2180,7 +2180,7 @@ php_mysqlnd_sha256_pk_request_response_read(void * _packet, MYSQLND_CONN_DATA *
premature_end:
DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SHA256_PK_REQUEST_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+ php_error_docref(NULL, E_WARNING, "SHA256_PK_REQUEST_RESPONSE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
p - begin - packet->header.size);
DBG_RETURN(FAIL);
}
@@ -2189,7 +2189,7 @@ premature_end:
/* {{{ php_mysqlnd_sha256_pk_request_response_free_mem */
static void
-php_mysqlnd_sha256_pk_request_response_free_mem(void * _packet, zend_bool stack_allocation TSRMLS_DC)
+php_mysqlnd_sha256_pk_request_response_free_mem(void * _packet, zend_bool stack_allocation)
{
MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _packet;
if (p->public_key) {
@@ -2305,7 +2305,7 @@ mysqlnd_packet_methods packet_methods[PROT_LAST] =
/* {{{ mysqlnd_protocol::get_greet_packet */
static struct st_mysqlnd_packet_greet *
-MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_greet * packet = mnd_pecalloc(1, packet_methods[PROT_GREET_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_greet_packet");
@@ -2320,7 +2320,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_greet_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_auth_packet */
static struct st_mysqlnd_packet_auth *
-MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_auth * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_packet");
@@ -2335,7 +2335,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_packet)(MYSQLND_PROTOCOL * const proto
/* {{{ mysqlnd_protocol::get_auth_response_packet */
static struct st_mysqlnd_packet_auth_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_auth_response_packet");
@@ -2350,7 +2350,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_auth_response_packet)(MYSQLND_PROTOCOL * co
/* {{{ mysqlnd_protocol::get_change_auth_response_packet */
static struct st_mysqlnd_packet_change_auth_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_change_auth_response * packet = mnd_pecalloc(1, packet_methods[PROT_CHANGE_AUTH_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_auth_response_packet");
@@ -2365,7 +2365,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_auth_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_ok_packet */
static struct st_mysqlnd_packet_ok *
-MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_ok * packet = mnd_pecalloc(1, packet_methods[PROT_OK_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_ok_packet");
@@ -2380,7 +2380,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_ok_packet)(MYSQLND_PROTOCOL * const protoco
/* {{{ mysqlnd_protocol::get_eof_packet */
static struct st_mysqlnd_packet_eof *
-MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_eof * packet = mnd_pecalloc(1, packet_methods[PROT_EOF_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_eof_packet");
@@ -2395,7 +2395,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_eof_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_command_packet */
static struct st_mysqlnd_packet_command *
-MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_command * packet = mnd_pecalloc(1, packet_methods[PROT_CMD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_command_packet");
@@ -2410,7 +2410,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_command_packet)(MYSQLND_PROTOCOL * const pr
/* {{{ mysqlnd_protocol::get_rset_packet */
static struct st_mysqlnd_packet_rset_header *
-MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_rset_header * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_HEADER_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_rset_header_packet");
@@ -2425,7 +2425,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_rset_header_packet)(MYSQLND_PROTOCOL * cons
/* {{{ mysqlnd_protocol::get_result_field_packet */
static struct st_mysqlnd_packet_res_field *
-MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_res_field * packet = mnd_pecalloc(1, packet_methods[PROT_RSET_FLD_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_result_field_packet");
@@ -2440,7 +2440,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_result_field_packet)(MYSQLND_PROTOCOL * con
/* {{{ mysqlnd_protocol::get_row_packet */
static struct st_mysqlnd_packet_row *
-MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_row * packet = mnd_pecalloc(1, packet_methods[PROT_ROW_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_row_packet");
@@ -2455,7 +2455,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_row_packet)(MYSQLND_PROTOCOL * const protoc
/* {{{ mysqlnd_protocol::get_stats_packet */
static struct st_mysqlnd_packet_stats *
-MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_stats * packet = mnd_pecalloc(1, packet_methods[PROT_STATS_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_stats_packet");
@@ -2470,7 +2470,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_stats_packet)(MYSQLND_PROTOCOL * const prot
/* {{{ mysqlnd_protocol::get_prepare_response_packet */
static struct st_mysqlnd_packet_prepare_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_prepare_response * packet = mnd_pecalloc(1, packet_methods[PROT_PREPARE_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_prepare_response_packet");
@@ -2485,7 +2485,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_prepare_response_packet)(MYSQLND_PROTOCOL *
/* {{{ mysqlnd_protocol::get_change_user_response_packet */
static struct st_mysqlnd_packet_chg_user_resp*
-MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_chg_user_resp * packet = mnd_pecalloc(1, packet_methods[PROT_CHG_USER_RESP_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_change_user_response_packet");
@@ -2500,7 +2500,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_change_user_response_packet)(MYSQLND_PROTOC
/* {{{ mysqlnd_protocol::get_sha256_pk_request_packet */
static struct st_mysqlnd_packet_sha256_pk_request *
-MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_sha256_pk_request * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_packet");
@@ -2515,7 +2515,7 @@ MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_packet)(MYSQLND_PROTOCOL
/* {{{ mysqlnd_protocol::get_sha256_pk_request_response_packet */
static struct st_mysqlnd_packet_sha256_pk_request_response *
-MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_protocol, get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL * const protocol, zend_bool persistent)
{
struct st_mysqlnd_packet_sha256_pk_request_response * packet = mnd_pecalloc(1, packet_methods[PROT_SHA256_PK_REQUEST_RESPONSE_PACKET].struct_size, persistent);
DBG_ENTER("mysqlnd_protocol::get_sha256_pk_request_response_packet");
@@ -2550,11 +2550,11 @@ MYSQLND_CLASS_METHODS_END;
/* {{{ mysqlnd_protocol_init */
PHPAPI MYSQLND_PROTOCOL *
-mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC)
+mysqlnd_protocol_init(zend_bool persistent)
{
MYSQLND_PROTOCOL * ret;
DBG_ENTER("mysqlnd_protocol_init");
- ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_decoder(persistent TSRMLS_CC);
+ ret = MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory).get_protocol_decoder(persistent);
DBG_RETURN(ret);
}
/* }}} */
@@ -2562,7 +2562,7 @@ mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC)
/* {{{ mysqlnd_protocol_free */
PHPAPI void
-mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol TSRMLS_DC)
+mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol)
{
DBG_ENTER("mysqlnd_protocol_free");
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h
index 5238715987..c15d3c4a47 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.h
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.h
@@ -36,13 +36,13 @@ PHPAPI extern const char mysqlnd_read_body_name[];
/* Packet handling */
-#define PACKET_WRITE(packet, conn) ((packet)->header.m->write_to_net((packet), (conn) TSRMLS_CC))
-#define PACKET_READ(packet, conn) ((packet)->header.m->read_from_net((packet), (conn) TSRMLS_CC))
+#define PACKET_WRITE(packet, conn) ((packet)->header.m->write_to_net((packet), (conn)))
+#define PACKET_READ(packet, conn) ((packet)->header.m->read_from_net((packet), (conn)))
#define PACKET_FREE(packet) \
do { \
DBG_INF_FMT("PACKET_FREE(%p)", packet); \
if ((packet)) { \
- ((packet)->header.m->free_mem((packet), FALSE TSRMLS_CC)); \
+ ((packet)->header.m->free_mem((packet), FALSE)); \
} \
} while (0);
@@ -51,9 +51,9 @@ PHPAPI extern const char * const mysqlnd_command_to_text[COM_END];
/* Low-level extraction functionality */
typedef struct st_mysqlnd_packet_methods {
size_t struct_size;
- enum_func_status (*read_from_net)(void * packet, MYSQLND_CONN_DATA * conn TSRMLS_DC);
- size_t (*write_to_net)(void * packet, MYSQLND_CONN_DATA * conn TSRMLS_DC);
- void (*free_mem)(void *packet, zend_bool stack_allocation TSRMLS_DC);
+ enum_func_status (*read_from_net)(void * packet, MYSQLND_CONN_DATA * conn);
+ size_t (*write_to_net)(void * packet, MYSQLND_CONN_DATA * conn);
+ void (*free_mem)(void *packet, zend_bool stack_allocation);
} mysqlnd_packet_methods;
@@ -308,20 +308,20 @@ PHPAPI const extern char * const mysqlnd_empty_string;
enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
enum_func_status php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
enum_func_status php_mysqlnd_rowp_read_text_protocol_c(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval * fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
- zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC);
+ zend_bool as_int_or_float, MYSQLND_STATS * stats);
-PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC);
-PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol TSRMLS_DC);
+PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent);
+PHPAPI void mysqlnd_protocol_free(MYSQLND_PROTOCOL * const protocol);
#endif /* MYSQLND_WIREPROTOCOL_H */
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index 71512e8d46..01e71618e6 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -56,7 +56,7 @@ mysqlnd_minfo_print_hash(zval *values)
/* {{{ mysqlnd_minfo_dump_plugin_stats */
static int
-mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument TSRMLS_DC)
+mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument)
{
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
if (plugin_header->plugin_stats.values) {
@@ -79,7 +79,7 @@ mysqlnd_minfo_dump_plugin_stats(zval *el, void * argument TSRMLS_DC)
/* {{{ mysqlnd_minfo_dump_loaded_plugins */
static int
-mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf TSRMLS_DC)
+mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf)
{
smart_str * buffer = (smart_str *) buf;
struct st_mysqlnd_plugin_header * plugin_header = (struct st_mysqlnd_plugin_header *)Z_PTR_P(el);
@@ -96,9 +96,9 @@ mysqlnd_minfo_dump_loaded_plugins(zval *el, void * buf TSRMLS_DC)
/* {{{ mysqlnd_minfo_dump_api_plugins */
static void
-mysqlnd_minfo_dump_api_plugins(smart_str * buffer TSRMLS_DC)
+mysqlnd_minfo_dump_api_plugins(smart_str * buffer)
{
- HashTable *ht = mysqlnd_reverse_api_get_api_list(TSRMLS_C);
+ HashTable *ht = mysqlnd_reverse_api_get_api_list();
MYSQLND_REVERSE_API *ext;
ZEND_HASH_FOREACH_PTR(ht, ext) {
@@ -157,7 +157,7 @@ PHP_MINFO_FUNCTION(mysqlnd)
php_info_print_table_row(2, "Loaded plugins", tmp_str.s? tmp_str.s->val : "");
smart_str_free(&tmp_str);
- mysqlnd_minfo_dump_api_plugins(&tmp_str TSRMLS_CC);
+ mysqlnd_minfo_dump_api_plugins(&tmp_str);
smart_str_0(&tmp_str);
php_info_print_table_row(2, "API Extensions", tmp_str.s? tmp_str.s->val : "");
smart_str_free(&tmp_str);
@@ -255,7 +255,7 @@ static PHP_MINIT_FUNCTION(mysqlnd)
{
REGISTER_INI_ENTRIES();
- mysqlnd_library_init(TSRMLS_C);
+ mysqlnd_library_init();
return SUCCESS;
}
/* }}} */
@@ -265,7 +265,7 @@ static PHP_MINIT_FUNCTION(mysqlnd)
*/
static PHP_MSHUTDOWN_FUNCTION(mysqlnd)
{
- mysqlnd_library_end(TSRMLS_C);
+ mysqlnd_library_end();
UNREGISTER_INI_ENTRIES();
return SUCCESS;
@@ -282,8 +282,8 @@ static PHP_RINIT_FUNCTION(mysqlnd)
struct st_mysqlnd_plugin_trace_log * trace_log_plugin = mysqlnd_plugin_find("debug_trace");
MYSQLND_G(dbg) = NULL;
if (trace_log_plugin) {
- MYSQLND_DEBUG * dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
- MYSQLND_DEBUG * trace_alloc = trace_log_plugin->methods.trace_instance_init(NULL TSRMLS_CC);
+ MYSQLND_DEBUG * dbg = trace_log_plugin->methods.trace_instance_init(mysqlnd_debug_std_no_trace_funcs);
+ MYSQLND_DEBUG * trace_alloc = trace_log_plugin->methods.trace_instance_init(NULL);
if (!dbg || !trace_alloc) {
return FAILURE;
}
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index f9a945a8b4..7f7c30c9e1 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -120,26 +120,26 @@ zend_class_entry *oci_coll_class_entry_ptr;
#endif
/* {{{ static protos */
-static void php_oci_connection_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_pconnection_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_pconnection_list_np_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_statement_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_descriptor_list_dtor (zend_resource * TSRMLS_DC);
-static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC);
-static void php_oci_collection_list_dtor (zend_resource * TSRMLS_DC);
-
-static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC);
-static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
-static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
-static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
-static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC);
-
-static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC);
-static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC);
-static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC);
-static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid TSRMLS_DC);
-static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid TSRMLS_DC);
-static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TSRMLS_DC);
+static void php_oci_connection_list_dtor (zend_resource *);
+static void php_oci_pconnection_list_dtor (zend_resource *);
+static void php_oci_pconnection_list_np_dtor (zend_resource *);
+static void php_oci_statement_list_dtor (zend_resource *);
+static void php_oci_descriptor_list_dtor (zend_resource *);
+static void php_oci_spool_list_dtor(zend_resource *entry);
+static void php_oci_collection_list_dtor (zend_resource *);
+
+static int php_oci_persistent_helper(zend_resource *le);
+static int php_oci_connection_ping(php_oci_connection *);
+static int php_oci_connection_status(php_oci_connection *);
+static int php_oci_connection_close(php_oci_connection *);
+static void php_oci_spool_close(php_oci_spool *session_pool);
+
+static OCIEnv *php_oci_create_env(ub2 charsetid);
+static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode);
+static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode);
+static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid);
+static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid);
+static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh);
/* }}} */
/* {{{ dynamically loadable module stuff */
@@ -1080,7 +1080,7 @@ PHP_INI_END()
*
* Initialize global handles only when they are needed
*/
-static void php_oci_init_global_handles(TSRMLS_D)
+static void php_oci_init_global_handles(void)
{
sword errstatus;
sb4 ora_error_code = 0;
@@ -1090,14 +1090,14 @@ static void php_oci_init_global_handles(TSRMLS_D)
if (errstatus == OCI_ERROR) {
#ifdef HAVE_OCI_INSTANT_CLIENT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
#endif
if (OCI_G(env)
&& OCIErrorGet(OCI_G(env), (ub4)1, NULL, &ora_error_code, tmp_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
&& *tmp_buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_buf);
}
OCI_G(env) = NULL;
@@ -1134,9 +1134,9 @@ static void php_oci_init_global_handles(TSRMLS_D)
}
if (errstatus == OCI_SUCCESS_WITH_INFO) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Initialization error: OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "Initialization error: OCI_SUCCESS_WITH_INFO: %s", tmp_buf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Initialization error: OCI_ERROR: %s", tmp_buf);
+ php_error_docref(NULL, E_WARNING, "Initialization error: OCI_ERROR: %s", tmp_buf);
OCIHandleFree((dvoid *) OCI_G(env), OCI_HTYPE_ENV);
@@ -1152,7 +1152,7 @@ static void php_oci_init_global_handles(TSRMLS_D)
*
* Free global handles (if they were initialized before)
*/
-static void php_oci_cleanup_global_handles(TSRMLS_D)
+static void php_oci_cleanup_global_handles(void)
{
if (OCI_G(err)) {
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) OCI_G(err), OCI_HTYPE_ERROR));
@@ -1182,7 +1182,7 @@ static PHP_GINIT_FUNCTION(oci)
*/
static PHP_GSHUTDOWN_FUNCTION(oci)
{
- php_oci_cleanup_global_handles(TSRMLS_C);
+ php_oci_cleanup_global_handles();
}
/* }}} */
@@ -1203,8 +1203,8 @@ PHP_MINIT_FUNCTION(oci)
INIT_CLASS_ENTRY(oci_lob_class_entry, "OCI-Lob", php_oci_lob_class_functions);
INIT_CLASS_ENTRY(oci_coll_class_entry, "OCI-Collection", php_oci_coll_class_functions);
- oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry TSRMLS_CC);
- oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry TSRMLS_CC);
+ oci_lob_class_entry_ptr = zend_register_internal_class(&oci_lob_class_entry);
+ oci_coll_class_entry_ptr = zend_register_internal_class(&oci_coll_class_entry);
/* thies@thieso.net 990203 i do not think that we will need all of them - just in here for completeness for now! */
REGISTER_LONG_CONSTANT("OCI_DEFAULT",OCI_DEFAULT, CONST_CS | CONST_PERSISTENT);
@@ -1321,7 +1321,7 @@ PHP_RSHUTDOWN_FUNCTION(oci)
* unable to process a pconnection because of a refcount, the processing would happen from
* np-destructor which is called when refcount goes to zero - php_oci_pconnection_list_np_dtor
*/
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper);
if (OCI_G(edition)) {
efree(OCI_G(edition));
@@ -1348,7 +1348,7 @@ PHP_MINFO_FUNCTION(oci)
php_info_print_table_row(2, "Revision", "$Id$");
#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))
- php_oci_client_get_version(&ver TSRMLS_CC);
+ php_oci_client_get_version(&ver);
php_info_print_table_row(2, "Oracle Run-time Client Library Version", ver);
efree(ver);
#else
@@ -1397,12 +1397,12 @@ PHP_MINFO_FUNCTION(oci)
*
* Non-persistent connection destructor
*/
-static void php_oci_connection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_connection_list_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
if (connection) {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_links)--;
}
}
@@ -1412,12 +1412,12 @@ static void php_oci_connection_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Persistent connection destructor
*/
-static void php_oci_pconnection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_pconnection_list_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
if (connection) {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_persistent)--;
OCI_G(num_links)--;
}
@@ -1429,7 +1429,7 @@ static void php_oci_pconnection_list_dtor(zend_resource *entry TSRMLS_DC)
* Non-Persistent destructor for persistent connection - This gets invoked when
* the refcount of this goes to zero in the regular list
*/
-static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_pconnection_list_np_dtor(zend_resource *entry)
{
php_oci_connection *connection = (php_oci_connection *)entry->ptr;
zval *zvp;
@@ -1459,7 +1459,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
zend_hash_del(&EG(persistent_list), connection->hash_key);
}
else {
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
OCI_G(num_persistent)--;
}
@@ -1478,7 +1478,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
* If oci_old_close_semantics is set, we artificially bump up the refcount and decremented
* only at request shutdown.
*/
- php_oci_connection_release(connection TSRMLS_CC);
+ php_oci_connection_release(connection);
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECT_P_DTOR_RELEASE_ENABLED()) {
@@ -1493,10 +1493,10 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry TSRMLS_DC)
*
* Statement destructor
*/
-static void php_oci_statement_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_statement_list_dtor(zend_resource *entry)
{
php_oci_statement *statement = (php_oci_statement *)entry->ptr;
- php_oci_statement_free(statement TSRMLS_CC);
+ php_oci_statement_free(statement);
}
/* }}} */
@@ -1504,10 +1504,10 @@ static void php_oci_statement_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Descriptor destructor
*/
-static void php_oci_descriptor_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_descriptor_list_dtor(zend_resource *entry)
{
php_oci_descriptor *descriptor = (php_oci_descriptor *)entry->ptr;
- php_oci_lob_free(descriptor TSRMLS_CC);
+ php_oci_lob_free(descriptor);
}
/* }}} */
@@ -1515,10 +1515,10 @@ static void php_oci_descriptor_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Collection destructor
*/
-static void php_oci_collection_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_collection_list_dtor(zend_resource *entry)
{
php_oci_collection *collection = (php_oci_collection *)entry->ptr;
- php_oci_collection_close(collection TSRMLS_CC);
+ php_oci_collection_close(collection);
}
/* }}} */
@@ -1574,7 +1574,6 @@ void php_oci_bind_hash_dtor(void *data)
void php_oci_column_hash_dtor(void *data)
{
php_oci_out_column *column = (php_oci_out_column *) data;
- TSRMLS_FETCH();
/* if (column->stmtid) { */ /* PHPNG TODO */
zend_list_close(column->stmtid);
@@ -1601,10 +1600,9 @@ void php_oci_column_hash_dtor(void *data)
void php_oci_descriptor_flush_hash_dtor(void *data)
{
php_oci_descriptor *descriptor = *(php_oci_descriptor **)data;
- TSRMLS_FETCH();
if (descriptor && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED && (descriptor->type == OCI_DTYPE_LOB || descriptor->type == OCI_DTYPE_FILE)) {
- php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
+ php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE);
descriptor->buffering = PHP_OCI_LOB_BUFFER_ENABLED;
}
data = NULL;
@@ -1617,7 +1615,7 @@ void php_oci_descriptor_flush_hash_dtor(void *data)
*
* Free descriptors for a connection
*/
-void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_DC)
+void php_oci_connection_descriptors_free(php_oci_connection *connection)
{
zend_hash_destroy(connection->descriptors);
efree(connection->descriptors);
@@ -1631,7 +1629,7 @@ void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_D
* Fetch & print out error message if we get an error
* Returns an Oracle error number
*/
-sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
+sb4 php_oci_error(OCIError *err_p, sword errstatus)
{
text *errbuf = (text *)NULL;
sb4 errcode = 0; /* Oracle error number */
@@ -1640,46 +1638,46 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
case OCI_SUCCESS:
break;
case OCI_SUCCESS_WITH_INFO:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf);
+ php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: %s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
}
break;
case OCI_NEED_DATA:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NEED_DATA");
+ php_error_docref(NULL, E_WARNING, "OCI_NEED_DATA");
break;
case OCI_NO_DATA:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_NO_DATA: failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "OCI_NO_DATA: failed to fetch error message");
}
break;
case OCI_ERROR:
- errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(err_p, &errbuf);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf);
efree(errbuf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message");
+ php_error_docref(NULL, E_WARNING, "failed to fetch error message");
}
break;
case OCI_INVALID_HANDLE:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_INVALID_HANDLE");
+ php_error_docref(NULL, E_WARNING, "OCI_INVALID_HANDLE");
break;
case OCI_STILL_EXECUTING:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_STILL_EXECUTING");
+ php_error_docref(NULL, E_WARNING, "OCI_STILL_EXECUTING");
break;
case OCI_CONTINUE:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CONTINUE");
+ php_error_docref(NULL, E_WARNING, "OCI_CONTINUE");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown OCI error code: %d", errstatus);
+ php_error_docref(NULL, E_WARNING, "Unknown OCI error code: %d", errstatus);
break;
}
@@ -1697,7 +1695,7 @@ sb4 php_oci_error(OCIError *err_p, sword errstatus TSRMLS_DC)
*
* Fetch error message into the buffer from the error handle provided
*/
-sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
+sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf)
{
sb4 error_code = 0;
text err_buf[PHP_OCI_ERRBUF_LEN];
@@ -1724,7 +1722,7 @@ sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC)
*
* Compute offset in the SQL statement
*/
-int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC)
+int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset)
{
sword errstatus;
@@ -1733,7 +1731,7 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) sqltext, (ub4 *)0, OCI_ATTR_STATEMENT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1741,7 +1739,7 @@ int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, u
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)error_offset, (ub4 *)0, OCI_ATTR_PARSE_ERROR_OFFSET, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1763,7 +1761,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
zend_long session_mode = OCI_DEFAULT;
/* if a fourth parameter is handed over, it is the charset identifier (but is only used in Oracle 9i+) */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ssl", &username, &username_len, &password, &password_len, &dbname, &dbname_len, &charset, &charset_len, &session_mode) == FAILURE) {
return;
}
@@ -1777,7 +1775,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
charset = NULL;
}
- connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive TSRMLS_CC);
+ connection = php_oci_do_connect_ex(username, username_len, password, password_len, NULL, 0, dbname, dbname_len, charset, session_mode, persistent, exclusive);
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECT_RETURN_ENABLED()) {
@@ -1799,7 +1797,7 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
* The real connect function. Allocates all the resources needed, establishes the connection and
* returns the result handle (or NULL)
*/
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC)
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive)
{
zval *zvp;
zend_resource *le;
@@ -1815,12 +1813,12 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
ub2 charsetid_nls_lang = 0;
if (session_mode & ~(OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
+ php_error_docref(NULL, E_WARNING, "Invalid session mode specified (%pd)", session_mode);
return NULL;
}
if (session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) {
if ((session_mode & OCI_SYSOPER) && (session_mode & OCI_SYSDBA)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together");
+ php_error_docref(NULL, E_WARNING, "OCI_SYSDBA and OCI_SYSOPER cannot be used together");
return NULL;
}
if (session_mode & PHP_OCI_CRED_EXT) {
@@ -1828,11 +1826,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* Disable external authentication on Windows as Impersonation is not yet handled.
* TODO: Re-enable this once OCI provides capability.
*/
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "External Authentication is not supported on Windows");
+ php_error_docref(NULL, E_WARNING, "External Authentication is not supported on Windows");
return NULL;
#endif
if (username_len != 1 || username[0] != '/' || password_len != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password");
+ php_error_docref(NULL, E_WARNING, "OCI_CRED_EXT can only be used with a username of \"/\" and a NULL password");
return NULL;
}
}
@@ -1842,13 +1840,13 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
*/
persistent = 0;
if (!OCI_G(privileged_connect)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
+ php_error_docref(NULL, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
return NULL;
}
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* Safe mode has been removed in PHP 5.4 */
if (PG(safe_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Privileged connect is disabled in Safe Mode");
+ php_error_docref(NULL, E_WARNING, "Privileged connect is disabled in Safe Mode");
return NULL;
}
#endif
@@ -1857,7 +1855,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* Initialize global handles if they weren't initialized before */
if (OCI_G(env) == NULL) {
- php_oci_init_global_handles(TSRMLS_C);
+ php_oci_init_global_handles();
if (OCI_G(env) == NULL) {
return NULL;
}
@@ -1903,7 +1901,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if (charset && *charset) {
PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), (CONST oratext *)charset));
if (!charsetid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset);
+ php_error_docref(NULL, E_WARNING, "Invalid character set name: %s", charset);
} else {
smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
}
@@ -1970,7 +1968,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* TODO: put in negative code for non-persistent stubs
*/
if (connection && connection->is_persistent && connection->is_stub) {
- if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
+ if (php_oci_create_session(connection, NULL, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
smart_str_free(&hashed_details);
zend_hash_del(&EG(persistent_list), connection->hash_key);
@@ -1991,7 +1989,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* 2) see if it's time to ping it
* 3) ping it if needed
*/
- if (php_oci_connection_status(connection TSRMLS_CC)) {
+ if (php_oci_connection_status(connection)) {
/* Only ping if:
*
* 1) next_ping > 0, which means that ping_interval is not -1 (aka "Off")
@@ -1999,7 +1997,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* 2) current_timestamp > next_ping, which means "it's time to check if it's
* still alive"
*/
- if (!ping_done && (*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp)) && !php_oci_connection_ping(connection TSRMLS_CC)) {
+ if (!ping_done && (*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp)) && !php_oci_connection_ping(connection)) {
/* server died */
} else {
php_oci_connection *tmp;
@@ -2078,11 +2076,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* try to find an idle connection and kill it */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) php_oci_persistent_helper);
if (OCI_G(max_persistent) != -1 && OCI_G(num_persistent) >= OCI_G(max_persistent)) {
/* all persistent connactions are in use, fallback to non-persistent connection creation */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
+ php_error_docref(NULL, E_NOTICE, "Too many open persistent connections (%pd)", OCI_G(num_persistent));
alloc_non_persistent = 1;
}
}
@@ -2127,9 +2125,9 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* TODO: Unconditionally do this once OCI provides extended OCISessionGet capability
*/
if (use_spool && !connection->is_persistent) {
- if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang TSRMLS_CC))==NULL)
+ if ((session_pool = php_oci_get_spool(username, username_len, password, password_len, dbname, dbname_len, charsetid ? charsetid:charsetid_nls_lang))==NULL)
{
- php_oci_connection_close(connection TSRMLS_CC);
+ php_oci_connection_close(connection);
smart_str_free(&hashed_details);
return NULL;
}
@@ -2153,14 +2151,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
* connect/password change
*/
if (!use_spool) {
- if (php_oci_old_create_session(connection, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
- php_oci_connection_close(connection TSRMLS_CC);
+ if (php_oci_old_create_session(connection, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
+ php_oci_connection_close(connection);
return NULL;
}
} else {
/* create using the client-side session pool */
- if (php_oci_create_session(connection, session_pool, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode TSRMLS_CC)) {
- php_oci_connection_close(connection TSRMLS_CC);
+ if (php_oci_create_session(connection, session_pool, dbname, dbname_len, username, username_len, password, password_len, new_password, new_password_len, session_mode)) {
+ php_oci_connection_close(connection);
return NULL;
}
}
@@ -2210,7 +2208,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
*
* Ping connection. Uses OCIPing() or OCIServerVersion() depending on the Oracle Client version
*/
-static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_ping(php_oci_connection *connection)
{
sword errstatus;
#if (!((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))))
@@ -2253,7 +2251,7 @@ static int php_oci_connection_ping(php_oci_connection *connection TSRMLS_DC)
*
* Check connection status (pre-ping check)
*/
-static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_status(php_oci_connection *connection)
{
ub4 ss = OCI_SERVER_NOT_CONNECTED;
sword errstatus;
@@ -2274,7 +2272,7 @@ static int php_oci_connection_status(php_oci_connection *connection TSRMLS_DC)
*
* Rollback connection
*/
-int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_rollback(php_oci_connection *connection)
{
sword errstatus;
@@ -2282,7 +2280,7 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
connection->rb_on_disconnect = 0;
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2295,7 +2293,7 @@ int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC)
*
* Commit connection
*/
-int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_commit(php_oci_connection *connection)
{
sword errstatus;
@@ -2303,7 +2301,7 @@ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
connection->rb_on_disconnect = 0;
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2316,7 +2314,7 @@ int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC)
*
* Close the connection and free all its resources
*/
-static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
+static int php_oci_connection_close(php_oci_connection *connection)
{
int result = 0;
zend_bool in_call_save = OCI_G(in_call);
@@ -2329,7 +2327,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
if (!connection->is_stub) {
/* Release resources associated with connection */
- php_oci_connection_release(connection TSRMLS_CC);
+ php_oci_connection_release(connection);
}
if (!connection->using_spool && connection->svc) {
@@ -2368,7 +2366,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
/* Keep this as the last member to be freed, as there are dependencies
* (like env) on the session pool
*/
- php_oci_spool_close(connection->private_spool TSRMLS_CC);
+ php_oci_spool_close(connection->private_spool);
}
if (connection->hash_key) {
@@ -2392,7 +2390,7 @@ static int php_oci_connection_close(php_oci_connection *connection TSRMLS_DC)
* transactions, setting timeout-related parameters etc. For session-pool using connections, the
* underlying connection is released to its session pool.
*/
-int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
+int php_oci_connection_release(php_oci_connection *connection)
{
int result = 0;
zend_bool in_call_save = OCI_G(in_call);
@@ -2403,13 +2401,13 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
}
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
if (connection->svc) {
/* rollback outstanding transactions */
if (connection->rb_on_disconnect) {
- if (php_oci_connection_rollback(connection TSRMLS_CC)) {
+ if (php_oci_connection_rollback(connection)) {
/* rollback failed */
result = 1;
}
@@ -2483,14 +2481,14 @@ int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC)
*
* Change password for the user with the username given
*/
-int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC)
+int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len)
{
sword errstatus;
PHP_OCI_CALL_RETURN(errstatus, OCIPasswordChange, (connection->svc, connection->err, (text *)user, user_len, (text *)pass_old, pass_old_len, (text *)pass_new, pass_new_len, OCI_DEFAULT));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2504,7 +2502,7 @@ int php_oci_password_change(php_oci_connection *connection, char *user, int user
*
* Get Oracle client library version
*/
-void php_oci_client_get_version(char **version TSRMLS_DC)
+void php_oci_client_get_version(char **version)
{
char version_buff[256];
#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIClientVersion only available 10.2 onwards */
@@ -2527,7 +2525,7 @@ void php_oci_client_get_version(char **version TSRMLS_DC)
*
* Get Oracle server version
*/
-int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC)
+int php_oci_server_get_version(php_oci_connection *connection, char **version)
{
sword errstatus;
char version_buff[256];
@@ -2535,7 +2533,7 @@ int php_oci_server_get_version(php_oci_connection *connection, char **version TS
PHP_OCI_CALL_RETURN(errstatus, OCIServerVersion, (connection->svc, connection->err, (text *)version_buff, sizeof(version_buff), OCI_HTYPE_SVCCTX));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -2549,7 +2547,7 @@ int php_oci_server_get_version(php_oci_connection *connection, char **version TS
*
* Convert php_oci_out_column struct into zval
*/
-int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC)
+int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode)
{
php_oci_descriptor *descriptor;
ub4 lob_length;
@@ -2563,7 +2561,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
}
if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */
- zend_register_resource(value, column->stmtid, 0 TSRMLS_CC); /* XXX type correct? */
+ zend_register_resource(value, column->stmtid, 0); /* XXX type correct? */
++GC_REFCOUNT(column->stmtid);
} else if (column->is_descr) {
@@ -2574,7 +2572,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
descriptor = (php_oci_descriptor *) column->descid->ptr;
if (!descriptor || rsrc_type != le_descriptor) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find LOB descriptor #%d", column->descid);
+ php_error_docref(NULL, E_WARNING, "Unable to find LOB descriptor #%d", column->descid);
return 1;
}
@@ -2588,10 +2586,10 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSR
if (column->chunk_size)
descriptor->chunk_size = column->chunk_size;
- lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length TSRMLS_CC);
+ lob_fetch_status = php_oci_lob_read(descriptor, -1, 0, &lob_buffer, &lob_length);
if (descriptor->chunk_size) /* Cache the chunk_size to avoid recalling OCILobGetChunkSize */
column->chunk_size = descriptor->chunk_size;
- php_oci_temp_lob_close(descriptor TSRMLS_CC);
+ php_oci_temp_lob_close(descriptor);
if (lob_fetch_status) {
ZVAL_FALSE(value);
return 1;
@@ -2652,7 +2650,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (expected_args > 2) {
/* only for ocifetchinto BC */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz|l", &z_statement, &array, &fetch_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz|l", &z_statement, &array, &fetch_mode) == FAILURE) {
return;
}
@@ -2662,7 +2660,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else if (expected_args == 2) {
/* only for oci_fetch_array() */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &fetch_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_statement, &fetch_mode) == FAILURE) {
return;
}
@@ -2672,7 +2670,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else {
/* for all oci_fetch_*() */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -2692,7 +2690,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
#if (OCI_MAJOR_VERSION < 12)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_FALSE; /* end of fetch */
}
#else /* OCI_MAJOR_VERSION */
@@ -2716,8 +2714,8 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
}
if (invokedstatement->impres_count > 0) {
/* Make it so the fetch occurs on the first Implicit Result Set */
- statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC);
- if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ statement = php_oci_get_implicit_resultset(invokedstatement);
+ if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
invokedstatement->impres_count--;
invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement;
@@ -2728,16 +2726,16 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
}
}
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
/* End of fetch */
if (invokedstatement->impres_count > 0) {
/* Check next Implicit Result Set */
- statement = php_oci_get_implicit_resultset(invokedstatement TSRMLS_CC);
- if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ statement = php_oci_get_implicit_resultset(invokedstatement);
+ if (!statement || php_oci_statement_execute(statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
invokedstatement->impres_count--;
invokedstatement->impres_child_stmt = (struct php_oci_statement *)statement;
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
/* End of all fetches */
RETURN_FALSE;
}
@@ -2751,7 +2749,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
@@ -2763,7 +2761,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (!(column->indicator == -1)) {
zval element;
- php_oci_column_to_zval(column, &element, fetch_mode TSRMLS_CC);
+ php_oci_column_to_zval(column, &element, fetch_mode);
if (fetch_mode & PHP_OCI_NUM || !(fetch_mode & PHP_OCI_ASSOC)) {
add_index_zval(return_value, i, &element);
@@ -2799,7 +2797,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
* Helper function to close/rollback persistent connections at the end of request. A return value of
* 1 indicates that the connection is to be destroyed
*/
-static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC)
+static int php_oci_persistent_helper(zend_resource *le)
{
time_t timestamp;
php_oci_connection *connection;
@@ -2830,7 +2828,7 @@ static int php_oci_persistent_helper(zend_resource *le TSRMLS_DC)
*
* Create(alloc + Init) Session pool for the given dbname and charsetid
*/
-static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid TSRMLS_DC)
+static php_oci_spool *php_oci_create_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, zend_string *hash_key, int charsetid)
{
php_oci_spool *session_pool = NULL;
zend_bool iserror = 0;
@@ -2855,7 +2853,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
}
/* Create the session pool's env */
- if (!(session_pool->env = php_oci_create_env(charsetid TSRMLS_CC))) {
+ if (!(session_pool->env = php_oci_create_env(charsetid))) {
iserror = 1;
goto exit_create_spool;
}
@@ -2864,7 +2862,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **) &session_pool->poolh, OCI_HTYPE_SPOOL, (size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2876,7 +2874,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, ((dvoid *) session_pool->env, (dvoid **)&(session_pool->err), (ub4) OCI_HTYPE_ERROR,(size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2893,7 +2891,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIHandleAlloc, (session_pool->env, (dvoid **)&(spoolAuth), OCI_HTYPE_AUTHINFO, 0, NULL));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2904,7 +2902,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) OCI_G(edition), (ub4)(strlen(OCI_G(edition))), (ub4)OCI_ATTR_EDITION, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2915,7 +2913,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) spoolAuth, (ub4) OCI_HTYPE_AUTHINFO, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2925,7 +2923,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) (session_pool->poolh),(ub4) OCI_HTYPE_SPOOL, (dvoid *) spoolAuth, (ub4)0, (ub4)OCI_ATTR_SPOOL_AUTH, OCI_G(err)));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
goto exit_create_spool;
}
@@ -2938,13 +2936,13 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
PHP_OCI_CALL_RETURN(errstatus, OCISessionPoolCreate,(session_pool->env, OCI_G(err), session_pool->poolh, (OraText **)&session_pool->poolname, &session_pool->poolname_len, (OraText *)dbname, (ub4)dbname_len, 0, UB4MAXVAL, 1,(OraText *)username, (ub4)username_len, (OraText *)password,(ub4)password_len, poolmode));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1;
}
exit_create_spool:
if (iserror && session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
session_pool = NULL;
}
@@ -2967,7 +2965,7 @@ exit_create_spool:
* Get Session pool for the given dbname and charsetid from the persistent list. Function called for
* non-persistent connections.
*/
-static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid TSRMLS_DC)
+static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *password, int password_len, char *dbname, int dbname_len, int charsetid)
{
smart_str spool_hashed_details = {0};
php_oci_spool *session_pool = NULL;
@@ -3013,7 +3011,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
if (spool_out_le == NULL) {
- session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid TSRMLS_CC);
+ session_pool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, spool_hashed_details.s, charsetid);
if (session_pool == NULL) {
iserror = 1;
@@ -3033,7 +3031,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
exit_get_spool:
smart_str_free(&spool_hashed_details);
if (iserror && session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
session_pool = NULL;
}
@@ -3046,7 +3044,7 @@ exit_get_spool:
*
* Create the OCI environment choosing the correct function for the OCI version
*/
-static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
+static OCIEnv *php_oci_create_env(ub2 charsetid)
{
OCIEnv *retenv = NULL;
@@ -3058,14 +3056,14 @@ static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
text ora_msg_buf[OCI_ERROR_MAXMSG_SIZE]; /* Use traditional smaller size: non-PL/SQL errors should fit and it keeps the stack smaller */
#ifdef HAVE_OCI_INSTANT_CLIENT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that " PHP_OCI8_LIB_PATH_MSG " includes the directory with Oracle Instant Client libraries");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
+ php_error_docref(NULL, E_WARNING, "OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and " PHP_OCI8_LIB_PATH_MSG " are set and point to the right directories");
#endif
if (retenv
&& OCIErrorGet(retenv, (ub4)1, NULL, &ora_error_code, ora_msg_buf, (ub4)OCI_ERROR_MAXMSG_SIZE, (ub4)OCI_HTYPE_ENV) == OCI_SUCCESS
&& *ora_msg_buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_msg_buf);
+ php_error_docref(NULL, E_WARNING, "%s", ora_msg_buf);
}
return NULL;
@@ -3079,12 +3077,12 @@ static OCIEnv *php_oci_create_env(ub2 charsetid TSRMLS_DC)
* This function is to be deprecated in future in favour of OCISessionGet which is used in
* php_oci_do_connect_ex
*/
-static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC)
+static int php_oci_old_create_session(php_oci_connection *connection, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode)
{
ub4 statement_cache_size = (OCI_G(statement_cache_size) > 0) ? OCI_G(statement_cache_size) : 0;
/* Create the OCI environment separate for each connection */
- if (!(connection->env = php_oci_create_env(connection->charset TSRMLS_CC))) {
+ if (!(connection->env = php_oci_create_env(connection->charset))) {
return 1;
}
@@ -3092,7 +3090,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->server), OCI_HTYPE_SERVER, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3101,7 +3099,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIServerAttach, (connection->server, OCI_G(err), (text *)dbname, dbname_len, (ub4) OCI_DEFAULT));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3111,7 +3109,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->session), OCI_HTYPE_SESSION, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3120,7 +3118,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3129,7 +3127,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->svc), OCI_HTYPE_SVCCTX, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3139,7 +3137,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) username_len, (ub4) OCI_ATTR_USERNAME, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3150,7 +3148,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) password_len, (ub4) OCI_ATTR_PASSWORD, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3162,7 +3160,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(edition), (ub4) (strlen(OCI_G(edition))), (ub4) OCI_ATTR_EDITION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3174,7 +3172,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) PHP_OCI8_DRIVER_NAME, (ub4) sizeof(PHP_OCI8_DRIVER_NAME)-1, (ub4) OCI_ATTR_DRIVER_NAME, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
#endif
@@ -3184,7 +3182,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->server, 0, OCI_ATTR_SERVER, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3193,7 +3191,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, (connection->svc, OCI_HTYPE_SVCCTX, connection->session, 0, OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3203,14 +3201,14 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIPasswordChange, (connection->svc, OCI_G(err), (text *)username, username_len, (text *)password, password_len, (text *)new_password, new_password_len, OCI_AUTH));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrGet, ((dvoid *)connection->svc, OCI_HTYPE_SVCCTX, (dvoid *)&(connection->session), (ub4 *)0, OCI_ATTR_SESSION, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
/* }}} */
@@ -3229,7 +3227,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCISessionBegin, (connection->svc, OCI_G(err), connection->session, (ub4) cred_type, (ub4) session_mode));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
/* OCISessionBegin returns OCI_SUCCESS_WITH_INFO when
* user's password has expired, but is still usable.
*/
@@ -3241,15 +3239,15 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
}
/* Brand new connection: Init and update the next_ping in the connection */
- if (php_oci_ping_init(connection, OCI_G(err) TSRMLS_CC) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) {
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3262,7 +3260,7 @@ static int php_oci_old_create_session(php_oci_connection *connection, char *dbna
*
* Create session using client-side session pool - new norm
*/
-static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode TSRMLS_DC)
+static int php_oci_create_session(php_oci_connection *connection, php_oci_spool *session_pool, char *dbname, int dbname_len, char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, int session_mode)
{
php_oci_spool *actual_spool = NULL;
#if (OCI_MAJOR_VERSION > 10)
@@ -3273,7 +3271,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
/* Persistent connections have private session pools */
if (connection->is_persistent && !connection->private_spool &&
- !(connection->private_spool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, NULL, connection->charset TSRMLS_CC))) {
+ !(connection->private_spool = php_oci_create_spool(username, username_len, password, password_len, dbname, dbname_len, NULL, connection->charset))) {
return 1;
}
actual_spool = (connection->is_persistent) ? (connection->private_spool) : (session_pool);
@@ -3301,7 +3299,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->err), OCI_HTYPE_ERROR, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
}
@@ -3311,7 +3309,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIHandleAlloc, (connection->env, (dvoid **)&(connection->authinfo), OCI_HTYPE_AUTHINFO, 0, NULL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3320,7 +3318,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)(strlen(OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3332,7 +3330,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_AUTHINFO, (dvoid *) &purity, (ub4)0, (ub4)OCI_ATTR_PURITY, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
#endif
@@ -3362,7 +3360,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode),OCISessionGet, (connection->env, OCI_G(err), &(connection->svc), (OCIAuthInfo *)connection->authinfo, (OraText *)actual_spool->poolname, (ub4)actual_spool->poolname_len, NULL, 0, NULL, NULL, NULL, OCI_SESSGET_SPOOL));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
/* Session creation returns OCI_SUCCESS_WITH_INFO when user's password has expired, but
* is still usable.
@@ -3381,18 +3379,18 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIContextGetValue, (connection->session, OCI_G(err), (ub1 *)"NEXT_PING", (ub1)sizeof("NEXT_PING"), (void **)&(connection->next_pingp)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
if (!(connection->next_pingp)){
/* This is a brand new connection, we need not ping, but have to initialize ping */
- if (php_oci_ping_init(connection, OCI_G(err) TSRMLS_CC) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ if (php_oci_ping_init(connection, OCI_G(err)) != OCI_SUCCESS) {
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
} else if ((*(connection->next_pingp) > 0) && (timestamp >= *(connection->next_pingp))) {
- if (php_oci_connection_ping(connection TSRMLS_CC)) {
+ if (php_oci_connection_ping(connection)) {
/* Got a good connection - update next_ping and get out of ping loop */
*(connection->next_pingp) = timestamp + OCI_G(ping_interval);
} else {
@@ -3408,7 +3406,7 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->svc, (ub4) OCI_HTYPE_SVCCTX, (ub4 *) &statement_cache_size, 0, (ub4) OCI_ATTR_STMTCACHESIZE, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
return 1;
}
@@ -3424,12 +3422,12 @@ static int php_oci_create_session(php_oci_connection *connection, php_oci_spool
*
* Session pool destructor function
*/
-static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC)
+static void php_oci_spool_list_dtor(zend_resource *entry)
{
php_oci_spool *session_pool = (php_oci_spool *)entry->ptr;
if (session_pool) {
- php_oci_spool_close(session_pool TSRMLS_CC);
+ php_oci_spool_close(session_pool);
}
return;
@@ -3440,7 +3438,7 @@ static void php_oci_spool_list_dtor(zend_resource *entry TSRMLS_DC)
*
* Destroys the OCI Session Pool
*/
-static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC)
+static void php_oci_spool_close(php_oci_spool *session_pool)
{
if (session_pool->poolname_len) {
PHP_OCI_CALL(OCISessionPoolDestroy, ((dvoid *) session_pool->poolh,
@@ -3473,7 +3471,7 @@ static void php_oci_spool_close(php_oci_spool *session_pool TSRMLS_DC)
* OCIContext{Get,Set}Value to store the next_ping because we need to support ping for
* non-persistent DRCP connections
*/
-static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh TSRMLS_DC)
+static sword php_oci_ping_init(php_oci_connection *connection, OCIError *errh)
{
time_t *next_pingp = NULL;
diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c
index 341a983ef5..f722e6b782 100644
--- a/ext/oci8/oci8_collection.c
+++ b/ext/oci8/oci8_collection.c
@@ -44,7 +44,7 @@
/* {{{ php_oci_collection_create()
Create and return connection handle */
-php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC)
+php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len)
{
dvoid *dschp1 = NULL;
dvoid *parmp1;
@@ -197,7 +197,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch
break;
/* we only support VARRAYs and TABLEs */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unknown collection type %d", collection->coll_typecode);
+ php_error_docref(NULL, E_WARNING, "unknown collection type %d", collection->coll_typecode);
break;
}
@@ -232,16 +232,16 @@ CLEANUP:
/* free the describe handle (Bug #44113) */
PHP_OCI_CALL(OCIHandleFree, ((dvoid *) dschp1, OCI_HTYPE_DESCRIBE));
}
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- php_oci_collection_close(collection TSRMLS_CC);
+ php_oci_collection_close(collection);
return NULL;
}
/* }}} */
/* {{{ php_oci_collection_size()
Return size of the collection */
-int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
+int php_oci_collection_size(php_oci_collection *collection, sb4 *size)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -249,7 +249,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCICollSize, (connection->env, connection->err, collection->collection, (sb4 *)size));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -260,7 +260,7 @@ int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC)
/* {{{ php_oci_collection_max()
Return max number of elements in the collection */
-int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC)
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max)
{
php_oci_connection *connection = collection->connection;
@@ -273,7 +273,7 @@ int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS
/* {{{ php_oci_collection_trim()
Trim collection to the given number of elements */
-int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC)
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -281,7 +281,7 @@ int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size
PHP_OCI_CALL_RETURN(errstatus, OCICollTrim, (connection->env, connection->err, trim_size, collection->collection));
if (errstatus != OCI_SUCCESS) {
- errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ errstatus = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -292,7 +292,7 @@ int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size
/* {{{ php_oci_collection_append_null()
Append NULL element to the end of the collection */
-int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
+int php_oci_collection_append_null(php_oci_collection *collection)
{
OCIInd null_index = OCI_IND_NULL;
php_oci_connection *connection = collection->connection;
@@ -302,7 +302,7 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCICollAppend, (connection->env, connection->err, (dvoid *)0, &null_index, collection->collection));
if (errstatus != OCI_SUCCESS) {
- errstatus = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ errstatus = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -313,7 +313,7 @@ int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC)
/* {{{ php_oci_collection_append_date()
Append DATE element to the end of the collection (use "DD-MON-YY" format) */
-int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC)
+int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIDate oci_date;
@@ -325,7 +325,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
if (errstatus != OCI_SUCCESS) {
/* failed to convert string to date */
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -341,7 +341,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -353,7 +353,7 @@ int php_oci_collection_append_date(php_oci_collection *collection, char *date, i
/* {{{ php_oci_collection_append_number()
Append NUMBER to the end of the collection */
-int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC)
+int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
double element_double;
@@ -366,7 +366,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -382,7 +382,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -394,7 +394,7 @@ int php_oci_collection_append_number(php_oci_collection *collection, char *numbe
/* {{{ php_oci_collection_append_string()
Append STRING to the end of the collection */
-int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIString *ocistr = (OCIString *)0;
@@ -404,7 +404,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -420,7 +420,7 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -432,19 +432,19 @@ int php_oci_collection_append_string(php_oci_collection *collection, char *eleme
/* {{{ php_oci_collection_append()
Append wrapper. Appends any supported element to the end of the collection */
-int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len)
{
if (element_len == 0) {
- return php_oci_collection_append_null(collection TSRMLS_CC);
+ return php_oci_collection_append_null(collection);
}
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
- return php_oci_collection_append_date(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_date(collection, element, element_len);
break;
case OCI_TYPECODE_VARCHAR2 :
- return php_oci_collection_append_string(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_string(collection, element, element_len);
break;
case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */
@@ -458,11 +458,11 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
case OCI_TYPECODE_FLOAT : /* FLOAT */
case OCI_TYPECODE_NUMBER : /* NUMBER */
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
- return php_oci_collection_append_number(collection, element, element_len TSRMLS_CC);
+ return php_oci_collection_append_number(collection, element, element_len);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -473,7 +473,7 @@ int php_oci_collection_append(php_oci_collection *collection, char *element, int
/* {{{ php_oci_collection_element_get()
Get the element with the given index */
-int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC)
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element)
{
php_oci_connection *connection = collection->connection;
dvoid *element;
@@ -500,7 +500,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -520,7 +520,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, element, 0, 0, 0, 0, &buff_len, buff));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -562,7 +562,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
PHP_OCI_CALL_RETURN(errstatus, OCINumberToReal, (connection->err, (CONST OCINumber *) element, (uword) sizeof(double), (dvoid *) &double_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -573,7 +573,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -584,7 +584,7 @@ int php_oci_collection_element_get(php_oci_collection *collection, zend_long ind
/* {{{ php_oci_collection_element_set_null()
Set the element with the given index to NULL */
-int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC)
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index)
{
OCIInd null_index = OCI_IND_NULL;
php_oci_connection *connection = collection->connection;
@@ -594,7 +594,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon
PHP_OCI_CALL_RETURN(errstatus, OCICollAssignElem, (connection->env, connection->err, (ub4) index, (dvoid *)"", &null_index, collection->collection));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -605,7 +605,7 @@ int php_oci_collection_element_set_null(php_oci_collection *collection, zend_lon
/* {{{ php_oci_collection_element_set_date()
Change element's value to the given DATE */
-int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC)
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIDate oci_date;
@@ -617,7 +617,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
if (errstatus != OCI_SUCCESS) {
/* failed to convert string to date */
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -634,7 +634,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -646,7 +646,7 @@ int php_oci_collection_element_set_date(php_oci_collection *collection, zend_lon
/* {{{ php_oci_collection_element_set_number()
Change element's value to the given NUMBER */
-int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC)
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
double element_double;
@@ -659,7 +659,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
PHP_OCI_CALL_RETURN(errstatus, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -676,7 +676,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -688,7 +688,7 @@ int php_oci_collection_element_set_number(php_oci_collection *collection, zend_l
/* {{{ php_oci_collection_element_set_string()
Change element's value to the given string */
-int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC)
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len)
{
OCIInd new_index = OCI_IND_NOTNULL;
OCIString *ocistr = (OCIString *)0;
@@ -698,7 +698,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
PHP_OCI_CALL_RETURN(errstatus, OCIStringAssignText, (connection->env, connection->err, (CONST oratext *)element, element_len, &ocistr));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -715,7 +715,7 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -727,19 +727,19 @@ int php_oci_collection_element_set_string(php_oci_collection *collection, zend_l
/* {{{ php_oci_collection_element_set()
Collection element setter */
-int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC)
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len)
{
if (value_len == 0) {
- return php_oci_collection_element_set_null(collection, index TSRMLS_CC);
+ return php_oci_collection_element_set_null(collection, index);
}
switch(collection->element_typecode) {
case OCI_TYPECODE_DATE:
- return php_oci_collection_element_set_date(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_date(collection, index, value, value_len);
break;
case OCI_TYPECODE_VARCHAR2 :
- return php_oci_collection_element_set_string(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_string(collection, index, value, value_len);
break;
case OCI_TYPECODE_UNSIGNED16 : /* UNSIGNED SHORT */
@@ -753,11 +753,11 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind
case OCI_TYPECODE_FLOAT : /* FLOAT */
case OCI_TYPECODE_NUMBER : /* NUMBER */
case OCI_TYPECODE_SMALLINT : /* SMALLINT */
- return php_oci_collection_element_set_number(collection, index, value, value_len TSRMLS_CC);
+ return php_oci_collection_element_set_number(collection, index, value, value_len);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
+ php_error_docref(NULL, E_NOTICE, "Unknown or unsupported type of element: %d", collection->element_typecode);
return 1;
break;
}
@@ -768,7 +768,7 @@ int php_oci_collection_element_set(php_oci_collection *collection, zend_long ind
/* {{{ php_oci_collection_assign()
Assigns a value to the collection from another collection */
-int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC)
+int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from)
{
php_oci_connection *connection = collection_dest->connection;
sword errstatus;
@@ -776,7 +776,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
PHP_OCI_CALL_RETURN(errstatus, OCICollAssign, (connection->env, connection->err, collection_from->collection, collection_dest->collection));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -787,7 +787,7 @@ int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_colle
/* {{{ php_oci_collection_close()
Destroy collection and all associated resources */
-void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC)
+void php_oci_collection_close(php_oci_collection *collection)
{
php_oci_connection *connection = collection->connection;
sword errstatus;
@@ -796,7 +796,7 @@ void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIObjectFree, (connection->env, connection->err, (dvoid *)collection->collection, (ub2)OCI_OBJECTFREE_FORCE));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 6c73ad0a32..a8a5662855 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -56,12 +56,12 @@ PHP_FUNCTION(oci_define_by_name)
php_oci_statement *statement;
php_oci_define *define, *tmp_define;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
return;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Column name cannot be empty");
RETURN_FALSE;
}
@@ -106,7 +106,7 @@ PHP_FUNCTION(oci_bind_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
return;
}
@@ -116,7 +116,7 @@ PHP_FUNCTION(oci_bind_by_name)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type TSRMLS_CC)) {
+ if (php_oci_bind_by_name(statement, name, name_len, bind_var, maxlen, bind_type)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -136,7 +136,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
return;
}
@@ -147,11 +147,11 @@ PHP_FUNCTION(oci_bind_array_by_name)
}
if (max_array_len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum array length must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Maximum array length must be greater than zero");
RETURN_FALSE;
}
- if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type TSRMLS_CC)) {
+ if (php_oci_bind_array_by_name(statement, name, name_len, bind_var, max_array_len, max_item_len, type)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -166,13 +166,13 @@ PHP_FUNCTION(oci_free_descriptor)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -195,29 +195,29 @@ PHP_FUNCTION(oci_lob_save)
ub4 bytes_written;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &offset) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset parameter must be greater than or equal to 0");
RETURN_FALSE;
}
- if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written TSRMLS_CC)) {
+ if (php_oci_lob_write(descriptor, offset, data, data_len, &bytes_written)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -235,18 +235,18 @@ PHP_FUNCTION(oci_lob_import)
if (getThis()) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
#endif
return;
}
}
else {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
#endif
return;
}
@@ -255,19 +255,19 @@ PHP_FUNCTION(oci_lob_import)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* The "p" parsing parameter handles this case in PHP 5.4+ */
if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
RETURN_FALSE;
}
#endif
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) {
+ if (php_oci_lob_import(descriptor, filename)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -284,19 +284,19 @@ PHP_FUNCTION(oci_lob_load)
ub4 buffer_len;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
@@ -319,29 +319,29 @@ PHP_FUNCTION(oci_lob_read)
ub4 buffer_len;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
- if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, length, descriptor->lob_current_position, &buffer, &buffer_len)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
@@ -362,19 +362,19 @@ PHP_FUNCTION(oci_lob_eof)
ub4 lob_length;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) {
+ if (!php_oci_lob_get_length(descriptor, &lob_length) && lob_length >= 0) {
if (lob_length == descriptor->lob_current_position) {
RETURN_TRUE;
}
@@ -391,13 +391,13 @@ PHP_FUNCTION(oci_lob_tell)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -415,13 +415,13 @@ PHP_FUNCTION(oci_lob_rewind)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -443,24 +443,24 @@ PHP_FUNCTION(oci_lob_seek)
ub4 lob_length;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &offset, &whence) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
@@ -494,19 +494,19 @@ PHP_FUNCTION(oci_lob_size)
ub4 lob_length;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
RETURN_LONG(lob_length);
@@ -525,7 +525,7 @@ PHP_FUNCTION(oci_lob_write)
char *data;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &write_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &write_len) == FAILURE) {
return;
}
@@ -534,7 +534,7 @@ PHP_FUNCTION(oci_lob_write)
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
return;
}
@@ -544,7 +544,7 @@ PHP_FUNCTION(oci_lob_write)
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -554,7 +554,7 @@ PHP_FUNCTION(oci_lob_write)
RETURN_LONG(0);
}
- if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written TSRMLS_CC)) {
+ if (php_oci_lob_write(descriptor, descriptor->lob_current_position, data, data_len, &bytes_written)) {
RETURN_FALSE;
}
RETURN_LONG(bytes_written);
@@ -569,30 +569,30 @@ PHP_FUNCTION(oci_lob_append)
php_oci_descriptor *descriptor_dest, *descriptor_from;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
- if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) {
+ if (php_oci_lob_append(descriptor_dest, descriptor_from)) {
RETURN_FALSE;
}
/* XXX should we increase lob_size here ? */
@@ -610,30 +610,30 @@ PHP_FUNCTION(oci_lob_truncate)
ub4 ub_trim_length;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &trim_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &trim_length) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
if (trim_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to zero");
RETURN_FALSE;
}
ub_trim_length = (ub4) trim_length;
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_truncate(descriptor, ub_trim_length TSRMLS_CC)) {
+ if (php_oci_lob_truncate(descriptor, ub_trim_length)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -650,44 +650,44 @@ PHP_FUNCTION(oci_lob_erase)
zend_long offset = -1, length = -1;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &offset, &length) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 0 && offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 1 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
RETURN_FALSE;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 1 && offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
RETURN_FALSE;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) {
+ if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased)) {
RETURN_FALSE;
}
RETURN_LONG(bytes_erased);
@@ -703,18 +703,18 @@ PHP_FUNCTION(oci_lob_flush)
zend_long flush_flag = 0;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flush_flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flush_flag) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -725,7 +725,7 @@ PHP_FUNCTION(oci_lob_flush)
RETURN_FALSE;
}
- if (php_oci_lob_flush(descriptor, flush_flag TSRMLS_CC)) {
+ if (php_oci_lob_flush(descriptor, flush_flag)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -741,24 +741,24 @@ PHP_FUNCTION(ocisetbufferinglob)
zend_bool flag;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &flag) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) {
+ if (php_oci_lob_set_buffering(descriptor, flag)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -773,13 +773,13 @@ PHP_FUNCTION(ocigetbufferinglob)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
@@ -800,17 +800,17 @@ PHP_FUNCTION(oci_lob_copy)
php_oci_descriptor *descriptor_dest, *descriptor_from;
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO|l", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr, &length) == FAILURE) {
return;
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
@@ -818,7 +818,7 @@ PHP_FUNCTION(oci_lob_copy)
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (ZEND_NUM_ARGS() == 3 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -827,7 +827,7 @@ PHP_FUNCTION(oci_lob_copy)
length = -1;
}
- if (php_oci_lob_copy(descriptor_dest, descriptor_from, length TSRMLS_CC)) {
+ if (php_oci_lob_copy(descriptor_dest, descriptor_from, length)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -842,24 +842,24 @@ PHP_FUNCTION(oci_lob_is_equal)
php_oci_descriptor *descriptor_first, *descriptor_second;
boolean is_equal;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_first, oci_lob_class_entry_ptr, &z_descriptor_second, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
if ((tmp_first = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
if ((tmp_second = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first);
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second);
- if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) {
+ if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal)) {
RETURN_FALSE;
}
@@ -885,37 +885,37 @@ PHP_FUNCTION(oci_lob_export)
if (getThis()) {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
#endif
return;
}
if (ZEND_NUM_ARGS() > 1 && start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than or equal to 0");
RETURN_FALSE;
}
}
else {
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
#endif
return;
}
if (ZEND_NUM_ARGS() > 2 && start < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 3 && length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than or equal to 0");
RETURN_FALSE;
}
}
@@ -923,19 +923,19 @@ PHP_FUNCTION(oci_lob_export)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* The "p" parsing parameter handles this case in PHP 5.4+ */
if (strlen(filename) != filename_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot contain null bytes");
+ php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
RETURN_FALSE;
}
#endif
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
RETURN_FALSE;
}
@@ -959,7 +959,7 @@ PHP_FUNCTION(oci_lob_export)
}
#endif
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -976,7 +976,7 @@ PHP_FUNCTION(oci_lob_export)
while(length > 0) {
ub4 tmp_bytes_read = 0;
- if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read TSRMLS_CC)) {
+ if (php_oci_lob_read(descriptor, block_length, start, &buffer, &tmp_bytes_read)) {
php_stream_close(stream);
RETURN_FALSE;
}
@@ -1014,24 +1014,24 @@ PHP_FUNCTION(oci_lob_write_temporary)
zend_long type = OCI_TEMP_CLOB;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &type) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) {
+ if (php_oci_lob_write_tmp(descriptor, type, data, data_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1046,19 +1046,19 @@ PHP_FUNCTION(oci_lob_close)
php_oci_descriptor *descriptor;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
- if (php_oci_lob_close(descriptor TSRMLS_CC)) {
+ if (php_oci_lob_close(descriptor)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1074,14 +1074,14 @@ PHP_FUNCTION(oci_new_descriptor)
php_oci_descriptor *descriptor;
zend_long type = OCI_DTYPE_LOB;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_connection, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_connection, &type) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
/* php_oci_lob_create() checks type */
- descriptor = php_oci_lob_create(connection, type TSRMLS_CC);
+ descriptor = php_oci_lob_create(connection, type);
if (!descriptor) {
RETURN_NULL();
@@ -1099,17 +1099,17 @@ PHP_FUNCTION(oci_rollback)
zval *z_connection;
php_oci_connection *connection;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
- if (php_oci_connection_rollback(connection TSRMLS_CC)) {
+ if (php_oci_connection_rollback(connection)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1123,17 +1123,17 @@ PHP_FUNCTION(oci_commit)
zval *z_connection;
php_oci_connection *connection;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (connection->descriptors) {
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_oci_connection_descriptors_free(connection);
}
- if (php_oci_connection_commit(connection TSRMLS_CC)) {
+ if (php_oci_connection_commit(connection)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1321,13 +1321,13 @@ PHP_FUNCTION(oci_execute)
php_oci_statement *statement;
zend_long mode = OCI_COMMIT_ON_SUCCESS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &z_statement, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &z_statement, &mode) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_execute(statement, mode TSRMLS_CC)) {
+ if (php_oci_statement_execute(statement, mode)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1341,13 +1341,13 @@ PHP_FUNCTION(oci_cancel)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_cancel(statement TSRMLS_CC)) {
+ if (php_oci_statement_cancel(statement)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1362,13 +1362,13 @@ PHP_FUNCTION(oci_fetch)
php_oci_statement *statement;
ub4 nrows = 1; /* only one row at a time is supported for now */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1396,7 +1396,7 @@ PHP_FUNCTION(oci_fetch_all)
int i;
zend_long rows = 0, flags = 0, skip = 0, maxrows = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|lll", &z_statement, &array, &skip, &maxrows, &flags) == FAILURE) {
return;
}
@@ -1406,7 +1406,7 @@ PHP_FUNCTION(oci_fetch_all)
array_init(array);
while (skip--) {
- if (php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ if (php_oci_statement_fetch(statement, nrows)) {
RETURN_LONG(0);
}
}
@@ -1415,16 +1415,16 @@ PHP_FUNCTION(oci_fetch_all)
columns = safe_emalloc(statement->ncolumns, sizeof(php_oci_out_column *), 0);
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
}
- while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ while (!php_oci_statement_fetch(statement, nrows)) {
zval row;
array_init(&row);
for (i = 0; i < statement->ncolumns; i++) {
- php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS);
if (flags & PHP_OCI_NUM) {
zend_hash_next_index_insert(Z_ARRVAL(row), &element);
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(oci_fetch_all)
rows++;
if (maxrows != -1 && rows == maxrows) {
- php_oci_statement_cancel(statement TSRMLS_CC);
+ php_oci_statement_cancel(statement);
break;
}
}
@@ -1449,30 +1449,30 @@ PHP_FUNCTION(oci_fetch_all)
if (flags & PHP_OCI_NUM) {
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
array_init(&tmp);
outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp);
}
} else { /* default to ASSOC */
for (i = 0; i < statement->ncolumns; i++) {
- columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0);
array_init(&tmp);
outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &tmp);
}
}
- while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
+ while (!php_oci_statement_fetch(statement, nrows)) {
for (i = 0; i < statement->ncolumns; i++) {
- php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
+ php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS);
zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element);
}
rows++;
if (maxrows != -1 && rows == maxrows) {
- php_oci_statement_cancel(statement TSRMLS_CC);
+ php_oci_statement_cancel(statement);
break;
}
}
@@ -1528,7 +1528,7 @@ PHP_FUNCTION(oci_free_statement)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -1558,7 +1558,7 @@ PHP_FUNCTION(oci_close)
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
@@ -1608,30 +1608,30 @@ PHP_FUNCTION(oci_error)
ub2 error_offset = 0;
text *sqltext = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() > 0) {
- statement = (php_oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_statement);
if (statement) {
errh = statement->err;
errcode = statement->errcode;
- if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset TSRMLS_CC)) {
+ if (php_oci_fetch_sqltext_offset(statement, &sqltext, &error_offset)) {
RETURN_FALSE;
}
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_connection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_pconnection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
@@ -1648,11 +1648,11 @@ go_out:
}
if (!errh) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oci_error: unable to find error handle");
+ php_error_docref(NULL, E_WARNING, "Oci_error: unable to find error handle");
RETURN_FALSE;
}
- errcode = php_oci_fetch_errmsg(errh, &errbuf TSRMLS_CC);
+ errcode = php_oci_fetch_errmsg(errh, &errbuf);
if (errcode) {
array_init(return_value);
@@ -1675,7 +1675,7 @@ PHP_FUNCTION(oci_num_fields)
zval *z_statement;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
@@ -1695,13 +1695,13 @@ PHP_FUNCTION(oci_parse)
char *query;
size_t query_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &query, &query_len) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, query, query_len TSRMLS_CC);
+ statement = php_oci_statement_create(connection, query, query_len);
if (statement) {
RETURN_RES(statement->id);
@@ -1718,18 +1718,18 @@ PHP_FUNCTION(oci_set_prefetch)
php_oci_statement *statement;
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_statement, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &z_statement, &size) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
if (size < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of rows to be prefetched has to be greater than or equal to 0");
return;
}
- if (php_oci_statement_set_prefetch(statement, (ub4)size TSRMLS_CC)) {
+ if (php_oci_statement_set_prefetch(statement, (ub4)size)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1746,7 +1746,7 @@ PHP_FUNCTION(oci_set_client_identifier)
size_t client_id_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_id, &client_id_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &client_id, &client_id_len) == FAILURE) {
return;
}
@@ -1755,7 +1755,7 @@ PHP_FUNCTION(oci_set_client_identifier)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_id, (ub4) client_id_len, (ub4) OCI_ATTR_CLIENT_IDENTIFIER, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
@@ -1795,7 +1795,7 @@ PHP_FUNCTION(oci_set_edition)
char *edition;
size_t edition_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &edition, &edition_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &edition, &edition_len) == FAILURE) {
return;
}
@@ -1813,7 +1813,7 @@ PHP_FUNCTION(oci_set_edition)
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1830,7 +1830,7 @@ PHP_FUNCTION(oci_set_module_name)
size_t module_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &module, &module_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &module, &module_len) == FAILURE) {
return;
}
@@ -1839,13 +1839,13 @@ PHP_FUNCTION(oci_set_module_name)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) module, (ub4) module_len, (ub4) OCI_ATTR_MODULE, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1862,7 +1862,7 @@ PHP_FUNCTION(oci_set_action)
size_t action_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &action, &action_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &action, &action_len) == FAILURE) {
return;
}
@@ -1871,13 +1871,13 @@ PHP_FUNCTION(oci_set_action)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) action, (ub4) action_len, (ub4) OCI_ATTR_ACTION, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1894,7 +1894,7 @@ PHP_FUNCTION(oci_set_client_info)
size_t client_info_len;
sword errstatus;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &client_info, &client_info_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &client_info, &client_info_len) == FAILURE) {
return;
}
@@ -1903,13 +1903,13 @@ PHP_FUNCTION(oci_set_client_info)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) client_info, (ub4) client_info_len, (ub4) OCI_ATTR_CLIENT_INFO, connection->err));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1926,7 +1926,7 @@ PHP_FUNCTION(oci_set_db_operation)
char *dbop_name;
size_t dbop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &z_connection, &dbop_name, &dbop_name_len) == FAILURE) {
return;
}
@@ -1935,12 +1935,12 @@ PHP_FUNCTION(oci_set_db_operation)
PHP_OCI_CALL_RETURN(OCI_G(errcode), OCIAttrSet, ((dvoid *) connection->session, (ub4) OCI_HTYPE_SESSION, (dvoid *) dbop_name, (ub4) dbop_name_len, (ub4) OCI_ATTR_DBOP, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
- php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
+ php_oci_error(OCI_G(err), OCI_G(errcode));
RETURN_FALSE;
}
RETURN_TRUE;
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unsupported attribute type");
+ php_error_docref(NULL, E_NOTICE, "Unsupported attribute type");
RETURN_FALSE;
#endif
}
@@ -1959,47 +1959,47 @@ PHP_FUNCTION(oci_password_change)
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
/* Safe mode has been removed in PHP 5.4 */
if (PG(safe_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "is disabled in Safe Mode");
+ php_error_docref(NULL, E_WARNING, "is disabled in Safe Mode");
RETURN_FALSE;
}
#endif
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (!user_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ php_error_docref(NULL, E_WARNING, "username cannot be empty");
RETURN_FALSE;
}
if (!pass_old_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "old password cannot be empty");
RETURN_FALSE;
}
if (!pass_new_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "new password cannot be empty");
RETURN_FALSE;
}
- if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len TSRMLS_CC)) {
+ if (php_oci_password_change(connection, user, user_len, pass_old, pass_old_len, pass_new, pass_new_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ssss", &dbname, &dbname_len, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
if (!user_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "username cannot be empty");
+ php_error_docref(NULL, E_WARNING, "username cannot be empty");
RETURN_FALSE;
}
if (!pass_old_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "old password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "old password cannot be empty");
RETURN_FALSE;
}
if (!pass_new_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "new password cannot be empty");
+ php_error_docref(NULL, E_WARNING, "new password cannot be empty");
RETURN_FALSE;
}
- connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 0 TSRMLS_CC);
+ connection = php_oci_do_connect_ex(user, user_len, pass_old, pass_old_len, pass_new, pass_new_len, dbname, dbname_len, NULL, OCI_DEFAULT, 0, 0);
if (!connection) {
RETURN_FALSE;
}
@@ -2017,13 +2017,13 @@ PHP_FUNCTION(oci_new_cursor)
php_oci_connection *connection;
php_oci_statement *statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);
+ statement = php_oci_statement_create(connection, NULL, 0);
if (statement) {
RETURN_RES(statement->id);
@@ -2040,7 +2040,7 @@ PHP_FUNCTION(oci_result)
column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
if(column) {
- php_oci_column_to_zval(column, return_value, 0 TSRMLS_CC);
+ php_oci_column_to_zval(column, return_value, 0);
}
else {
RETURN_FALSE;
@@ -2054,7 +2054,7 @@ PHP_FUNCTION(oci_client_version)
{
char *version = NULL;
- php_oci_client_get_version(&version TSRMLS_CC);
+ php_oci_client_get_version(&version);
RETURN_STRING(version);
}
/* }}} */
@@ -2067,13 +2067,13 @@ PHP_FUNCTION(oci_server_version)
php_oci_connection *connection;
char *version = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_connection) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_connection) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- if (php_oci_server_get_version(connection, &version TSRMLS_CC)) {
+ if (php_oci_server_get_version(connection, &version)) {
RETURN_FALSE;
}
@@ -2089,13 +2089,13 @@ PHP_FUNCTION(oci_statement_type)
php_oci_statement *statement;
ub2 type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_get_type(statement, &type TSRMLS_CC)) {
+ if (php_oci_statement_get_type(statement, &type)) {
RETURN_FALSE;
}
@@ -2144,13 +2144,13 @@ PHP_FUNCTION(oci_num_rows)
php_oci_statement *statement;
ub4 rowcount;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- if (php_oci_statement_get_numrows(statement, &rowcount TSRMLS_CC)) {
+ if (php_oci_statement_get_numrows(statement, &rowcount)) {
RETURN_FALSE;
}
RETURN_LONG(rowcount);
@@ -2165,13 +2165,13 @@ PHP_FUNCTION(oci_free_collection)
php_oci_collection *collection;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
@@ -2192,24 +2192,24 @@ PHP_FUNCTION(oci_collection_append)
size_t value_len;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) {
+ if (php_oci_collection_append(collection, value, value_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2226,24 +2226,24 @@ PHP_FUNCTION(oci_collection_element_get)
zval value;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &element_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &element_index) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) {
+ if (php_oci_collection_element_get(collection, element_index, &value)) {
RETURN_FALSE;
}
@@ -2259,30 +2259,30 @@ PHP_FUNCTION(oci_collection_assign)
php_oci_collection *collection_dest, *collection_from;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
RETURN_FALSE;
}
if ((tmp_from = zend_hash_str_find(Z_OBJPROP_P(z_collection_from), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest);
PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from);
- if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) {
+ if (php_oci_collection_assign(collection_dest, collection_from)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2300,24 +2300,24 @@ PHP_FUNCTION(oci_collection_element_assign)
char *value;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element_index, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element_index, &value, &value_len) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) {
+ if (php_oci_collection_element_set(collection, element_index, value, value_len)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2333,19 +2333,19 @@ PHP_FUNCTION(oci_collection_size)
sb4 size = 0;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_size(collection, &size TSRMLS_CC)) {
+ if (php_oci_collection_size(collection, &size)) {
RETURN_FALSE;
}
RETURN_LONG(size);
@@ -2361,19 +2361,19 @@ PHP_FUNCTION(oci_collection_max)
zend_long max;
if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_max(collection, &max TSRMLS_CC)) {
+ if (php_oci_collection_max(collection, &max)) {
RETURN_FALSE;
}
RETURN_LONG(max);
@@ -2389,24 +2389,24 @@ PHP_FUNCTION(oci_collection_trim)
zend_long trim_size;
if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &trim_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &trim_size) == FAILURE) {
return;
}
}
else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
return;
}
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
- if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) {
+ if (php_oci_collection_trim(collection, trim_size)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2423,13 +2423,13 @@ PHP_FUNCTION(oci_new_collection)
char *tdo, *schema = NULL;
size_t tdo_len, schema_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s", &z_connection, &tdo, &tdo_len, &schema, &schema_len) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
- if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len TSRMLS_CC)) ) {
+ if ( (collection = php_oci_collection_create(connection, tdo, tdo_len, schema, schema_len)) ) {
object_init_ex(return_value, oci_coll_class_entry_ptr);
add_property_resource(return_value, "collection", collection->id);
}
@@ -2447,16 +2447,16 @@ PHP_FUNCTION(oci_get_implicit_resultset)
php_oci_statement *statement;
php_oci_statement *imp_statement;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_statement) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &z_statement) == FAILURE) {
return;
}
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
- imp_statement = php_oci_get_implicit_resultset(statement TSRMLS_CC);
+ imp_statement = php_oci_get_implicit_resultset(statement);
if (imp_statement) {
- if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT TSRMLS_CC))
+ if (php_oci_statement_execute(imp_statement, (ub4)OCI_DEFAULT))
RETURN_FALSE;
RETURN_RES(imp_statement->id);
}
diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c
index 12986a8d3a..11e8a27ab5 100644
--- a/ext/oci8/oci8_lob.c
+++ b/ext/oci8/oci8_lob.c
@@ -51,7 +51,7 @@
/* {{{ php_oci_lob_create()
Create LOB descriptor and allocate all the resources needed */
-php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type TSRMLS_DC)
+php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_long type)
{
php_oci_descriptor *descriptor;
sword errstatus;
@@ -63,7 +63,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
/* these three are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unknown descriptor type %pd", type);
return NULL;
break;
}
@@ -76,7 +76,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0));
if (errstatus != OCI_SUCCESS) {
- OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus TSRMLS_CC);
+ OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
PHP_OCI_HANDLE_ERROR(connection, OCI_G(errcode));
efree(descriptor);
return NULL;
@@ -104,8 +104,8 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
descriptor->index = (connection->descriptor_count)++;
if (connection->descriptor_count == LONG_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal descriptor counter has reached limit");
- php_oci_connection_descriptors_free(connection TSRMLS_CC);
+ php_error_docref(NULL, E_WARNING, "Internal descriptor counter has reached limit");
+ php_oci_connection_descriptors_free(connection);
return NULL;
}
@@ -118,7 +118,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon
/* {{{ php_oci_lob_get_length()
Get length of the LOB. The length is cached so we don't need to ask Oracle every time */
-int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC)
+int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -132,7 +132,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
if (descriptor->type == OCI_DTYPE_FILE) {
PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -141,7 +141,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
PHP_OCI_CALL_RETURN(errstatus, OCILobGetLength, (connection->svc, connection->err, descriptor->descriptor, (ub4 *)length));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -152,7 +152,7 @@ int php_oci_lob_get_length (php_oci_descriptor *descriptor, ub4 *length TSRMLS_D
PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -198,8 +198,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece
return OCI_CONTINUE;
default: {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece);
+ php_error_docref(NULL, E_WARNING, "Unexpected LOB piece id received (value:%d)", piece);
*(ctx->lob_data) = NULL;
*(ctx->lob_len) = 0;
return OCI_ERROR;
@@ -210,7 +209,7 @@ sb4 php_oci_lob_callback (dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece
/* {{{ php_oci_lob_calculate_buffer()
Work out the size for LOB buffering */
-static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length TSRMLS_DC)
+static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, zend_long read_length)
{
php_oci_connection *connection = descriptor->connection;
ub4 chunk_size;
@@ -224,7 +223,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, z
PHP_OCI_CALL_RETURN(errstatus, OCILobGetChunkSize, (connection->svc, connection->err, descriptor->descriptor, &chunk_size));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return read_length; /* we have to return original length here */
}
@@ -241,7 +240,7 @@ static inline int php_oci_lob_calculate_buffer(php_oci_descriptor *descriptor, z
/* {{{ php_oci_lob_read()
Read specified portion of the LOB into the buffer */
-int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len TSRMLS_DC)
+int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zend_long initial_offset, char **data, ub4 *data_len)
{
php_oci_connection *connection = descriptor->connection;
ub4 length = 0;
@@ -262,7 +261,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
ctx.lob_data = data;
ctx.alloc_len = 0;
- if (php_oci_lob_get_length(descriptor, &length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &length)) {
return 1;
}
@@ -271,7 +270,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
if (initial_offset > length) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset must be less than size of the LOB");
+ php_error_docref(NULL, E_WARNING, "Offset must be less than size of the LOB");
return 1;
}
@@ -293,7 +292,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobFileOpen, (connection->svc, connection->err, descriptor->descriptor, OCI_FILE_READONLY));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -303,7 +302,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobCharSetId, (connection->env, connection->err, descriptor->descriptor, &charset_id));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -317,7 +316,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -337,7 +336,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
buffer_size = (requested_len < buffer_size ) ? requested_len : buffer_size; /* optimize buffer size */
- buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size TSRMLS_CC); /* use chunk size */
+ buffer_size = php_oci_lob_calculate_buffer(descriptor, buffer_size); /* use chunk size */
bufp = (ub1 *) ecalloc(1, buffer_size);
PHP_OCI_CALL_RETURN(errstatus, OCILobRead2,
@@ -367,7 +366,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
}
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (*data) {
efree(*data);
@@ -383,7 +382,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
PHP_OCI_CALL_RETURN(errstatus, OCILobFileClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
if (*data) {
efree(*data);
@@ -401,7 +400,7 @@ int php_oci_lob_read (php_oci_descriptor *descriptor, zend_long read_length, zen
/* {{{ php_oci_lob_write()
Write data to the LOB */
-int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC)
+int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written)
{
OCILobLocator *lob = (OCILobLocator *) descriptor->descriptor;
php_oci_connection *connection = (php_oci_connection *) descriptor->connection;
@@ -409,7 +408,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
sword errstatus;
*bytes_written = 0;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -443,7 +442,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
);
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
*bytes_written = 0;
return 1;
@@ -467,7 +466,7 @@ int php_oci_lob_write (php_oci_descriptor *descriptor, ub4 offset, char *data, i
/* {{{ php_oci_lob_set_buffering()
Turn buffering off/onn for this particular LOB */
-int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS_DC)
+int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -489,7 +488,7 @@ int php_oci_lob_set_buffering (php_oci_descriptor *descriptor, int on_off TSRMLS
}
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -513,17 +512,17 @@ int php_oci_lob_get_buffering (php_oci_descriptor *descriptor)
/* {{{ php_oci_lob_copy()
Copy one LOB (or its part) to another one */
-int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC)
+int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from, zend_long length)
{
php_oci_connection *connection = descriptor_dest->connection;
ub4 length_dest, length_from, copy_len;
sword errstatus;
- if (php_oci_lob_get_length(descriptor_dest, &length_dest TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_dest, &length_dest)) {
return 1;
}
- if (php_oci_lob_get_length(descriptor_from, &length_from TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_from, &length_from)) {
return 1;
}
@@ -551,7 +550,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -563,7 +562,7 @@ int php_oci_lob_copy (php_oci_descriptor *descriptor_dest, php_oci_descriptor *d
/* {{{ php_oci_lob_close()
Close LOB */
-int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_lob_close (php_oci_descriptor *descriptor)
{
php_oci_connection *connection = descriptor->connection;
sword errstatus;
@@ -572,14 +571,14 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobClose, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
}
- if (php_oci_temp_lob_close(descriptor TSRMLS_CC)) {
+ if (php_oci_temp_lob_close(descriptor)) {
return 1;
}
@@ -589,7 +588,7 @@ int php_oci_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_temp_lob_close()
Close Temporary LOB */
-int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
+int php_oci_temp_lob_close (php_oci_descriptor *descriptor)
{
php_oci_connection *connection = descriptor->connection;
int is_temporary;
@@ -598,7 +597,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobIsTemporary, (connection->env,connection->err, descriptor->descriptor, &is_temporary));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -607,7 +606,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCILobFreeTemporary, (connection->svc, connection->err, descriptor->descriptor));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -619,7 +618,7 @@ int php_oci_temp_lob_close (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_lob_flush()
Flush buffers for the LOB (only if they have been used) */
-int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC)
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag)
{
OCILobLocator *lob = descriptor->descriptor;
php_oci_connection *connection = descriptor->connection;
@@ -635,7 +634,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flag value: %pd", flush_flag);
+ php_error_docref(NULL, E_WARNING, "Invalid flag value: %pd", flush_flag);
return 1;
break;
}
@@ -650,7 +649,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
PHP_OCI_CALL_RETURN(errstatus, OCILobFlushBuffer, (connection->svc, connection->err, lob, flush_flag));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -664,7 +663,7 @@ int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRML
/* {{{ php_oci_lob_free()
Close LOB descriptor and free associated resources */
-void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
+void php_oci_lob_free (php_oci_descriptor *descriptor)
{
if (!descriptor || !descriptor->connection) {
return;
@@ -695,11 +694,11 @@ void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
/* flushing Lobs & Files with buffering enabled */
if ((descriptor->type == OCI_DTYPE_FILE || descriptor->type == OCI_DTYPE_LOB) && descriptor->buffering == PHP_OCI_LOB_BUFFER_USED) {
- php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE TSRMLS_CC);
+ php_oci_lob_flush(descriptor, OCI_LOB_BUFFER_FREE);
}
if (descriptor->type == OCI_DTYPE_LOB) {
- php_oci_temp_lob_close(descriptor TSRMLS_CC);
+ php_oci_temp_lob_close(descriptor);
}
PHP_OCI_CALL(OCIDescriptorFree, (descriptor->descriptor, descriptor->type));
@@ -711,7 +710,7 @@ void php_oci_lob_free (php_oci_descriptor *descriptor TSRMLS_DC)
/* {{{ php_oci_lob_import()
Import LOB contents from the given file */
-int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC)
+int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename)
{
int fp;
ub4 loblen;
@@ -723,15 +722,15 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
/* Safe mode has been removed in PHP 5.4 */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
#else
- if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) {
+ if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)) {
#endif
return 1;
}
if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open file %s", filename);
+ php_error_docref(NULL, E_WARNING, "Can't open file %s", filename);
return 1;
}
@@ -755,7 +754,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
close(fp);
return 1;
@@ -772,7 +771,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename TSRMLS_DC
/* {{{ php_oci_lob_append()
Append data to the end of the LOB */
-int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC)
+int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from)
{
php_oci_connection *connection = descriptor_dest->connection;
OCILobLocator *lob_dest = descriptor_dest->descriptor;
@@ -780,11 +779,11 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
ub4 dest_len, from_len;
sword errstatus;
- if (php_oci_lob_get_length(descriptor_dest, &dest_len TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_dest, &dest_len)) {
return 1;
}
- if (php_oci_lob_get_length(descriptor_from, &from_len TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor_from, &from_len)) {
return 1;
}
@@ -795,7 +794,7 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
PHP_OCI_CALL_RETURN(errstatus, OCILobAppend, (connection->svc, connection->err, lob_dest, lob_from));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -806,14 +805,14 @@ int php_oci_lob_append (php_oci_descriptor *descriptor_dest, php_oci_descriptor
/* {{{ php_oci_lob_truncate()
Truncate LOB to the given length */
-int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC)
+int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_length)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
ub4 lob_length;
sword errstatus;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -822,19 +821,19 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng
}
if (new_lob_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Size must be greater than or equal to 0");
return 1;
}
if (new_lob_length > lob_length) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size must be less than or equal to the current LOB size");
+ php_error_docref(NULL, E_WARNING, "Size must be less than or equal to the current LOB size");
return 1;
}
PHP_OCI_CALL_RETURN(errstatus, OCILobTrim, (connection->svc, connection->err, lob, new_lob_length));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -848,7 +847,7 @@ int php_oci_lob_truncate (php_oci_descriptor *descriptor, zend_long new_lob_leng
/* {{{ php_oci_lob_erase()
Erase (or fill with whitespaces, depending on LOB type) the LOB (or its part) */
-int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC)
+int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -857,7 +856,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
*bytes_erased = 0;
- if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
+ if (php_oci_lob_get_length(descriptor, &lob_length)) {
return 1;
}
@@ -872,7 +871,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
PHP_OCI_CALL_RETURN(errstatus, OCILobErase, (connection->svc, connection->err, lob, (ub4 *)&length, offset+1));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -885,7 +884,7 @@ int php_oci_lob_erase (php_oci_descriptor *descriptor, zend_long offset, ub4 len
/* {{{ php_oci_lob_is_equal()
Compare two LOB descriptors and figure out if they are pointing to the same LOB */
-int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC)
+int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result)
{
php_oci_connection *connection = descriptor_first->connection;
OCILobLocator *first_lob = descriptor_first->descriptor;
@@ -895,7 +894,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
PHP_OCI_CALL_RETURN(errstatus, OCILobIsEqual, (connection->env, first_lob, second_lob, result));
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -906,7 +905,7 @@ int php_oci_lob_is_equal (php_oci_descriptor *descriptor_first, php_oci_descript
/* {{{ php_oci_lob_write_tmp()
Create temporary LOB and write data to it */
-int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC)
+int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char *data, int data_len)
{
php_oci_connection *connection = descriptor->connection;
OCILobLocator *lob = descriptor->descriptor;
@@ -919,7 +918,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
/* only these two are allowed */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid temporary lob type: %pd", type);
+ php_error_docref(NULL, E_WARNING, "Invalid temporary lob type: %pd", type);
return 1;
break;
}
@@ -942,7 +941,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
);
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -950,7 +949,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
PHP_OCI_CALL_RETURN(errstatus, OCILobOpen, (connection->svc, connection->err, lob, OCI_LOB_READWRITE));
if (errstatus) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return 1;
}
@@ -958,7 +957,7 @@ int php_oci_lob_write_tmp (php_oci_descriptor *descriptor, zend_long type, char
descriptor->is_open = 1;
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
- return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written TSRMLS_CC);
+ return php_oci_lob_write(descriptor, 0, data, data_len, &bytes_written);
}
/* }}} */
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 7dc0d5ee66..f651925170 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -43,7 +43,7 @@
/* {{{ php_oci_statement_create()
Create statemend handle and allocate necessary resources */
-php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC)
+php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len)
{
php_oci_statement *statement;
sword errstatus;
@@ -80,7 +80,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
#endif /* HAVE_OCI8_DTRACE */
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_CALL(OCIStmtRelease, (statement->stmt, statement->err, NULL, 0, OCI_STRLS_CACHE_DELETE));
PHP_OCI_CALL(OCIHandleFree,(statement->err, OCI_HTYPE_ERROR));
@@ -109,9 +109,9 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
++GC_REFCOUNT(statement->connection->id);
if (OCI_G(default_prefetch) >= 0) {
- php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC);
+ php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch));
} else {
- php_oci_statement_set_prefetch(statement, (ub4)100 TSRMLS_CC); /* semi-arbitrary, "sensible default" */
+ php_oci_statement_set_prefetch(statement, (ub4)100); /* semi-arbitrary, "sensible default" */
}
PHP_OCI_REGISTER_RESOURCE(statement, le_statement);
@@ -124,10 +124,10 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char
/* {{{ php_oci_get_implicit_resultset()
Fetch implicit result set statement resource */
-php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC)
+php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement)
{
#if (OCI_MAJOR_VERSION < 12)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Implicit results are available in Oracle Database 12c onwards");
+ php_error_docref(NULL, E_WARNING, "Implicit results are available in Oracle Database 12c onwards");
return NULL;
#else
void *result;
@@ -142,7 +142,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
if (rtype != OCI_RESULT_TYPE_SELECT) {
/* Only OCI_RESULT_TYPE_SELECT is supported by Oracle DB 12cR1 */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected implicit result type returned from Oracle Database");
+ php_error_docref(NULL, E_WARNING, "Unexpected implicit result type returned from Oracle Database");
return NULL;
} else {
statement2 = ecalloc(1,sizeof(php_oci_statement));
@@ -169,7 +169,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
Z_ADDREF_P(statement->id);
Z_ADDREF_P(statement2->connection->id);
- php_oci_statement_set_prefetch(statement2, statement->prefetch_count TSRMLS_CC);
+ php_oci_statement_set_prefetch(statement2, statement->prefetch_count);
PHP_OCI_REGISTER_RESOURCE(statement2, le_statement);
@@ -183,7 +183,7 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement T
/* {{{ php_oci_statement_set_prefetch()
Set prefetch buffer size for the statement */
-int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC)
+int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch )
{
sword errstatus;
@@ -194,7 +194,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (statement->stmt, OCI_HTYPE_STMT, &prefetch, 0, OCI_ATTR_PREFETCH_ROWS, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
statement->prefetch_count = 0;
return 1;
@@ -207,7 +207,7 @@ int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch T
/* {{{ php_oci_cleanup_pre_fetch()
Helper function to cleanup ref-cursors and descriptors from the previous row */
-int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC)
+int php_oci_cleanup_pre_fetch(void *data)
{
php_oci_out_column *outcol = data;
@@ -241,7 +241,7 @@ int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC)
/* {{{ php_oci_statement_fetch()
Fetch a row from the statement */
-int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
+int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
{
int i;
void *handlepp;
@@ -254,7 +254,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
if (statement->has_descr && statement->columns) {
- zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch TSRMLS_CC);
+ zend_hash_apply(statement->columns, (apply_func_t) php_oci_cleanup_pre_fetch);
}
PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, OCI_DEFAULT));
@@ -282,7 +282,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* reset length for all piecewise columns */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise) {
column->retlen4 = 0;
piecewisecols = 1;
@@ -307,7 +307,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* scan through our columns for a piecewise column with a matching handle */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise && handlepp == column->oci_define) {
if (!column->data) {
column->data = (text *) ecalloc(1, PHP_OCI_PIECE_SIZE + 1);
@@ -337,7 +337,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
if (piecewisecols) {
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column && column->piecewise && handlepp == column->oci_define) {
column->retlen4 += column->cb_retlen;
}
@@ -350,7 +350,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* do the stuff needed for OCIDefineByName */
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
}
@@ -360,13 +360,13 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
}
zval_dtor(&column->define->zval);
- php_oci_column_to_zval(column, &column->define->zval, 0 TSRMLS_CC);
+ php_oci_column_to_zval(column, &column->define->zval, 0);
}
return 0;
}
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
statement->has_data = 0;
@@ -377,7 +377,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC)
/* {{{ php_oci_statement_get_column()
Get column from the result set */
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC)
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len)
{
php_oci_out_column *column = NULL;
int i;
@@ -388,7 +388,7 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z
if (column_name) {
for (i = 0; i < statement->ncolumns; i++) {
- column = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, i + 1, NULL, 0);
if (column == NULL) {
continue;
} else if (((int) column->name_len == column_name_len) && (!strncmp(column->name, column_name, column_name_len))) {
@@ -410,11 +410,10 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, z
sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp)
{
php_oci_out_column *outcol = (php_oci_out_column *)ctx;
- TSRMLS_FETCH();
if (!outcol) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid context pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid context pointer value");
return OCI_ERROR;
}
@@ -422,7 +421,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
case SQLT_RSET: {
php_oci_statement *nested_stmt;
- nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0 TSRMLS_CC);
+ nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0);
if (!nested_stmt) {
return OCI_ERROR;
}
@@ -454,7 +453,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
dtype = OCI_DTYPE_LOB;
}
- descr = php_oci_lob_create(outcol->statement->connection, dtype TSRMLS_CC);
+ descr = php_oci_lob_create(outcol->statement->connection, dtype);
if (!descr) {
return OCI_ERROR;
}
@@ -477,7 +476,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
/* {{{ php_oci_statement_execute()
Execute statement */
-int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
+int php_oci_statement_execute(php_oci_statement *statement, ub4 mode)
{
php_oci_out_column *outcol;
php_oci_out_column column;
@@ -503,7 +502,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
#endif /* HAVE_OCI8_DTRACE */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid execute mode given: %d", mode);
+ php_error_docref(NULL, E_WARNING, "Invalid execute mode given: %d", mode);
return 1;
break;
}
@@ -513,7 +512,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement->stmttype, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
} else {
@@ -531,7 +530,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (statement->binds) {
int result = 0;
- zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result TSRMLS_CC);
+ zend_hash_apply_with_argument(statement->binds, (apply_func_arg_t) php_oci_bind_pre_exec, (void *)&result);
if (result) {
return 1;
}
@@ -541,13 +540,13 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIStmtExecute, (statement->connection->svc, statement->stmt, statement->err, iters, 0, NULL, NULL, mode));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
if (statement->binds) {
- zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec TSRMLS_CC);
+ zend_hash_apply(statement->binds, (apply_func_t) php_oci_bind_post_exec);
}
if (mode & OCI_COMMIT_ON_SUCCESS) {
@@ -580,7 +579,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *)&colcount, (ub4 *)0, OCI_ATTR_PARAM_COUNT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -600,7 +599,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
PHP_OCI_CALL_RETURN(errstatus, OCIParamGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, statement->err, (dvoid**)&param, counter));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -610,7 +609,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -620,7 +619,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -630,7 +629,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -640,7 +639,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -653,7 +652,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -663,7 +662,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -673,7 +672,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
if (errstatus != OCI_SUCCESS) {
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -808,7 +807,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
}
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -831,7 +830,7 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -847,15 +846,15 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
/* {{{ php_oci_statement_cancel()
Cancel statement */
-int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC)
+int php_oci_statement_cancel(php_oci_statement *statement)
{
- return php_oci_statement_fetch(statement, 0 TSRMLS_CC);
+ return php_oci_statement_fetch(statement, 0);
}
/* }}} */
/* {{{ php_oci_statement_free()
Destroy statement handle and free associated resources */
-void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
+void php_oci_statement_free(php_oci_statement *statement)
{
if (statement->stmt) {
if (statement->last_query_len) { /* FIXME: magical */
@@ -903,7 +902,7 @@ void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC)
/* {{{ php_oci_bind_pre_exec()
Helper function */
-int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
+int php_oci_bind_pre_exec(void *data, void *result)
{
php_oci_bind *bind = (php_oci_bind *) data;
@@ -924,7 +923,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE(bind->zval) != IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
@@ -940,14 +939,14 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
case SQLT_BIN:
case SQLT_LNG:
if (Z_TYPE(bind->zval) == IS_RESOURCE || Z_TYPE(bind->zval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
if (Z_TYPE(bind->zval) != IS_RESOURCE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
@@ -962,7 +961,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC)
/* {{{ php_oci_bind_post_exec()
Helper function */
-int php_oci_bind_post_exec(void *data TSRMLS_DC)
+int php_oci_bind_post_exec(void *data)
{
php_oci_bind *bind = (php_oci_bind *) data;
php_oci_connection *connection = bind->parent_statement->connection;
@@ -1030,7 +1029,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
zval_dtor(entry);
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
ZVAL_NULL(entry);
} else {
@@ -1041,7 +1040,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
} else {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
if (errstatus != OCI_SUCCESS) {
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(&bind->zval);
} else {
@@ -1079,7 +1078,7 @@ int php_oci_bind_post_exec(void *data TSRMLS_DC)
/* {{{ php_oci_bind_by_name()
Bind zval to the given placeholder */
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC)
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type)
{
php_oci_collection *bind_collection = NULL;
php_oci_descriptor *bind_descriptor = NULL;
@@ -1099,7 +1098,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
+ php_error_docref(NULL, E_WARNING, "Unable to find collection property");
return 1;
}
@@ -1121,7 +1120,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
return 1;
}
@@ -1140,7 +1139,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_INT:
case SQLT_NUM:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_long(var);
@@ -1155,7 +1154,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_AFC:
case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
if (Z_TYPE_P(var) != IS_NULL) {
@@ -1170,7 +1169,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
case SQLT_RSET:
if (Z_TYPE_P(var) != IS_RESOURCE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
PHP_OCI_ZVAL_TO_STATEMENT_EX(var, bind_statement);
@@ -1186,7 +1185,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12
case SQLT_BOL:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
+ php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_boolean(var);
@@ -1198,7 +1197,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type);
+ php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type);
return 1;
break;
}
@@ -1248,7 +1247,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1266,7 +1265,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1287,7 +1286,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len,
);
if (errstatus) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1312,10 +1311,9 @@ sb4 php_oci_bind_in_callback(
{
php_oci_bind *phpbind;
zval *val;
- TSRMLS_FETCH();
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = &phpbind->zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
@@ -1366,10 +1364,9 @@ sb4 php_oci_bind_out_callback(
php_oci_bind *phpbind;
zval *val;
sb4 retval = OCI_ERROR;
- TSRMLS_FETCH();
if (!(phpbind=(php_oci_bind *)octxp) || !(val = &phpbind->zval)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid phpbind pointer value");
+ php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
@@ -1396,7 +1393,7 @@ sb4 php_oci_bind_out_callback(
* binds (Bug #46994).
*/
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property");
+ php_error_docref(NULL, E_WARNING, "Unable to find object outbind descriptor property");
return OCI_ERROR;
}
PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc);
@@ -1438,11 +1435,11 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
php_oci_statement *statement;
php_oci_out_column *column;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_statement, &column_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &z_statement, &column_index) == FAILURE) {
return NULL;
}
- statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(z_statement, -1, "oci8 statement", NULL, 1, le_statement);
if (!statement) {
return NULL;
@@ -1453,9 +1450,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
}
if (Z_TYPE_P(column_index) == IS_STRING) {
- column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index));
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
+ php_error_docref(NULL, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
return NULL;
}
} else {
@@ -1464,9 +1461,9 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
tmp = *column_index;
zval_copy_ctor(&tmp);
convert_to_long(&tmp);
- column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC);
+ column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
if (!column) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid column index \"%pd\"", Z_LVAL(tmp));
zval_dtor(&tmp);
return NULL;
}
@@ -1478,7 +1475,7 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
/* {{{ php_oci_statement_get_type()
Return type of the statement */
-int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC)
+int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type)
{
ub2 statement_type;
sword errstatus;
@@ -1488,7 +1485,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub2 *)&statement_type, (ub4 *)0, OCI_ATTR_STMT_TYPE, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1501,7 +1498,7 @@ int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC
/* {{{ php_oci_statement_get_numrows()
Get the number of rows fetched to the clientside (NOT the number of rows in the result set) */
-int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC)
+int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
{
ub4 statement_numrows;
sword errstatus;
@@ -1511,7 +1508,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
PHP_OCI_CALL_RETURN(errstatus, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (ub4 *)&statement_numrows, (ub4 *)0, OCI_ATTR_ROW_COUNT, statement->err));
if (errstatus != OCI_SUCCESS) {
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1524,7 +1521,7 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSR
/* {{{ php_oci_bind_array_by_name()
Bind arrays to PL/SQL types */
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC)
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
{
php_oci_bind *bind, *bindp;
sword errstatus;
@@ -1532,7 +1529,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
convert_to_array(var);
if (maxlength < -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid max length value (%pd)", maxlength);
+ php_error_docref(NULL, E_WARNING, "Invalid max length value (%pd)", maxlength);
return 1;
}
@@ -1540,11 +1537,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
case SQLT_NUM:
case SQLT_INT:
case SQLT_LNG:
- bind = php_oci_bind_array_helper_number(var, max_table_length TSRMLS_CC);
+ bind = php_oci_bind_array_helper_number(var, max_table_length);
break;
case SQLT_FLT:
- bind = php_oci_bind_array_helper_double(var, max_table_length TSRMLS_CC);
+ bind = php_oci_bind_array_helper_double(var, max_table_length);
break;
case SQLT_AFC:
@@ -1554,16 +1551,16 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
case SQLT_STR:
case SQLT_LVC:
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must provide max length value for empty arrays");
+ php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
return 1;
}
- bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength TSRMLS_CC);
+ bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
break;
case SQLT_ODT:
- bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC);
+ bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
+ php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: %pd", type);
return 1;
break;
}
@@ -1614,7 +1611,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
if (errstatus != OCI_SUCCESS) {
efree(bind);
- statement->errcode = php_oci_error(statement->err, errstatus TSRMLS_CC);
+ statement->errcode = php_oci_error(statement->err, errstatus);
PHP_OCI_HANDLE_ERROR(statement->connection, statement->errcode);
return 1;
}
@@ -1626,7 +1623,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int nam
/* {{{ php_oci_bind_array_helper_string()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength)
{
php_oci_bind *bind;
ub4 i;
@@ -1696,7 +1693,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_number()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length)
{
php_oci_bind *bind;
ub4 i;
@@ -1735,7 +1732,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_double()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length)
{
php_oci_bind *bind;
ub4 i;
@@ -1774,7 +1771,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
/* {{{ php_oci_bind_array_helper_date()
Bind arrays to PL/SQL types */
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC)
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection)
{
php_oci_bind *bind;
ub4 i;
@@ -1809,7 +1806,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return NULL;
}
@@ -1824,7 +1821,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
efree(bind->array.element_lengths);
efree(bind->array.elements);
efree(bind);
- connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
+ connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
return NULL;
}
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 852fe986f3..e5ba737715 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -374,7 +374,7 @@ typedef struct {
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
do { \
- var = (type) zend_fetch_resource(zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
+ var = (type) zend_fetch_resource(zval, -1, name, NULL, 1, resource_type); \
if (!var) { \
return 1; \
} \
@@ -402,93 +402,93 @@ void php_oci_column_hash_dtor(void *data);
void php_oci_define_hash_dtor(void *data);
void php_oci_bind_hash_dtor(void *data);
void php_oci_descriptor_flush_hash_dtor(void *data);
-void php_oci_connection_descriptors_free(php_oci_connection *connection TSRMLS_DC);
-sb4 php_oci_error(OCIError *err_p, sword status TSRMLS_DC);
-sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf TSRMLS_DC);
-int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset TSRMLS_DC);
+void php_oci_connection_descriptors_free(php_oci_connection *connection);
+sb4 php_oci_error(OCIError *err_p, sword status);
+sb4 php_oci_fetch_errmsg(OCIError *error_handle, text **error_buf);
+int php_oci_fetch_sqltext_offset(php_oci_statement *statement, text **sqltext, ub2 *error_offset);
void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclusive);
-php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive TSRMLS_DC);
-int php_oci_connection_rollback(php_oci_connection *connection TSRMLS_DC);
-int php_oci_connection_commit(php_oci_connection *connection TSRMLS_DC);
-int php_oci_connection_release(php_oci_connection *connection TSRMLS_DC);
-int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len TSRMLS_DC);
-void php_oci_client_get_version(char **version TSRMLS_DC);
-int php_oci_server_get_version(php_oci_connection *connection, char **version TSRMLS_DC);
+php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, zend_long session_mode, int persistent, int exclusive);
+int php_oci_connection_rollback(php_oci_connection *connection);
+int php_oci_connection_commit(php_oci_connection *connection);
+int php_oci_connection_release(php_oci_connection *connection);
+int php_oci_password_change(php_oci_connection *connection, char *user, int user_len, char *pass_old, int pass_old_len, char *pass_new, int pass_new_len);
+void php_oci_client_get_version(char **version);
+int php_oci_server_get_version(php_oci_connection *connection, char **version);
void php_oci_fetch_row(INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_args);
-int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode TSRMLS_DC);
+int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode);
void php_oci_dtrace_check_connection(php_oci_connection *connection, sb4 errcode, ub4 serverStatus);
/* }}} */
/* {{{ lob related prototypes */
-php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type TSRMLS_DC);
-int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length TSRMLS_DC);
-int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len TSRMLS_DC);
-int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written TSRMLS_DC);
-int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag TSRMLS_DC);
-int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off TSRMLS_DC);
+php_oci_descriptor *php_oci_lob_create(php_oci_connection *connection, zend_long type);
+int php_oci_lob_get_length(php_oci_descriptor *descriptor, ub4 *length);
+int php_oci_lob_read(php_oci_descriptor *descriptor, zend_long read_length, zend_long inital_offset, char **data, ub4 *data_len);
+int php_oci_lob_write(php_oci_descriptor *descriptor, ub4 offset, char *data, int data_len, ub4 *bytes_written);
+int php_oci_lob_flush(php_oci_descriptor *descriptor, zend_long flush_flag);
+int php_oci_lob_set_buffering(php_oci_descriptor *descriptor, int on_off);
int php_oci_lob_get_buffering(php_oci_descriptor *descriptor);
-int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length TSRMLS_DC);
-int php_oci_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_temp_lob_close(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len TSRMLS_DC);
-void php_oci_lob_free(php_oci_descriptor *descriptor TSRMLS_DC);
-int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename TSRMLS_DC);
-int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from TSRMLS_DC);
-int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length TSRMLS_DC);
-int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased TSRMLS_DC);
-int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result TSRMLS_DC);
+int php_oci_lob_copy(php_oci_descriptor *descriptor, php_oci_descriptor *descriptor_from, zend_long length);
+int php_oci_lob_close(php_oci_descriptor *descriptor);
+int php_oci_temp_lob_close(php_oci_descriptor *descriptor);
+int php_oci_lob_write_tmp(php_oci_descriptor *descriptor, zend_long type, char *data, int data_len);
+void php_oci_lob_free(php_oci_descriptor *descriptor);
+int php_oci_lob_import(php_oci_descriptor *descriptor, char *filename);
+int php_oci_lob_append(php_oci_descriptor *descriptor_dest, php_oci_descriptor *descriptor_from);
+int php_oci_lob_truncate(php_oci_descriptor *descriptor, zend_long new_lob_length);
+int php_oci_lob_erase(php_oci_descriptor *descriptor, zend_long offset, ub4 length, ub4 *bytes_erased);
+int php_oci_lob_is_equal(php_oci_descriptor *descriptor_first, php_oci_descriptor *descriptor_second, boolean *result);
sb4 php_oci_lob_callback(dvoid *ctxp, CONST dvoid *bufxp, oraub8 len, ub1 piece, dvoid **changed_bufpp, oraub8 *changed_lenp);
/* }}} */
/* {{{ collection related prototypes */
-php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len TSRMLS_DC);
-int php_oci_collection_size(php_oci_collection *collection, sb4 *size TSRMLS_DC);
-int php_oci_collection_max(php_oci_collection *collection, zend_long *max TSRMLS_DC);
-int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size TSRMLS_DC);
-int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len TSRMLS_DC);
-int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element TSRMLS_DC);
-int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len TSRMLS_DC);
-int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index TSRMLS_DC);
-int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len TSRMLS_DC);
-int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len TSRMLS_DC);
-int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len TSRMLS_DC);
-int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from TSRMLS_DC);
-void php_oci_collection_close(php_oci_collection *collection TSRMLS_DC);
-int php_oci_collection_append_null(php_oci_collection *collection TSRMLS_DC);
-int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len TSRMLS_DC);
-int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len TSRMLS_DC);
-int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len TSRMLS_DC);
+php_oci_collection *php_oci_collection_create(php_oci_connection *connection, char *tdo, int tdo_len, char *schema, int schema_len);
+int php_oci_collection_size(php_oci_collection *collection, sb4 *size);
+int php_oci_collection_max(php_oci_collection *collection, zend_long *max);
+int php_oci_collection_trim(php_oci_collection *collection, zend_long trim_size);
+int php_oci_collection_append(php_oci_collection *collection, char *element, int element_len);
+int php_oci_collection_element_get(php_oci_collection *collection, zend_long index, zval *result_element);
+int php_oci_collection_element_set(php_oci_collection *collection, zend_long index, char *value, int value_len);
+int php_oci_collection_element_set_null(php_oci_collection *collection, zend_long index);
+int php_oci_collection_element_set_date(php_oci_collection *collection, zend_long index, char *date, int date_len);
+int php_oci_collection_element_set_number(php_oci_collection *collection, zend_long index, char *number, int number_len);
+int php_oci_collection_element_set_string(php_oci_collection *collection, zend_long index, char *element, int element_len);
+int php_oci_collection_assign(php_oci_collection *collection_dest, php_oci_collection *collection_from);
+void php_oci_collection_close(php_oci_collection *collection);
+int php_oci_collection_append_null(php_oci_collection *collection);
+int php_oci_collection_append_date(php_oci_collection *collection, char *date, int date_len);
+int php_oci_collection_append_number(php_oci_collection *collection, char *number, int number_len);
+int php_oci_collection_append_string(php_oci_collection *collection, char *element, int element_len);
/* }}} */
/* {{{ statement related prototypes */
-php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len TSRMLS_DC);
-php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement TSRMLS_DC);
-int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch TSRMLS_DC);
-int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows TSRMLS_DC);
-php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len TSRMLS_DC);
-int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC);
-int php_oci_statement_cancel(php_oci_statement *statement TSRMLS_DC);
-void php_oci_statement_free(php_oci_statement *statement TSRMLS_DC);
-int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC);
-int php_oci_bind_post_exec(void *data TSRMLS_DC);
-int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type TSRMLS_DC);
+php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len);
+php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement);
+int php_oci_statement_set_prefetch(php_oci_statement *statement, ub4 prefetch);
+int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows);
+php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, zend_long column_index, char *column_name, int column_name_len);
+int php_oci_statement_execute(php_oci_statement *statement, ub4 mode);
+int php_oci_statement_cancel(php_oci_statement *statement);
+void php_oci_statement_free(php_oci_statement *statement);
+int php_oci_bind_pre_exec(void *data, void *result);
+int php_oci_bind_post_exec(void *data);
+int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long maxlength, ub2 type);
sb4 php_oci_bind_in_callback(dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp);
sb4 php_oci_bind_out_callback(dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp);
php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data);
-int php_oci_cleanup_pre_fetch(void *data TSRMLS_DC);
-int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type TSRMLS_DC);
-int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows TSRMLS_DC);
-int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength TSRMLS_DC);
-php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection TSRMLS_DC);
+int php_oci_cleanup_pre_fetch(void *data);
+int php_oci_statement_get_type(php_oci_statement *statement, ub2 *type);
+int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows);
+int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, int name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type);
+php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_length);
+php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_length);
+php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_length, zend_long maxlength);
+php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_length, php_oci_connection *connection);
/* }}} */
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index 3857c6955c..42d6f44fd4 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -159,11 +159,11 @@ ZEND_GET_MODULE(birdstep)
THREAD_LS birdstep_module php_birdstep_module;
THREAD_LS static HENV henv;
-#define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not result index (%ld)", id); RETURN_FALSE; }
-#define PHP_BIRDSTEP_CHK_LNK(id) if (!(conn = birdstep_find_conn(list, id))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Not connection index (%ld)", id); RETURN_FALSE; }
+#define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not result index (%ld)", id); RETURN_FALSE; }
+#define PHP_BIRDSTEP_CHK_LNK(id) if (!(conn = birdstep_find_conn(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not connection index (%ld)", id); RETURN_FALSE; }
-static void _close_birdstep_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_birdstep_link(zend_rsrc_list_entry *rsrc)
{
VConn *conn = (VConn *)rsrc->ptr;
@@ -172,7 +172,7 @@ static void _close_birdstep_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}
-static void _free_birdstep_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _free_birdstep_result(zend_rsrc_list_entry *rsrc)
{
Vresult *res = (Vresult *)rsrc->ptr;
@@ -224,11 +224,11 @@ PHP_MSHUTDOWN_FUNCTION(birdstep)
/* Some internal functions. Connections and result manupulate */
-static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc TSRMLS_DC)
+static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc)
{
int ind;
- ind = zend_list_insert(conn,php_birdstep_module.le_link TSRMLS_CC);
+ ind = zend_list_insert(conn,php_birdstep_module.le_link);
conn->hdbc = hdbc;
conn->index = ind;
@@ -293,28 +293,28 @@ PHP_FUNCTION(birdstep_connect)
VConn *new;
zend_long ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &serv, &serv_len, &user, &user_len, &pass, &pass_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &serv, &serv_len, &user, &user_len, &pass, &pass_len) == FAILURE) {
return;
}
if ( php_birdstep_module.max_links != -1 && php_birdstep_module.num_links == php_birdstep_module.max_links ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links);
RETURN_FALSE;
}
stat = SQLAllocConnect(henv,&hdbc);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not allocate connection handle");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Could not allocate connection handle");
RETURN_FALSE;
}
stat = SQLConnect(hdbc, serv, SQL_NTS, user, SQL_NTS, pass, SQL_NTS);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s", serv, user);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s", serv, user);
SQLFreeConnect(hdbc);
RETURN_FALSE;
}
new = (VConn *)emalloc(sizeof(VConn));
- ind = birdstep_add_conn(list,new,hdbc TSRMLS_CC);
+ ind = birdstep_add_conn(list,new,hdbc);
php_birdstep_module.num_links++;
RETURN_LONG(ind);
}
@@ -327,7 +327,7 @@ PHP_FUNCTION(birdstep_close)
zend_long id;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -354,7 +354,7 @@ PHP_FUNCTION(birdstep_exec)
SWORD cols,i,colnamelen;
SDWORD rows,coldesc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &ind, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &ind, &query, &query_len) == FAILURE) {
return;
}
@@ -363,13 +363,13 @@ PHP_FUNCTION(birdstep_exec)
res = (Vresult *)emalloc(sizeof(Vresult));
stat = SQLAllocStmt(conn->hdbc,&res->hstmt);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat);
efree(res);
RETURN_FALSE;
}
stat = SQLExecDirect(res->hstmt,query,SQL_NTS);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Cannot execute \"%s\" query",query);
+ php_error_docref(NULL, E_WARNING, "Birdstep: Cannot execute \"%s\" query",query);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -377,7 +377,7 @@ PHP_FUNCTION(birdstep_exec)
/* Success query */
stat = SQLNumResultCols(res->hstmt,&cols);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -385,7 +385,7 @@ PHP_FUNCTION(birdstep_exec)
if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */
stat = SQLRowCount(res->hstmt,&rows);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
SQLFreeStmt(res->hstmt,SQL_DROP);
efree(res);
RETURN_FALSE;
@@ -432,7 +432,7 @@ PHP_FUNCTION(birdstep_fetch)
UDWORD row;
UWORD RowStat[1];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
@@ -445,7 +445,7 @@ PHP_FUNCTION(birdstep_fetch)
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -469,7 +469,7 @@ PHP_FUNCTION(birdstep_result)
SWORD indx = -1;
char *field = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lZ", &ind, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lZ", &ind, &col) == FAILURE) {
return;
}
@@ -489,12 +489,12 @@ PHP_FUNCTION(birdstep_result)
}
}
if ( indx < 0 ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found",field);
+ php_error_docref(NULL, E_WARNING, "Field %s not found",field);
RETURN_FALSE;
}
} else {
if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
RETURN_FALSE;
}
}
@@ -506,7 +506,7 @@ PHP_FUNCTION(birdstep_result)
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLFetch return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -531,7 +531,7 @@ l1:
RETURN_FALSE;
}
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: SQLGetData return error");
+ php_error_docref(NULL, E_WARNING, "Birdstep: SQLGetData return error");
SQLFreeStmt(res->hstmt,SQL_DROP);
birdstep_del_result(list,Z_LVAL_PP(ind));
RETURN_FALSE;
@@ -556,7 +556,7 @@ PHP_FUNCTION(birdstep_freeresult)
zend_long ind;
Vresult *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
@@ -576,7 +576,7 @@ PHP_FUNCTION(birdstep_autocommit)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -584,7 +584,7 @@ PHP_FUNCTION(birdstep_autocommit)
stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_on option failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_on option failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -599,7 +599,7 @@ PHP_FUNCTION(birdstep_off_autocommit)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -607,7 +607,7 @@ PHP_FUNCTION(birdstep_off_autocommit)
stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF);
if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Set autocommit_off option failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_off option failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -622,7 +622,7 @@ zend_long
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -630,7 +630,7 @@ zend_long
stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Commit failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Commit failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -645,7 +645,7 @@ PHP_FUNCTION(birdstep_rollback)
RETCODE stat;
VConn *conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
return;
}
@@ -653,7 +653,7 @@ PHP_FUNCTION(birdstep_rollback)
stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK);
if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Rollback failure");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Rollback failure");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -668,7 +668,7 @@ PHP_FUNCTION(birdstep_fieldname)
Vresult *res;
SWORD indx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &ind, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &ind, &col) == FAILURE) {
return;
}
@@ -676,7 +676,7 @@ PHP_FUNCTION(birdstep_fieldname)
indx = col;
if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Birdstep: Field index not in range");
+ php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
RETURN_FALSE;
}
RETURN_STRING(res->values[indx].name,TRUE);
@@ -690,7 +690,7 @@ PHP_FUNCTION(birdstep_fieldnum)
zend_long ind;
Vresult *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
return;
}
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 594a37383e..238f89233e 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -416,7 +416,7 @@ ZEND_GET_MODULE(odbc)
/* {{{ _free_odbc_result
*/
-static void _free_odbc_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_odbc_result(zend_resource *rsrc)
{
odbc_result *res = (odbc_result *)rsrc->ptr;
int i;
@@ -465,7 +465,7 @@ static void safe_odbc_disconnect( void *handle )
/* {{{ _close_odbc_conn
*/
-static void _close_odbc_conn(zend_resource *rsrc TSRMLS_DC)
+static void _close_odbc_conn(zend_resource *rsrc)
{
zend_resource *p;
odbc_result *res;
@@ -491,7 +491,7 @@ static void _close_odbc_conn(zend_resource *rsrc TSRMLS_DC)
/* {{{ void _close_odbc_pconn
*/
-static void _close_odbc_pconn(zend_resource *rsrc TSRMLS_DC)
+static void _close_odbc_pconn(zend_resource *rsrc)
{
zend_resource *p;
odbc_result *res;
@@ -521,7 +521,6 @@ static void _close_odbc_pconn(zend_resource *rsrc TSRMLS_DC)
static PHP_INI_DISP(display_link_nums)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -546,7 +545,6 @@ static PHP_INI_DISP(display_link_nums)
static PHP_INI_DISP(display_defPW)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -577,7 +575,6 @@ static PHP_INI_DISP(display_defPW)
static PHP_INI_DISP(display_binmode)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -608,7 +605,6 @@ static PHP_INI_DISP(display_binmode)
static PHP_INI_DISP(display_lrl)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -634,7 +630,6 @@ static PHP_INI_DISP(display_lrl)
static PHP_INI_DISP(display_cursortype)
{
char *value;
- TSRMLS_FETCH();
if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value->val;
@@ -868,7 +863,6 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
RETCODE rc;
ODBC_SQL_ENV_T henv;
ODBC_SQL_CONN_T conn;
- TSRMLS_FETCH();
if (conn_resource) {
henv = conn_resource->henv;
@@ -895,9 +889,9 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
memcpy(ODBCG(laststate), state, sizeof(state));
memcpy(ODBCG(lasterrormsg), errormsg, sizeof(errormsg));
if (func) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
}
/*
} while (SQL_SUCCEEDED(rc));
@@ -913,7 +907,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
zval *pv_res;
zend_long flag;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &flag) == FAILURE) {
return;
}
@@ -936,7 +930,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
/* }}} */
/* {{{ odbc_bindcols */
-int odbc_bindcols(odbc_result *result TSRMLS_DC)
+int odbc_bindcols(odbc_result *result)
{
RETCODE rc;
int i;
@@ -1019,7 +1013,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
RETCODE rc;
zval *pv_conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_conn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_conn) == FAILURE) {
return;
}
@@ -1036,7 +1030,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
/* }}} */
/* {{{ _close_pconn_with_res */
-static int _close_pconn_with_res(zend_resource *le, zend_resource *res TSRMLS_DC)
+static int _close_pconn_with_res(zend_resource *le, zend_resource *res)
{
if (le->type == le_pconn && (((odbc_connection *)(le->ptr))->res == res)){
return 1;
@@ -1064,24 +1058,24 @@ void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -1119,7 +1113,7 @@ PHP_FUNCTION(odbc_close_all)
zend_list_close(p);
/* Delete the persistent connection */
zend_hash_apply_with_argument(&EG(persistent_list),
- (apply_func_arg_t) _close_pconn_with_res, (void *)p TSRMLS_CC);
+ (apply_func_arg_t) _close_pconn_with_res, (void *)p);
}
}
} ZEND_HASH_FOREACH_END();
@@ -1156,7 +1150,7 @@ PHP_FUNCTION(odbc_prepare)
SQLUINTEGER scrollopts;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pv_conn, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pv_conn, &query, &query_len) == FAILURE) {
return;
}
@@ -1169,7 +1163,7 @@ PHP_FUNCTION(odbc_prepare)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -1211,7 +1205,7 @@ PHP_FUNCTION(odbc_prepare)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -1250,7 +1244,7 @@ PHP_FUNCTION(odbc_execute)
numArgs = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|a", &pv_res, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|a", &pv_res, &pv_param_arr) == FAILURE) {
return;
}
@@ -1258,13 +1252,13 @@ PHP_FUNCTION(odbc_execute)
/* XXX check for already bound parameters*/
if (result->numparams > 0 && numArgs == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No parameters to SQL statement given");
+ php_error_docref(NULL, E_WARNING, "No parameters to SQL statement given");
RETURN_FALSE;
}
if (result->numparams > 0) {
if ((ne = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr))) < result->numparams) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams);
+ php_error_docref(NULL, E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams);
RETURN_FALSE;
}
@@ -1276,7 +1270,7 @@ PHP_FUNCTION(odbc_execute)
for(i = 1; i <= result->numparams; i++) {
if ((tmp = zend_hash_get_current_data(Z_ARRVAL_P(pv_param_arr))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter");
+ php_error_docref(NULL, E_WARNING,"Error getting parameter");
SQLFreeStmt(result->stmt,SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1290,7 +1284,7 @@ PHP_FUNCTION(odbc_execute)
otype = Z_TYPE_P(tmp);
convert_to_string_ex(tmp);
if (Z_TYPE_P(tmp) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1333,7 +1327,7 @@ PHP_FUNCTION(odbc_execute)
filename[strlen(filename)] = '\0';
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
efree(filename);
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
@@ -1346,7 +1340,7 @@ PHP_FUNCTION(odbc_execute)
}
if ((params[i-1].fp = open(filename,O_RDONLY)) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't open file %s", filename);
+ php_error_docref(NULL, E_WARNING,"Can't open file %s", filename);
SQLFreeStmt(result->stmt, SQL_RESET_PARAMS);
for (i = 0; i < result->numparams; i++) {
if (params[i].fp != -1) {
@@ -1446,7 +1440,7 @@ PHP_FUNCTION(odbc_execute)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
@@ -1468,7 +1462,7 @@ PHP_FUNCTION(odbc_cursor)
odbc_result *result;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
@@ -1500,7 +1494,7 @@ PHP_FUNCTION(odbc_cursor)
RETVAL_STRING(cursorname);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
+ php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
RETVAL_FALSE;
}
} else {
@@ -1525,14 +1519,14 @@ PHP_FUNCTION(odbc_data_source)
UCHAR server_name[100], desc[200];
SQLSMALLINT len1=0, len2=0, fetch_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zv_conn, &zv_fetch_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zv_conn, &zv_fetch_type) == FAILURE) {
return;
}
fetch_type = (SQLSMALLINT) zv_fetch_type;
if (!(fetch_type == SQL_FETCH_FIRST || fetch_type == SQL_FETCH_NEXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fetch type (%d)", fetch_type);
+ php_error_docref(NULL, E_WARNING, "Invalid fetch type (%d)", fetch_type);
RETURN_FALSE;
}
@@ -1586,7 +1580,7 @@ PHP_FUNCTION(odbc_exec)
numArgs = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pv_conn, &query, &query_len, &pv_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &pv_conn, &query, &query_len, &pv_flags) == FAILURE) {
return;
}
@@ -1596,7 +1590,7 @@ PHP_FUNCTION(odbc_exec)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
efree(result);
RETURN_FALSE;
}
@@ -1638,7 +1632,7 @@ PHP_FUNCTION(odbc_exec)
/* For insert, update etc. cols == 0 */
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -1671,7 +1665,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
zval *pv_res, tmp;
zend_long pv_row = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_res, &pv_row) == FAILURE) {
return;
}
@@ -1679,7 +1673,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
#else
zval *pv_res, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
#endif
@@ -1687,7 +1681,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -1823,13 +1817,13 @@ PHP_FUNCTION(odbc_fetch_into)
#endif /* HAVE_SQL_EXTENDED_FETCH */
#ifdef HAVE_SQL_EXTENDED_FETCH
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|l", &pv_res, &pv_res_arr, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|l", &pv_res, &pv_res_arr, &pv_row) == FAILURE) {
return;
}
rownum = pv_row;
#else
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/", &pv_res, &pv_res_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/", &pv_res, &pv_res_arr) == FAILURE) {
return;
}
#endif /* HAVE_SQL_EXTENDED_FETCH */
@@ -1837,7 +1831,7 @@ PHP_FUNCTION(odbc_fetch_into)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -1933,13 +1927,13 @@ PHP_FUNCTION(solid_fetch_prev)
RETCODE rc;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, &pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
rc = SQLFetchPrev(result->stmt);
@@ -1971,7 +1965,7 @@ PHP_FUNCTION(odbc_fetch_row)
SQLUSMALLINT RowStatus[1];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_res, &pv_row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_res, &pv_row) == FAILURE) {
return;
}
@@ -1980,7 +1974,7 @@ PHP_FUNCTION(odbc_fetch_row)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -2029,7 +2023,7 @@ PHP_FUNCTION(odbc_result)
field_ind = -1;
field = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pv_res, &pv_field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pv_res, &pv_field) == FAILURE) {
return;
}
@@ -2043,14 +2037,14 @@ PHP_FUNCTION(odbc_result)
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if ((result->numcols == 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
/* get field index if the field parameter was a string */
if (field != NULL) {
if (result->values == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set contains no data");
+ php_error_docref(NULL, E_WARNING, "Result set contains no data");
RETURN_FALSE;
}
@@ -2062,13 +2056,13 @@ PHP_FUNCTION(odbc_result)
}
if (field_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field %s not found", field);
+ php_error_docref(NULL, E_WARNING, "Field %s not found", field);
RETURN_FALSE;
}
} else {
/* check for limits of field_ind if the field parameter was an int */
if (field_ind >= result->numcols || field_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index is larger than the number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index is larger than the number of fields");
RETURN_FALSE;
}
}
@@ -2213,14 +2207,14 @@ PHP_FUNCTION(odbc_result_all)
SQLUSMALLINT RowStatus[1];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s", &pv_res, &pv_format, &pv_format_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s", &pv_res, &pv_format, &pv_format_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
#ifdef HAVE_SQL_EXTENDED_FETCH
@@ -2328,7 +2322,7 @@ PHP_FUNCTION(odbc_free_result)
odbc_result *result;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
@@ -2366,7 +2360,7 @@ PHP_FUNCTION(odbc_pconnect)
/* }}} */
/* {{{ odbc_sqlconnect */
-int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int cur_opt, int persistent TSRMLS_DC)
+int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int cur_opt, int persistent)
{
RETCODE rc;
@@ -2510,7 +2504,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* Now an optional 4th parameter specifying the cursor type
* defaulting to the cursors default
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &db, &db_len, &uid, &uid_len, &pwd, &pwd_len, &pv_opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|l", &db, &db_len, &uid, &uid_len, &pwd, &pwd_len, &pv_opt) == FAILURE) {
return;
}
@@ -2522,7 +2516,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
cur_opt == SQL_CUR_USE_ODBC ||
cur_opt == SQL_CUR_USE_DRIVER ||
cur_opt == SQL_CUR_DEFAULT) ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Cursor type (%d)", cur_opt);
+ php_error_docref(NULL, E_WARNING, "Invalid Cursor type (%d)", cur_opt);
RETURN_FALSE;
}
}
@@ -2550,17 +2544,17 @@ try_and_get_another_connection:
zend_resource new_le;
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
+ php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (ODBCG(max_persistent) != -1 && ODBCG(num_persistent) >= ODBCG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open persistent links (%ld)", ODBCG(num_persistent));
+ php_error_docref(NULL, E_WARNING,"Too many open persistent links (%ld)", ODBCG(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
- if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 1 TSRMLS_CC)) {
+ if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 1)) {
efree(hashed_details);
RETURN_FALSE;
}
@@ -2635,12 +2629,12 @@ try_and_get_another_connection:
}
}
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links));
+ php_error_docref(NULL, E_WARNING,"Too many open connections (%ld)",ODBCG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
- if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0 TSRMLS_CC)) {
+ if (!odbc_sqlconnect(&db_conn, db, uid, pwd, cur_opt, 0)) {
efree(hashed_details);
RETURN_FALSE;
}
@@ -2671,11 +2665,11 @@ PHP_FUNCTION(odbc_close)
int is_pconn = 0;
int found_resource_type = le_conn;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_conn) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_conn) == FAILURE) {
return;
}
- conn = (odbc_connection *) zend_fetch_resource(pv_conn TSRMLS_CC, -1, "ODBC-Link", &found_resource_type, 2, le_conn, le_pconn);
+ conn = (odbc_connection *) zend_fetch_resource(pv_conn, -1, "ODBC-Link", &found_resource_type, 2, le_conn, le_pconn);
if (found_resource_type==le_pconn) {
is_pconn = 1;
}
@@ -2692,7 +2686,7 @@ PHP_FUNCTION(odbc_close)
zend_list_close(Z_RES_P(pv_conn));
if(is_pconn){
- zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _close_pconn_with_res, (void *) Z_RES_P(pv_conn) TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _close_pconn_with_res, (void *) Z_RES_P(pv_conn));
}
}
/* }}} */
@@ -2705,7 +2699,7 @@ PHP_FUNCTION(odbc_num_rows)
SQLLEN rows;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2723,7 +2717,7 @@ PHP_FUNCTION(odbc_next_result)
zval *pv_res;
int rc, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2746,7 +2740,7 @@ PHP_FUNCTION(odbc_next_result)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
@@ -2771,7 +2765,7 @@ PHP_FUNCTION(odbc_num_fields)
odbc_result *result;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pv_res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
@@ -2787,24 +2781,24 @@ PHP_FUNCTION(odbc_field_name)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -2822,24 +2816,24 @@ PHP_FUNCTION(odbc_field_type)
zval *pv_res;
zend_long pv_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pv_res, &pv_num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pv_res, &pv_num) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
if (pv_num > result->numcols) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field index larger than number of fields");
+ php_error_docref(NULL, E_WARNING, "Field index larger than number of fields");
RETURN_FALSE;
}
if (pv_num < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1");
+ php_error_docref(NULL, E_WARNING, "Field numbering starts at 1");
RETURN_FALSE;
}
@@ -2873,14 +2867,14 @@ PHP_FUNCTION(odbc_field_num)
odbc_result *result;
zval *pv_res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pv_res, &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pv_res, &fname, &fname_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
if (result->numcols == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this result index");
+ php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
RETURN_FALSE;
}
@@ -2908,7 +2902,7 @@ PHP_FUNCTION(odbc_autocommit)
zval *pv_conn;
zend_long pv_onoff = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, &pv_onoff) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_conn, &pv_onoff) == FAILURE) {
return;
}
@@ -2958,7 +2952,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_string *ptr;
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &pv_handle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pv_handle) == FAILURE) {
return;
}
@@ -3020,7 +3014,7 @@ PHP_FUNCTION(odbc_setoption)
zval *pv_handle;
zend_long pv_which, pv_opt, pv_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &pv_handle, &pv_which, &pv_opt, &pv_val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlll", &pv_handle, &pv_which, &pv_opt, &pv_val) == FAILURE) {
return;
}
@@ -3029,7 +3023,7 @@ PHP_FUNCTION(odbc_setoption)
ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn);
if (conn->persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set option for persistent connection");
+ php_error_docref(NULL, E_WARNING, "Unable to set option for persistent connection");
RETURN_FALSE;
}
rc = SQLSetConnectOption(conn->hdbc, (unsigned short) pv_opt, pv_val);
@@ -3049,7 +3043,7 @@ PHP_FUNCTION(odbc_setoption)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option type");
+ php_error_docref(NULL, E_WARNING, "Unknown option type");
RETURN_FALSE;
break;
}
@@ -3073,7 +3067,7 @@ PHP_FUNCTION(odbc_tables)
size_t cat_len = 0, schema_len = 0, table_len = 0, type_len = 0;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &type, &type_len) == FAILURE) {
return;
}
@@ -3085,7 +3079,7 @@ PHP_FUNCTION(odbc_tables)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3116,7 +3110,7 @@ PHP_FUNCTION(odbc_tables)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3140,7 +3134,7 @@ PHP_FUNCTION(odbc_columns)
int cat_len = 0, schema_len = 0, table_len = 0, column_len = 0;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &column, &column_len) == FAILURE) {
return;
}
@@ -3152,7 +3146,7 @@ PHP_FUNCTION(odbc_columns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3185,7 +3179,7 @@ PHP_FUNCTION(odbc_columns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3210,7 +3204,7 @@ PHP_FUNCTION(odbc_columnprivileges)
int cat_len = 0, schema_len, table_len, column_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&table, &table_len, &column, &column_len) == FAILURE) {
return;
}
@@ -3222,7 +3216,7 @@ PHP_FUNCTION(odbc_columnprivileges)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3248,7 +3242,7 @@ PHP_FUNCTION(odbc_columnprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3274,7 +3268,7 @@ PHP_FUNCTION(odbc_foreignkeys)
size_t pcat_len = 0, pschema_len, ptable_len, fcat_len, fschema_len, ftable_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!sssss", &pv_conn, &pcat, &pcat_len, &pschema, &pschema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!sssss", &pv_conn, &pcat, &pcat_len, &pschema, &pschema_len,
&ptable, &ptable_len, &fcat, &fcat_len, &fschema, &fschema_len, &ftable, &ftable_len) == FAILURE) {
return;
}
@@ -3298,7 +3292,7 @@ PHP_FUNCTION(odbc_foreignkeys)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3326,7 +3320,7 @@ PHP_FUNCTION(odbc_foreignkeys)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3351,7 +3345,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
RETCODE rc;
SQLSMALLINT data_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &pv_conn, &pv_data_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &pv_conn, &pv_data_type) == FAILURE) {
return;
}
@@ -3364,7 +3358,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3386,7 +3380,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3410,7 +3404,7 @@ PHP_FUNCTION(odbc_primarykeys)
int cat_len = 0, schema_len, table_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
return;
}
@@ -3421,7 +3415,7 @@ PHP_FUNCTION(odbc_primarykeys)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3446,7 +3440,7 @@ PHP_FUNCTION(odbc_primarykeys)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3475,7 +3469,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!sss", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&proc, &proc_len, &col, &col_len) == FAILURE) {
return;
}
@@ -3487,7 +3481,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3513,7 +3507,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3543,7 +3537,7 @@ PHP_FUNCTION(odbc_procedures)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &proc, &proc_len) == FAILURE) {
return;
}
@@ -3554,7 +3548,7 @@ PHP_FUNCTION(odbc_procedures)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3579,7 +3573,7 @@ PHP_FUNCTION(odbc_procedures)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3606,7 +3600,7 @@ PHP_FUNCTION(odbc_specialcolumns)
SQLUSMALLINT type, scope, nullable;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len,
&name, &name_len, &vscope, &vnullable) == FAILURE) {
return;
}
@@ -3622,7 +3616,7 @@ PHP_FUNCTION(odbc_specialcolumns)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3650,7 +3644,7 @@ PHP_FUNCTION(odbc_specialcolumns)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3676,7 +3670,7 @@ PHP_FUNCTION(odbc_statistics)
SQLUSMALLINT unique, reserved;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ssll", &pv_conn, &cat, &cat_len, &schema, &schema_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ssll", &pv_conn, &cat, &cat_len, &schema, &schema_len,
&name, &name_len, &vunique, &vreserved) == FAILURE) {
return;
}
@@ -3691,7 +3685,7 @@ PHP_FUNCTION(odbc_statistics)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3718,7 +3712,7 @@ PHP_FUNCTION(odbc_statistics)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
@@ -3743,7 +3737,7 @@ PHP_FUNCTION(odbc_tableprivileges)
int cat_len = 0, schema_len, table_len;
RETCODE rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss", &pv_conn, &cat, &cat_len, &schema, &schema_len, &table, &table_len) == FAILURE) {
return;
}
@@ -3754,7 +3748,7 @@ PHP_FUNCTION(odbc_tableprivileges)
rc = SQLAllocStmt(conn->hdbc, &(result->stmt));
if (rc == SQL_INVALID_HANDLE) {
efree(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
+ php_error_docref(NULL, E_WARNING, "SQLAllocStmt error 'Invalid Handle'");
RETURN_FALSE;
}
@@ -3779,7 +3773,7 @@ PHP_FUNCTION(odbc_tableprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));
if (result->numcols > 0) {
- if (!odbc_bindcols(result TSRMLS_CC)) {
+ if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 6a7e5c3756..e5c55fec71 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -279,7 +279,7 @@ void odbc_del_result(HashTable *list, int count);
int odbc_add_conn(HashTable *list, HDBC conn);
odbc_connection *odbc_get_conn(HashTable *list, int count);
void odbc_del_conn(HashTable *list, int ind);
-int odbc_bindcols(odbc_result *result TSRMLS_DC);
+int odbc_bindcols(odbc_result *result);
#define ODBC_SQL_ERROR_PARAMS odbc_connection *conn_resource, ODBC_SQL_STMT_T stmt, char *func
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 6f3f1310a0..d2dc38962a 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -30,7 +30,7 @@
#define DEBUG_BLOCKPASS 0
/* Checks if a constant (like "true") may be replaced by its value */
-int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy TSRMLS_DC)
+int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy)
{
zend_constant *c;
char *lookup_name;
@@ -585,7 +585,7 @@ static void strip_nop(zend_code_block *block, zend_optimizer_ctx *ctx)
block->len = new_end - block->start_opline;
}
-static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, char *used_ext, zend_cfg *cfg, zend_optimizer_ctx *ctx TSRMLS_DC)
+static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, char *used_ext, zend_cfg *cfg, zend_optimizer_ctx *ctx)
{
zend_op *opline = block->start_opline;
zend_op *end, *last_op = NULL;
@@ -626,7 +626,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval c = ZEND_OP1_LITERAL(src);
VAR_UNSET(opline->op1);
zval_copy_ctor(&c);
- zend_optimizer_update_op1_const(op_array, opline, &c TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &c);
literal_dtor(&ZEND_OP1_LITERAL(src));
MAKE_NOP(src);
}
@@ -640,7 +640,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval c = ZEND_OP1_LITERAL(src);
VAR_UNSET(opline->op2);
zval_copy_ctor(&c);
- zend_optimizer_update_op2_const(op_array, opline, &c TSRMLS_CC);
+ zend_optimizer_update_op2_const(op_array, opline, &c);
literal_dtor(&ZEND_OP1_LITERAL(src));
MAKE_NOP(src);
}
@@ -744,7 +744,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
literal_dtor(arg);
MAKE_NOP(sv);
MAKE_NOP(fcall);
- ZEND_OP1_LITERAL(opline) = zend_optimizer_add_literal(op_array, &c TSRMLS_CC);
+ ZEND_OP1_LITERAL(opline) = zend_optimizer_add_literal(op_array, &c);
/* no copy ctor - get already copied it */
ZEND_OP1_TYPE(opline) = IS_CONST;
}
@@ -923,7 +923,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
memcpy(Z_STRVAL(ZEND_OP1_LITERAL(last_op)) + old_len, Z_STRVAL(ZEND_OP1_LITERAL(opline)), Z_STRLEN(ZEND_OP1_LITERAL(opline)));
Z_STRVAL(ZEND_OP1_LITERAL(last_op))[l] = '\0';
zval_dtor(&ZEND_OP1_LITERAL(opline));
- Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)) TSRMLS_CC);
+ Z_STR(ZEND_OP1_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP1_LITERAL(last_op)));
if (!Z_REFCOUNTED(ZEND_OP1_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP1_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
@@ -967,7 +967,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
memcpy(Z_STRVAL(ZEND_OP2_LITERAL(src)) + old_len, Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)));
Z_STRVAL(ZEND_OP2_LITERAL(src))[l] = '\0';
zend_string_release(Z_STR(ZEND_OP2_LITERAL(opline)));
- Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)) TSRMLS_CC);
+ Z_STR(ZEND_OP2_LITERAL(opline)) = zend_new_interned_string(Z_STR(ZEND_OP2_LITERAL(src)));
if (!Z_REFCOUNTED(ZEND_OP2_LITERAL(opline))) {
Z_TYPE_FLAGS(ZEND_OP2_LITERAL(opline)) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
}
@@ -1004,7 +1004,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
ZEND_OP1_TYPE(opline)==IS_CONST &&
ZEND_OP2_TYPE(opline)==IS_CONST) {
/* evaluate constant expressions */
- int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode);
+ int (*binary_op)(zval *result, zval *op1, zval *op2) = get_binary_op(opline->opcode);
zval result;
int er;
@@ -1021,12 +1021,12 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
}
er = EG(error_reporting);
EG(error_reporting) = 0;
- if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline) TSRMLS_CC) == SUCCESS) {
+ if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline)) == SUCCESS) {
literal_dtor(&ZEND_OP1_LITERAL(opline));
literal_dtor(&ZEND_OP2_LITERAL(opline));
opline->opcode = ZEND_QM_ASSIGN;
SET_UNUSED(opline->op2);
- zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &result);
}
EG(error_reporting) = er;
} else if ((opline->opcode == ZEND_BOOL ||
@@ -1037,7 +1037,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
zval result;
if (unary_op) {
- unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ unary_op(&result, &ZEND_OP1_LITERAL(opline));
literal_dtor(&ZEND_OP1_LITERAL(opline));
} else {
/* BOOL */
@@ -1046,7 +1046,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array,
ZVAL_NULL(&ZEND_OP1_LITERAL(opline));
}
opline->opcode = ZEND_QM_ASSIGN;
- zend_optimizer_update_op1_const(op_array, opline, &result TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, &result);
} else if ((opline->opcode == ZEND_RETURN || opline->opcode == ZEND_EXIT) &&
(ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) &&
VAR_SOURCE(opline->op1) &&
@@ -1251,7 +1251,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
}
}
-static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_array, zend_code_block *blocks, zend_cfg *cfg, zend_optimizer_ctx *ctx TSRMLS_DC)
+static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_array, zend_code_block *blocks, zend_cfg *cfg, zend_optimizer_ctx *ctx)
{
/* last_op is the last opcode of the current block */
zend_op *last_op = (block->start_opline + block->len - 1);
@@ -1293,7 +1293,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
zval zv = ZEND_OP1_LITERAL(last_op);
zval_copy_ctor(&zv);
- last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv TSRMLS_CC);
+ last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv);
}
del_source(block, block->op1_to);
if (block->op1_to->op2_to) {
@@ -1319,7 +1319,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
zval zv = ZEND_OP1_LITERAL(last_op);
zval_copy_ctor(&zv);
- last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv TSRMLS_CC);
+ last_op->op1.constant = zend_optimizer_add_literal(op_array, &zv);
}
del_source(block, block->op1_to);
block->op1_to = NULL;
@@ -1384,7 +1384,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
case ZEND_JMPNZ:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
if (last_op->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -1528,7 +1528,7 @@ next_target:
case ZEND_JMPZ_EX:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
if (last_op->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
@@ -1641,7 +1641,7 @@ next_target_ex:
}
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
- if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) {
+ if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) {
/* JMPZNZ(false,L1,L2) -> JMP(L1) */
zend_code_block *todel;
@@ -1908,7 +1908,7 @@ static void zend_t_usage(zend_code_block *block, zend_op_array *op_array, char *
#define PASSES 3
-void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_cfg cfg;
zend_code_block *cur_block;
@@ -1953,7 +1953,7 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
if (!cur_block->access) {
continue;
}
- zend_optimize_block(cur_block, op_array, usage, &cfg, ctx TSRMLS_CC);
+ zend_optimize_block(cur_block, op_array, usage, &cfg, ctx);
}
/* Jump optimization for each block */
@@ -1961,7 +1961,7 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
if (!cur_block->access) {
continue;
}
- zend_jmp_optimization(cur_block, op_array, cfg.blocks, &cfg, ctx TSRMLS_CC);
+ zend_jmp_optimization(cur_block, op_array, cfg.blocks, &cfg, ctx);
}
/* Eliminate unreachable basic blocks */
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 8fb5a9b0c9..0dee9d6146 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -114,7 +114,7 @@ static void optimizer_literal_class_info(literal_info *info,
}
}
-void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_op *opline, *end;
int i, j, n, *map, cache_slots;
@@ -309,7 +309,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
for (i = 0; i < op_array->last_literal; i++) {
zval zv = op_array->literals[i].constant;
- use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv);
fprintf(stderr, "Literal %d, val (%d):%s\n", i, Z_STRLEN(zv), Z_STRVAL(zv));
if (use_copy) {
zval_dtor(&zv);
@@ -490,7 +490,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
for (i = 0; i < op_array->last_literal; i++) {
zval zv = op_array->literals[i].constant;
- use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&op_array->literals[i].constant, &zv);
fprintf(stderr, "Literal %d, val (%d):%s\n", i, Z_STRLEN(zv), Z_STRVAL(zv));
if (use_copy) {
zval_dtor(&zv);
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c
index 5c765cef4e..0fa08b7d32 100644
--- a/ext/opcache/Optimizer/optimize_func_calls.c
+++ b/ext/opcache/Optimizer/optimize_func_calls.c
@@ -38,7 +38,7 @@ typedef struct _optimizer_call_info {
zend_op *opline;
} optimizer_call_info;
-void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
zend_op *opline = op_array->opcodes;
zend_op *end = opline + op_array->last;
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 6eb6a4ce02..819a093600 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -37,7 +37,7 @@
#define ZEND_IS_CONSTANT_TYPE(t) ((t) == IS_CONSTANT)
-void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC)
+void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
int i = 0;
zend_op *opline = op_array->opcodes;
@@ -68,7 +68,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
if (ZEND_OP1_TYPE(opline) == IS_CONST &&
ZEND_OP2_TYPE(opline) == IS_CONST) {
/* binary operation with constant operands */
- int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode);
+ int (*binary_op)(zval *result, zval *op1, zval *op2) = get_binary_op(opline->opcode);
uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */
zval result;
int er;
@@ -82,7 +82,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
er = EG(error_reporting);
EG(error_reporting) = 0;
/* evaluate constant expression */
- if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline) TSRMLS_CC) != SUCCESS) {
+ if (binary_op(&result, &ZEND_OP1_LITERAL(opline), &ZEND_OP2_LITERAL(opline)) != SUCCESS) {
EG(error_reporting) = er;
break;
}
@@ -91,7 +91,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result);
}
break;
@@ -127,7 +127,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res);
} else if (opline->extended_value == _IS_BOOL) {
/* T = CAST(X, IS_BOOL) => T = BOOL(X) */
opline->opcode = ZEND_BOOL;
@@ -146,7 +146,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
er = EG(error_reporting);
EG(error_reporting) = 0;
- if (unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC) != SUCCESS) {
+ if (unary_op(&result, &ZEND_OP1_LITERAL(opline)) != SUCCESS) {
EG(error_reporting) = er;
break;
}
@@ -154,7 +154,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result);
}
break;
@@ -243,12 +243,12 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
memset(&fake_execute_data, 0, sizeof(zend_execute_data));
fake_execute_data.func = (zend_function*)op_array;
EG(current_execute_data) = &fake_execute_data;
- if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) {
+ if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
uint32_t tv = ZEND_RESULT(opline).var;
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset);
}
EG(current_execute_data) = orig_execute_data;
break;
@@ -261,7 +261,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
uint32_t tv = ZEND_RESULT(opline).var;
zval c;
- if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1 TSRMLS_CC)) {
+ if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1)) {
if (!ctx->constants || !zend_optimizer_get_collected_constant(ctx->constants, &ZEND_OP2_LITERAL(opline), &c)) {
break;
}
@@ -271,7 +271,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c);
}
/* class constant */
@@ -319,7 +319,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
break;
}
if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_P(c))) {
- if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1 TSRMLS_CC) ||
+ if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1) ||
ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {
break;
}
@@ -335,7 +335,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t);
}
}
}
@@ -436,7 +436,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
func->module->type == MODULE_PERSISTENT) {
zval t;
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -471,7 +471,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
}
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -484,10 +484,10 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
"defined", sizeof("defined")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0 TSRMLS_CC)) {
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0)) {
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -501,8 +501,8 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
"constant", sizeof("constant")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1 TSRMLS_CC)) {
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -518,7 +518,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -537,7 +537,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_STR(&t, dirname);
- if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t)) {
literal_dtor(&ZEND_OP2_LITERAL(init_opline));
MAKE_NOP(init_opline);
literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
@@ -560,7 +560,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
zval t;
ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline)));
- zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t);
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
}
@@ -569,11 +569,11 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
{
zval c;
uint32_t tv = ZEND_RESULT(opline).var;
- if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0 TSRMLS_CC)) {
+ if (!zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0)) {
break;
}
ZVAL_TRUE(&c);
- zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC);
+ zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c);
literal_dtor(&ZEND_OP1_LITERAL(opline));
MAKE_NOP(opline);
}
diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c
index 859bc2f3bc..4c839edf5a 100644
--- a/ext/opcache/Optimizer/pass2.c
+++ b/ext/opcache/Optimizer/pass2.c
@@ -33,7 +33,7 @@
#include "zend_execute.h"
#include "zend_vm.h"
-void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
+void zend_optimizer_pass2(zend_op_array *op_array)
{
zend_op *opline;
zend_op *end = op_array->opcodes + op_array->last;
@@ -47,7 +47,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_DIV:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
- convert_scalar_to_number(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ convert_scalar_to_number(&ZEND_OP1_LITERAL(opline));
}
}
/* break missing *intentionally* - the assign_op's may only optimize op2 */
@@ -61,7 +61,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
}
if (ZEND_OP2_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
- convert_scalar_to_number(&ZEND_OP2_LITERAL(opline) TSRMLS_CC);
+ convert_scalar_to_number(&ZEND_OP2_LITERAL(opline));
}
}
break;
@@ -119,7 +119,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
/* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C)
in case we know it wouldn't jump */
} else if (ZEND_OP1_TYPE(opline) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
if (opline->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -133,7 +133,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMPZ:
case ZEND_JMPNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
- int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
if (opline->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -169,7 +169,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMPZNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
int opline_num;
- if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) {
+ if (zend_is_true(&ZEND_OP1_LITERAL(opline))) {
opline_num = opline->extended_value; /* JMPNZ */
} else {
opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */
diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c
index 8d8cb50580..8a4646a595 100644
--- a/ext/opcache/Optimizer/pass3.c
+++ b/ext/opcache/Optimizer/pass3.c
@@ -53,7 +53,7 @@
} \
jmp_hitlist[jmp_hitlist_count++] = ZEND_OP2(&op_array->opcodes[target]).opline_num;
-void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC)
+void zend_optimizer_pass3(zend_op_array *op_array)
{
zend_op *opline;
zend_op *end = op_array->opcodes + op_array->last;
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index a36b6584b3..229831231e 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -99,7 +99,7 @@ int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name)
return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
}
-int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC)
+int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv)
{
int i = op_array->last_literal;
op_array->last_literal++;
@@ -113,7 +113,7 @@ int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC)
void zend_optimizer_update_op1_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC)
+ zval *val)
{
if (opline->opcode == ZEND_FREE) {
MAKE_NOP(opline);
@@ -127,37 +127,37 @@ void zend_optimizer_update_op1_const(zend_op_array *op_array,
case ZEND_FETCH_CONSTANT:
case ZEND_DEFINED:
case ZEND_NEW:
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline)));
Z_CACHE_SLOT(op_array->literals[opline->op1.constant]) = op_array->last_cache_slot++;
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op1.constant+1]));
break;
default:
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline)));
break;
}
} else {
- opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op1.constant = zend_optimizer_add_literal(op_array, val);
}
}
}
void zend_optimizer_update_op2_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC)
+ zval *val)
{
ZEND_OP2_TYPE(opline) = IS_CONST;
if (opline->opcode == ZEND_INIT_FCALL) {
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- opline->op2.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op2.constant = zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline)));
Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = op_array->last_cache_slot++;
return;
}
- opline->op2.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ opline->op2.constant = zend_optimizer_add_literal(op_array, val);
if (Z_TYPE_P(val) == IS_STRING) {
zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline)));
switch (opline->opcode) {
@@ -177,13 +177,13 @@ void zend_optimizer_update_op2_const(zend_op_array *op_array,
case ZEND_INSTANCEOF:
Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = op_array->last_cache_slot++;
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op2.constant+1]));
break;
case ZEND_INIT_METHOD_CALL:
case ZEND_INIT_STATIC_METHOD_CALL:
zend_str_tolower(Z_STRVAL_P(val), Z_STRLEN_P(val));
- zend_optimizer_add_literal(op_array, val TSRMLS_CC);
+ zend_optimizer_add_literal(op_array, val);
zend_string_hash_val(Z_STR(op_array->literals[opline->op2.constant+1]));
/* break missing intentionally */
/*case ZEND_FETCH_CONSTANT:*/
@@ -268,7 +268,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
zend_op *opline,
zend_uchar type,
uint32_t var,
- zval *val TSRMLS_DC)
+ zval *val)
{
zend_op *end = op_array->opcodes + op_array->last;
@@ -313,7 +313,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
zval old_val;
ZVAL_COPY_VALUE(&old_val, val);
zval_copy_ctor(val);
- zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, val);
ZVAL_COPY_VALUE(val, &old_val);
opline++;
continue;
@@ -325,7 +325,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
default:
break;
}
- zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op1_const(op_array, opline, val);
break;
}
@@ -337,7 +337,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
default:
break;
}
- zend_optimizer_update_op2_const(op_array, opline, val TSRMLS_CC);
+ zend_optimizer_update_op2_const(op_array, opline, val);
break;
}
opline++;
@@ -347,7 +347,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
}
static void zend_optimize(zend_op_array *op_array,
- zend_optimizer_ctx *ctx TSRMLS_DC)
+ zend_optimizer_ctx *ctx)
{
if (op_array->type == ZEND_EVAL_CODE) {
return;
@@ -360,7 +360,7 @@ static void zend_optimize(zend_op_array *op_array,
* - convert CAST(IS_BOOL,x) into BOOL(x)
*/
if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass1(op_array, ctx TSRMLS_CC);
+ zend_optimizer_pass1(op_array, ctx);
}
/* pass 2:
@@ -370,7 +370,7 @@ static void zend_optimize(zend_op_array *op_array,
* - pre-evaluate constant function calls
*/
if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass2(op_array TSRMLS_CC);
+ zend_optimizer_pass2(op_array);
}
/* pass 3:
@@ -379,21 +379,21 @@ static void zend_optimize(zend_op_array *op_array,
* - change $i++ to ++$i where possible
*/
if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {
- zend_optimizer_pass3(op_array TSRMLS_CC);
+ zend_optimizer_pass3(op_array);
}
/* pass 4:
* - INIT_FCALL_BY_NAME -> DO_FCALL
*/
if (ZEND_OPTIMIZER_PASS_4 & OPTIMIZATION_LEVEL) {
- optimize_func_calls(op_array, ctx TSRMLS_CC);
+ optimize_func_calls(op_array, ctx);
}
/* pass 5:
* - CFG optimization
*/
if (ZEND_OPTIMIZER_PASS_5 & OPTIMIZATION_LEVEL) {
- optimize_cfg(op_array, ctx TSRMLS_CC);
+ optimize_cfg(op_array, ctx);
}
/* pass 9:
@@ -414,12 +414,12 @@ static void zend_optimize(zend_op_array *op_array,
* - Compact literals table
*/
if (ZEND_OPTIMIZER_PASS_11 & OPTIMIZATION_LEVEL) {
- zend_optimizer_compact_literals(op_array, ctx TSRMLS_CC);
+ zend_optimizer_compact_literals(op_array, ctx);
}
}
static void zend_accel_optimize(zend_op_array *op_array,
- zend_optimizer_ctx *ctx TSRMLS_DC)
+ zend_optimizer_ctx *ctx)
{
zend_op *opline, *end;
@@ -459,7 +459,7 @@ static void zend_accel_optimize(zend_op_array *op_array,
}
/* Do actual optimizations */
- zend_optimize(op_array, ctx TSRMLS_CC);
+ zend_optimize(op_array, ctx);
/* Redo pass_two() */
opline = op_array->opcodes;
@@ -498,7 +498,7 @@ static void zend_accel_optimize(zend_op_array *op_array,
}
}
-int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
+int zend_accel_script_optimize(zend_persistent_script *script)
{
uint idx, j;
Bucket *p, *q;
@@ -510,13 +510,13 @@ int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
ctx.script = script;
ctx.constants = NULL;
- zend_accel_optimize(&script->main_op_array, &ctx TSRMLS_CC);
+ zend_accel_optimize(&script->main_op_array, &ctx);
for (idx = 0; idx < script->function_table.nNumUsed; idx++) {
p = script->function_table.arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
op_array = (zend_op_array*)Z_PTR(p->val);
- zend_accel_optimize(op_array, &ctx TSRMLS_CC);
+ zend_accel_optimize(op_array, &ctx);
}
for (idx = 0; idx < script->class_table.nNumUsed; idx++) {
@@ -528,7 +528,7 @@ int zend_accel_script_optimize(zend_persistent_script *script TSRMLS_DC)
if (Z_TYPE(q->val) == IS_UNDEF) continue;
op_array = (zend_op_array*)Z_PTR(q->val);
if (op_array->scope == ce) {
- zend_accel_optimize(op_array, &ctx TSRMLS_CC);
+ zend_accel_optimize(op_array, &ctx);
} else if (op_array->type == ZEND_USER_FUNCTION) {
zend_op_array *orig_op_array;
if ((orig_op_array = zend_hash_find_ptr(&op_array->scope->function_table, q->key)) != NULL) {
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index ee44bf671c..5e86ab84e6 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -82,13 +82,13 @@ struct _zend_block_source {
#define LITERAL_LONG(op, val) do { \
zval _c; \
ZVAL_LONG(&_c, val); \
- op.constant = zend_optimizer_add_literal(op_array, &_c TSRMLS_CC); \
+ op.constant = zend_optimizer_add_literal(op_array, &_c); \
} while (0)
#define LITERAL_BOOL(op, val) do { \
zval _c; \
ZVAL_BOOL(&_c, val); \
- op.constant = zend_optimizer_add_literal(op_array, &_c TSRMLS_CC); \
+ op.constant = zend_optimizer_add_literal(op_array, &_c); \
} while (0)
#define literal_dtor(zv) do { \
@@ -101,30 +101,30 @@ struct _zend_block_source {
target = src; \
} while (0)
-int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv TSRMLS_DC);
-int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy TSRMLS_DC);
+int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv);
+int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy);
void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value);
int zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value);
int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name);
void zend_optimizer_update_op1_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC);
+ zval *val);
void zend_optimizer_update_op2_const(zend_op_array *op_array,
zend_op *opline,
- zval *val TSRMLS_DC);
+ zval *val);
int zend_optimizer_replace_by_const(zend_op_array *op_array,
zend_op *opline,
zend_uchar type,
uint32_t var,
- zval *val TSRMLS_DC);
+ zval *val);
-void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
-void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC);
-void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC);
-void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
-void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
+void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx);
+void zend_optimizer_pass2(zend_op_array *op_array);
+void zend_optimizer_pass3(zend_op_array *op_array);
+void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx);
+void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx);
void optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_ctx *ctx);
void zend_optimizer_nop_removal(zend_op_array *op_array);
-void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC);
+void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx *ctx);
#endif
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 486cb39a17..5faa9c61c3 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -74,13 +74,13 @@ typedef int gid_t;
#define SHM_PROTECT() \
do { \
if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(1 TSRMLS_CC); \
+ zend_accel_shared_protect(1); \
} \
} while (0)
#define SHM_UNPROTECT() \
do { \
if (ZCG(accel_directives).protect_memory) { \
- zend_accel_shared_protect(0 TSRMLS_CC); \
+ zend_accel_shared_protect(0); \
} \
} while (0)
@@ -103,9 +103,9 @@ zend_bool accel_startup_ok = 0;
static char *zps_failure_reason = NULL;
char *zps_api_failure_reason = NULL;
-static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
-static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
-static char *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type);
+static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle );
+static char *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len);
static void (*orig_chdir)(INTERNAL_FUNCTION_PARAMETERS) = NULL;
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
@@ -164,7 +164,7 @@ static ZEND_FUNCTION(accel_chdir)
}
}
-static inline char* accel_getcwd(int *cwd_len TSRMLS_DC)
+static inline char* accel_getcwd(int *cwd_len)
{
if (ZCG(cwd)) {
*cwd_len = ZCG(cwd_len);
@@ -181,10 +181,10 @@ static inline char* accel_getcwd(int *cwd_len TSRMLS_DC)
}
}
-void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC)
+void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason)
{
if ((((double) ZSMMG(wasted_shared_memory)) / ZCG(accel_directives).memory_consumption) >= ZCG(accel_directives).max_wasted_percentage) {
- zend_accel_schedule_restart(reason TSRMLS_CC);
+ zend_accel_schedule_restart(reason);
}
}
@@ -195,7 +195,7 @@ void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason T
*/
static ZEND_INI_MH(accel_include_path_on_modify)
{
- int ret = orig_include_path_on_modify(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ int ret = orig_include_path_on_modify(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
ZCG(include_path_key) = NULL;
if (ret == SUCCESS) {
@@ -210,7 +210,7 @@ static ZEND_INI_MH(accel_include_path_on_modify)
if (!ZCG(include_path_key) &&
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len));
if (!ZCG(include_path_key) &&
@@ -224,11 +224,11 @@ static ZEND_INI_MH(accel_include_path_on_modify)
ZCG(include_path_key) = key + ZCG(include_path_len) + 1;
zend_accel_hash_update(&ZCSG(include_paths), key, ZCG(include_path_len), 0, ZCG(include_path_key));
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
} else {
@@ -243,29 +243,29 @@ static ZEND_INI_MH(accel_include_path_on_modify)
}
/* Interned strings support */
-static zend_string *(*orig_new_interned_string)(zend_string *str TSRMLS_DC);
-static void (*orig_interned_strings_snapshot)(TSRMLS_D);
-static void (*orig_interned_strings_restore)(TSRMLS_D);
+static zend_string *(*orig_new_interned_string)(zend_string *str);
+static void (*orig_interned_strings_snapshot)(void);
+static void (*orig_interned_strings_restore)(void);
/* O+ disables creation of interned strings by regular PHP compiler, instead,
* it creates interned strings in shared memory when saves a script.
* Such interned strings are shared across all PHP processes
*/
-static zend_string *accel_new_interned_string_for_php(zend_string *str TSRMLS_DC)
+static zend_string *accel_new_interned_string_for_php(zend_string *str)
{
return str;
}
-static void accel_interned_strings_snapshot_for_php(TSRMLS_D)
+static void accel_interned_strings_snapshot_for_php(void)
{
}
-static void accel_interned_strings_restore_for_php(TSRMLS_D)
+static void accel_interned_strings_restore_for_php(void)
{
}
#ifndef ZTS
-static void accel_interned_strings_restore_state(TSRMLS_D)
+static void accel_interned_strings_restore_state(void)
{
uint idx = ZCSG(interned_strings).nNumUsed;
uint nIndex;
@@ -292,13 +292,13 @@ static void accel_interned_strings_restore_state(TSRMLS_D)
}
}
-static void accel_interned_strings_save_state(TSRMLS_D)
+static void accel_interned_strings_save_state(void)
{
ZCSG(interned_strings_saved_top) = ZCSG(interned_strings_top);
}
#endif
-zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC)
+zend_string *accel_new_interned_string(zend_string *str)
{
/* for now interned strings are supported only for non-ZTS build */
#ifndef ZTS
@@ -366,18 +366,18 @@ zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC)
#ifndef ZTS
/* Copy PHP interned strings from PHP process memory into the shared memory */
-static void accel_use_shm_interned_strings(TSRMLS_D)
+static void accel_use_shm_interned_strings(void)
{
uint idx, j;
Bucket *p, *q;
/* empty string */
- CG(empty_string) = accel_new_interned_string(CG(empty_string) TSRMLS_CC);
+ CG(empty_string) = accel_new_interned_string(CG(empty_string));
for (j = 0; j < 256; j++) {
char s[2];
s[0] = j;
s[1] = 0;
- CG(one_char_string)[j] = accel_new_interned_string(zend_string_init(s, 1, 0) TSRMLS_CC);
+ CG(one_char_string)[j] = accel_new_interned_string(zend_string_init(s, 1, 0));
}
/* function table hash keys */
@@ -385,10 +385,10 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
p = CG(function_table)->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
if (Z_FUNC(p->val)->common.function_name) {
- Z_FUNC(p->val)->common.function_name = accel_new_interned_string(Z_FUNC(p->val)->common.function_name TSRMLS_CC);
+ Z_FUNC(p->val)->common.function_name = accel_new_interned_string(Z_FUNC(p->val)->common.function_name);
}
}
@@ -401,11 +401,11 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
ce = (zend_class_entry*)Z_PTR(p->val);
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
if (ce->name) {
- ce->name = accel_new_interned_string(ce->name TSRMLS_CC);
+ ce->name = accel_new_interned_string(ce->name);
}
for (j = 0; j < ce->properties_info.nNumUsed; j++) {
@@ -417,11 +417,11 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
info = (zend_property_info*)Z_PTR(q->val);
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
if (info->name) {
- info->name = accel_new_interned_string(info->name TSRMLS_CC);
+ info->name = accel_new_interned_string(info->name);
}
}
@@ -429,10 +429,10 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
q = ce->function_table.arData + j;
if (Z_TYPE(q->val) == IS_UNDEF) continue;
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
if (Z_FUNC(q->val)->common.function_name) {
- Z_FUNC(q->val)->common.function_name = accel_new_interned_string(Z_FUNC(q->val)->common.function_name TSRMLS_CC);
+ Z_FUNC(q->val)->common.function_name = accel_new_interned_string(Z_FUNC(q->val)->common.function_name);
}
}
@@ -440,7 +440,7 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
q = ce->constants_table.arData + j;
if (!Z_TYPE(q->val) == IS_UNDEF) continue;
if (q->key) {
- q->key = accel_new_interned_string(q->key TSRMLS_CC);
+ q->key = accel_new_interned_string(q->key);
}
}
}
@@ -450,7 +450,7 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
p = EG(zend_constants)->arData + idx;
if (!Z_TYPE(p->val) == IS_UNDEF) continue;
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
}
@@ -463,15 +463,15 @@ static void accel_use_shm_interned_strings(TSRMLS_D)
auto_global = (zend_auto_global*)Z_PTR(p->val);;
- auto_global->name = accel_new_interned_string(auto_global->name TSRMLS_CC);
+ auto_global->name = accel_new_interned_string(auto_global->name);
if (p->key) {
- p->key = accel_new_interned_string(p->key TSRMLS_CC);
+ p->key = accel_new_interned_string(p->key);
}
}
}
#endif
-static inline void accel_restart_enter(TSRMLS_D)
+static inline void accel_restart_enter(void)
{
#ifdef ZEND_WIN32
INCREMENT(restart_in);
@@ -485,7 +485,7 @@ static inline void accel_restart_enter(TSRMLS_D)
ZCSG(restart_in_progress) = 1;
}
-static inline void accel_restart_leave(TSRMLS_D)
+static inline void accel_restart_leave(void)
{
#ifdef ZEND_WIN32
ZCSG(restart_in_progress) = 0;
@@ -500,7 +500,7 @@ static inline void accel_restart_leave(TSRMLS_D)
#endif
}
-static inline int accel_restart_is_active(TSRMLS_D)
+static inline int accel_restart_is_active(void)
{
if (ZCSG(restart_in_progress)) {
#ifndef ZEND_WIN32
@@ -524,7 +524,7 @@ static inline int accel_restart_is_active(TSRMLS_D)
}
/* Creates a read lock for SHM access */
-static inline void accel_activate_add(TSRMLS_D)
+static inline void accel_activate_add(void)
{
#ifdef ZEND_WIN32
INCREMENT(mem_usage);
@@ -538,7 +538,7 @@ static inline void accel_activate_add(TSRMLS_D)
}
/* Releases a lock for SHM access */
-static inline void accel_deactivate_sub(TSRMLS_D)
+static inline void accel_deactivate_sub(void)
{
#ifdef ZEND_WIN32
if (ZCG(counted)) {
@@ -554,10 +554,10 @@ static inline void accel_deactivate_sub(TSRMLS_D)
#endif
}
-static inline void accel_unlock_all(TSRMLS_D)
+static inline void accel_unlock_all(void)
{
#ifdef ZEND_WIN32
- accel_deactivate_sub(TSRMLS_C);
+ accel_deactivate_sub();
#else
static const FLOCK_STRUCTURE(mem_usage_unlock_all, F_UNLCK, SEEK_SET, 0, 0);
@@ -610,7 +610,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
}
#endif
-static inline int accel_is_inactive(TSRMLS_D)
+static inline int accel_is_inactive(void)
{
#ifdef ZEND_WIN32
if (LOCKVAL(mem_usage) == 0) {
@@ -641,7 +641,7 @@ static inline int accel_is_inactive(TSRMLS_D)
return FAILURE;
}
-static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf TSRMLS_DC)
+static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf)
{
php_stream_wrapper *wrapper;
php_stream_statbuf stream_statbuf;
@@ -651,7 +651,7 @@ static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf
return FAILURE;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY);
if (!wrapper) {
return FAILURE;
}
@@ -663,7 +663,7 @@ static int zend_get_stream_timestamp(const char *filename, zend_stat_t *statbuf
er = EG(error_reporting);
EG(error_reporting) = 0;
zend_try {
- ret = wrapper->wops->url_stat(wrapper, (char*)filename, PHP_STREAM_URL_STAT_QUIET, &stream_statbuf, NULL TSRMLS_CC);
+ ret = wrapper->wops->url_stat(wrapper, (char*)filename, PHP_STREAM_URL_STAT_QUIET, &stream_statbuf, NULL);
} zend_catch {
ret = -1;
} zend_end_try();
@@ -722,7 +722,7 @@ static accel_time_t zend_get_file_handle_timestamp_win(zend_file_handle *file_ha
}
#endif
-static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size TSRMLS_DC)
+static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size)
{
zend_stat_t statbuf;
#ifdef ZEND_WIN32
@@ -733,7 +733,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
!EG(current_execute_data) &&
file_handle->filename == SG(request_info).path_translated) {
- zend_stat_t *tmpbuf = sapi_module.get_stat(TSRMLS_C);
+ zend_stat_t *tmpbuf = sapi_module.get_stat();
if (tmpbuf) {
if (size) {
@@ -758,7 +758,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
break;
case ZEND_HANDLE_FP:
if (zend_fstat(fileno(file_handle->handle.fp), &statbuf) == -1) {
- if (zend_get_stream_timestamp(file_handle->filename, &statbuf TSRMLS_CC) != SUCCESS) {
+ if (zend_get_stream_timestamp(file_handle->filename, &statbuf) != SUCCESS) {
return 0;
}
}
@@ -770,7 +770,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
if (file_path) {
if (is_stream_path(file_path)) {
- if (zend_get_stream_timestamp(file_path, &statbuf TSRMLS_CC) == SUCCESS) {
+ if (zend_get_stream_timestamp(file_path, &statbuf) == SUCCESS) {
break;
}
}
@@ -779,7 +779,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
}
}
- if (zend_get_stream_timestamp(file_handle->filename, &statbuf TSRMLS_CC) != SUCCESS) {
+ if (zend_get_stream_timestamp(file_handle->filename, &statbuf) != SUCCESS) {
return 0;
}
break;
@@ -799,7 +799,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
er = EG(error_reporting);
EG(error_reporting) = 0;
zend_try {
- ret = stream->ops->stat(stream, &sb TSRMLS_CC);
+ ret = stream->ops->stat(stream, &sb);
} zend_catch {
ret = -1;
} zend_end_try();
@@ -822,7 +822,7 @@ static accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle
return statbuf.st_mtime;
}
-static inline int do_validate_timestamps(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
+static inline int do_validate_timestamps(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
{
zend_file_handle ps_handle;
char *full_path_ptr = NULL;
@@ -836,7 +836,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
return FAILURE;
}
} else {
- full_path_ptr = accelerator_orig_zend_resolve_path(file_handle->filename, strlen(file_handle->filename) TSRMLS_CC);
+ full_path_ptr = accelerator_orig_zend_resolve_path(file_handle->filename, strlen(file_handle->filename));
if (full_path_ptr && strcmp(persistent_script->full_path->val, full_path_ptr) != 0) {
efree(full_path_ptr);
return FAILURE;
@@ -852,7 +852,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
return FAILURE;
}
- if (zend_get_file_handle_timestamp(file_handle, NULL TSRMLS_CC) == persistent_script->timestamp) {
+ if (zend_get_file_handle_timestamp(file_handle, NULL) == persistent_script->timestamp) {
if (full_path_ptr) {
efree(full_path_ptr);
file_handle->opened_path = NULL;
@@ -868,19 +868,19 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
ps_handle.filename = persistent_script->full_path->val;
ps_handle.opened_path = persistent_script->full_path->val;
- if (zend_get_file_handle_timestamp(&ps_handle, NULL TSRMLS_CC) == persistent_script->timestamp) {
+ if (zend_get_file_handle_timestamp(&ps_handle, NULL) == persistent_script->timestamp) {
return SUCCESS;
}
return FAILURE;
}
-int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
{
if (ZCG(accel_directives).revalidate_freq &&
persistent_script->dynamic_members.revalidate >= ZCG(request_time)) {
return SUCCESS;
- } else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
+ } else if (do_validate_timestamps(persistent_script, file_handle) == FAILURE) {
return FAILURE;
} else {
persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq;
@@ -914,7 +914,7 @@ static unsigned int zend_accel_script_checksum(zend_persistent_script *persisten
/* Instead of resolving full real path name each time we need to identify file,
* we create a key that consist from requested file name, current working
* directory, current include_path, etc */
-char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len TSRMLS_DC)
+char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len)
{
int key_length;
@@ -930,7 +930,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
int cwd_len;
char *cwd;
- if ((cwd = accel_getcwd(&cwd_len TSRMLS_CC)) == NULL) {
+ if ((cwd = accel_getcwd(&cwd_len)) == NULL) {
/* we don't handle this well for now. */
zend_accel_error(ACCEL_LOG_INFO, "getcwd() failed for '%s' (%d), please try to set opcache.use_cwd to 0 in ini file", file_handle->filename, errno);
if (file_handle->opened_path) {
@@ -955,7 +955,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
ZCG(include_path_key) = zend_accel_hash_find(&ZCSG(include_paths), ZCG(include_path), ZCG(include_path_len));
if (ZCG(include_path_key)) {
@@ -973,11 +973,11 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
include_path = ZCG(include_path_key);
include_path_len = 1;
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
@@ -987,7 +987,7 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
in include path too.
*/
if (EG(current_execute_data) &&
- (parent_script = zend_get_executed_filename(TSRMLS_C)) != NULL &&
+ (parent_script = zend_get_executed_filename()) != NULL &&
parent_script[0] != '[') {
parent_script_len = strlen(parent_script);
@@ -1040,21 +1040,21 @@ char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_lengt
return ZCG(key);
}
-static inline char *accel_make_persistent_key(zend_file_handle *file_handle, int *key_len TSRMLS_DC)
+static inline char *accel_make_persistent_key(zend_file_handle *file_handle, int *key_len)
{
- return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len TSRMLS_CC);
+ return accel_make_persistent_key_ex(file_handle, strlen(file_handle->filename), key_len);
}
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC)
+int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force)
{
char *realpath;
zend_persistent_script *persistent_script;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return FAILURE;
}
- realpath = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ realpath = accelerator_orig_zend_resolve_path(filename, filename_len);
if (!realpath) {
return FAILURE;
@@ -1070,9 +1070,9 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
if (force ||
!ZCG(accel_directives).validate_timestamps ||
- do_validate_timestamps(persistent_script, &file_handle TSRMLS_CC) == FAILURE) {
+ do_validate_timestamps(persistent_script, &file_handle) == FAILURE) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1080,28 +1080,28 @@ int zend_accel_invalidate(const char *filename, int filename_len, zend_bool forc
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
- accelerator_shm_read_unlock(TSRMLS_C);
+ accelerator_shm_read_unlock();
efree(realpath);
return SUCCESS;
}
/* Adds another key for existing cached script */
-static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_hash_entry *bucket TSRMLS_DC)
+static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_hash_entry *bucket)
{
if (!zend_accel_hash_find(&ZCSG(hash), key, key_length)) {
if (zend_accel_hash_is_full(&ZCSG(hash))) {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
} else {
char *new_key = zend_shared_alloc(key_length + 1);
if (new_key) {
@@ -1110,13 +1110,13 @@ static void zend_accel_add_key(char *key, unsigned int key_length, zend_accel_ha
zend_accel_error(ACCEL_LOG_INFO, "Added key '%s'", new_key);
}
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
}
}
}
-static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory TSRMLS_DC)
+static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length, int *from_shared_memory)
{
zend_accel_hash_entry *bucket;
uint memory_used;
@@ -1126,18 +1126,18 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
return new_persistent_script;
}
- if (!zend_accel_script_optimize(new_persistent_script TSRMLS_CC)) {
+ if (!zend_accel_script_optimize(new_persistent_script)) {
return new_persistent_script;
}
/* exclusive lock */
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (zend_accel_hash_is_full(&ZCSG(hash))) {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
@@ -1152,26 +1152,26 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
if (!ZCG(accel_directives).revalidate_path &&
(!ZCG(accel_directives).validate_timestamps ||
(new_persistent_script->timestamp == existing_persistent_script->timestamp))) {
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
+ zend_accel_add_key(key, key_length, bucket);
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
}
/* Calculate the required memory size */
- memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length TSRMLS_CC);
+ memory_used = zend_accel_script_persist_calc(new_persistent_script, key, key_length);
/* Allocate shared memory */
ZCG(mem) = zend_shared_alloc(memory_used);
if (!ZCG(mem)) {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
+ zend_shared_alloc_unlock();
return new_persistent_script;
}
/* Copy into shared memory */
- new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length TSRMLS_CC);
+ new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length);
/* Consistency check */
if ((char*)new_persistent_script->mem + new_persistent_script->size != (char*)ZCG(mem)) {
@@ -1201,14 +1201,14 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
} else {
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
ZSMMG(memory_exhausted) = 1;
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH);
}
}
}
new_persistent_script->dynamic_members.memory_consumption = ZEND_ALIGNED_SIZE(new_persistent_script->size);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
*from_shared_memory = 1;
return new_persistent_script;
@@ -1227,7 +1227,7 @@ static const struct jit_auto_global_info
static zend_string *jit_auto_globals_str[4];
-static int zend_accel_get_auto_globals(TSRMLS_D)
+static int zend_accel_get_auto_globals(void)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
int n = 1;
@@ -1242,7 +1242,7 @@ static int zend_accel_get_auto_globals(TSRMLS_D)
return mask;
}
-static int zend_accel_get_auto_globals_no_jit(TSRMLS_D)
+static int zend_accel_get_auto_globals_no_jit(void)
{
if (zend_hash_exists(&EG(symbol_table).ht, jit_auto_globals_str[3])) {
return 8;
@@ -1250,7 +1250,7 @@ static int zend_accel_get_auto_globals_no_jit(TSRMLS_D)
return 0;
}
-static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
+static void zend_accel_set_auto_globals(int mask)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
int n = 1;
@@ -1258,24 +1258,24 @@ static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
for (i = 0; i < ag_size ; i++) {
if ((mask & n) && !(ZCG(auto_globals_mask) & n)) {
ZCG(auto_globals_mask) |= n;
- zend_is_auto_global(jit_auto_globals_str[i] TSRMLS_CC);
+ zend_is_auto_global(jit_auto_globals_str[i]);
}
n += n;
}
}
-static void zend_accel_init_auto_globals(TSRMLS_D)
+static void zend_accel_init_auto_globals(void)
{
int i, ag_size = (sizeof(jit_auto_globals_info) / sizeof(jit_auto_globals_info[0]));
for (i = 0; i < ag_size ; i++) {
jit_auto_globals_str[i] = zend_string_init(jit_auto_globals_info[i].name, jit_auto_globals_info[i].len, 1);
zend_string_hash_val(jit_auto_globals_str[i]);
- jit_auto_globals_str[i] = accel_new_interned_string(jit_auto_globals_str[i] TSRMLS_CC);
+ jit_auto_globals_str[i] = accel_new_interned_string(jit_auto_globals_str[i]);
}
}
-static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, unsigned int key_length, zend_op_array **op_array_p, int *from_shared_memory TSRMLS_DC)
+static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_handle, int type, char *key, unsigned int key_length, zend_op_array **op_array_p, int *from_shared_memory)
{
zend_persistent_script *new_persistent_script;
zend_op_array *orig_active_op_array;
@@ -1288,7 +1288,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Try to open file */
if (file_handle->type == ZEND_HANDLE_FILENAME) {
- if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle TSRMLS_CC) == SUCCESS) {
+ if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) == SUCCESS) {
/* key may be changed by zend_stream_open_function() */
if (key == ZCG(key)) {
key_length = ZCG(key_len);
@@ -1296,10 +1296,10 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
} else {
*op_array_p = NULL;
if (type == ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
return NULL;
}
@@ -1308,7 +1308,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* check blacklist right after ensuring that file was opened */
if (file_handle->opened_path && zend_accel_blacklist_is_blacklisted(&accel_blacklist, file_handle->opened_path)) {
ZCSG(blacklist_misses)++;
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
@@ -1321,7 +1321,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Stream callbacks needs to be called in context of original
* function and class tables (see: https://bugs.php.net/bug.php?id=64353)
*/
- if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
+ if (zend_stream_fixup(file_handle, &buf, &size) == FAILURE) {
*op_array_p = NULL;
return NULL;
}
@@ -1335,26 +1335,26 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Obtain the file timestamps, *before* actually compiling them,
* otherwise we have a race-condition.
*/
- timestamp = zend_get_file_handle_timestamp(file_handle, ZCG(accel_directives).max_file_size > 0 ? &size : NULL TSRMLS_CC);
+ timestamp = zend_get_file_handle_timestamp(file_handle, ZCG(accel_directives).max_file_size > 0 ? &size : NULL);
/* If we can't obtain a timestamp (that means file is possibly socket)
* we won't cache it
*/
if (timestamp == 0) {
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
/* check if file is too new (may be it's not written completely yet) */
if (ZCG(accel_directives).file_update_protection &&
(ZCG(request_time) - ZCG(accel_directives).file_update_protection < timestamp)) {
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
if (ZCG(accel_directives).max_file_size > 0 && size > (size_t)ZCG(accel_directives).max_file_size) {
ZCSG(blacklist_misses)++;
- *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ *op_array_p = accelerator_orig_compile_file(file_handle, type);
return NULL;
}
}
@@ -1378,7 +1378,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES;
CG(compiler_options) |= ZEND_COMPILE_DELAYED_BINDING;
CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION;
- op_array = *op_array_p = accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ op_array = *op_array_p = accelerator_orig_compile_file(file_handle, type);
CG(compiler_options) = orig_compiler_options;
} zend_catch {
op_array = NULL;
@@ -1395,7 +1395,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
if (!op_array) {
/* compilation failed */
free_persistent_script(new_persistent_script, 1);
- zend_accel_free_user_functions(&ZCG(function_table) TSRMLS_CC);
+ zend_accel_free_user_functions(&ZCG(function_table));
if (do_bailout) {
zend_bailout();
}
@@ -1406,7 +1406,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
Here we aren't sure we would store it, but we will need it
further anyway.
*/
- zend_accel_move_user_functions(&ZCG(function_table), &new_persistent_script->function_table TSRMLS_CC);
+ zend_accel_move_user_functions(&ZCG(function_table), &new_persistent_script->function_table);
new_persistent_script->main_op_array = *op_array;
efree(op_array); /* we have valid persistent_script, so it's safe to free op_array */
@@ -1414,9 +1414,9 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
/* Fill in the ping_auto_globals_mask for the new script. If jit for auto globals is enabled we
will have to ping the used auto global variables before execution */
if (PG(auto_globals_jit)) {
- new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals(TSRMLS_C);
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals();
} else {
- new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit(TSRMLS_C);
+ new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals_no_jit();
}
if (ZCG(accel_directives).validate_timestamps) {
@@ -1435,11 +1435,11 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
zend_string_hash_val(new_persistent_script->full_path);
/* Now persistent_script structure is ready in process memory */
- return cache_script_in_shared_memory(new_persistent_script, key, key_length, from_shared_memory TSRMLS_CC);
+ return cache_script_in_shared_memory(new_persistent_script, key, key_length, from_shared_memory);
}
/* zend_compile() replacement */
-zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
+zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
{
zend_persistent_script *persistent_script = NULL;
char *key = NULL;
@@ -1449,11 +1449,11 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (!file_handle->filename ||
!ZCG(enabled) || !accel_startup_ok ||
(!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
- (ZCSG(restart_in_progress) && accel_restart_is_active(TSRMLS_C)) ||
+ (ZCSG(restart_in_progress) && accel_restart_is_active()) ||
(is_stream_path(file_handle->filename) &&
!is_cacheable_stream_path(file_handle->filename))) {
/* The Accelerator is disabled, act as if without the Accelerator */
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* Make sure we only increase the currently running processes semaphore
@@ -1462,7 +1462,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
*/
if (!ZCG(counted)) {
ZCG(counted) = 1;
- accel_activate_add(TSRMLS_C);
+ accel_activate_add();
}
/* In case this callback is called from include_once, require_once or it's
@@ -1480,7 +1480,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
(EG(current_execute_data)->opline->extended_value == ZEND_INCLUDE_ONCE ||
EG(current_execute_data)->opline->extended_value == ZEND_REQUIRE_ONCE))) {
if (!ZCG(key_len)) {
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* persistent script was already found by overridden open() or
* resolve_path() callbacks */
@@ -1489,8 +1489,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
key_length = ZCG(key_len);
} else {
/* try to find cached script by key */
- if ((key = accel_make_persistent_key(file_handle, &key_length TSRMLS_CC)) == NULL) {
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ if ((key = accel_make_persistent_key(file_handle, &key_length)) == NULL) {
+ return accelerator_orig_compile_file(file_handle, type);
}
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length);
if (!persistent_script) {
@@ -1499,12 +1499,12 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* open file to resolve the path */
if (file_handle->type == ZEND_HANDLE_FILENAME &&
- accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle TSRMLS_CC) == FAILURE) {
+ accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) == FAILURE) {
if (type == ZEND_REQUIRE) {
- zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
- zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC);
+ zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
return NULL;
}
@@ -1516,9 +1516,9 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (!ZCG(accel_directives).revalidate_path &&
!persistent_script->corrupted) {
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_lock();
+ zend_accel_add_key(key, key_length, bucket);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
}
@@ -1537,8 +1537,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* If script is found then validate_timestamps if option is enabled */
if (persistent_script && ZCG(accel_directives).validate_timestamps) {
- if (validate_timestamp_and_record(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
- zend_shared_alloc_lock(TSRMLS_C);
+ if (validate_timestamp_and_record(persistent_script, file_handle) == FAILURE) {
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1546,10 +1546,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
persistent_script = NULL;
}
}
@@ -1563,7 +1563,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* The checksum is wrong */
zend_accel_error(ACCEL_LOG_INFO, "Checksum failed for '%s': expected=0x%0.8X, found=0x%0.8X",
persistent_script->full_path, persistent_script->dynamic_members.checksum, checksum);
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (!persistent_script->corrupted) {
persistent_script->corrupted = 1;
persistent_script->timestamp = 0;
@@ -1571,10 +1571,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
if (ZSMMG(memory_exhausted)) {
zend_accel_restart_reason reason =
zend_accel_hash_is_full(&ZCSG(hash)) ? ACCEL_RESTART_HASH : ACCEL_RESTART_OOM;
- zend_accel_schedule_restart_if_necessary(reason TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(reason);
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
persistent_script = NULL;
}
}
@@ -1590,14 +1590,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* No memory left. Behave like without the Accelerator */
if (ZSMMG(memory_exhausted) || ZCSG(restart_pending)) {
SHM_PROTECT();
- return accelerator_orig_compile_file(file_handle, type TSRMLS_CC);
+ return accelerator_orig_compile_file(file_handle, type);
}
/* Try and cache the script and assume that it is returned from_shared_memory.
* If it isn't compile_and_cache_file() changes the flag to 0
*/
from_shared_memory = 0;
- persistent_script = compile_and_cache_file(file_handle, type, key, key_length, &op_array, &from_shared_memory TSRMLS_CC);
+ persistent_script = compile_and_cache_file(file_handle, type, key, key_length, &op_array, &from_shared_memory);
/* Caching is disabled, returning op_array;
* or something went wrong during compilation, returning NULL
@@ -1646,7 +1646,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
}
}
}
- zend_file_handle_dtor(file_handle TSRMLS_CC);
+ zend_file_handle_dtor(file_handle);
from_shared_memory = 1;
}
@@ -1656,14 +1656,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* Fetch jit auto globals used in the script before execution */
if (persistent_script->ping_auto_globals_mask) {
- zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask TSRMLS_CC);
+ zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask);
}
- return zend_accel_load_script(persistent_script, from_shared_memory TSRMLS_CC);
+ return zend_accel_load_script(persistent_script, from_shared_memory);
}
/* zend_stream_open_function() replacement for PHP 5.3 and above */
-static int persistent_stream_open_function(const char *filename, zend_file_handle *handle TSRMLS_DC)
+static int persistent_stream_open_function(const char *filename, zend_file_handle *handle)
{
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
@@ -1718,11 +1718,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
}
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
- return accelerator_orig_zend_stream_open_function(filename, handle TSRMLS_CC);
+ return accelerator_orig_zend_stream_open_function(filename, handle);
}
/* zend_resolve_path() replacement for PHP 5.3 and above */
-static char* persistent_zend_resolve_path(const char *filename, int filename_len TSRMLS_DC)
+static char* persistent_zend_resolve_path(const char *filename, int filename_len)
{
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
@@ -1763,7 +1763,7 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
handle.filename = (char*)filename;
handle.free_filename = 0;
handle.opened_path = NULL;
- key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC);
+ key = accel_make_persistent_key_ex(&handle, filename_len, &key_length);
if (!ZCG(accel_directives).revalidate_path &&
key &&
(persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length)) != NULL &&
@@ -1776,7 +1776,7 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
}
/* find the full real path */
- resolved_path = accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ resolved_path = accelerator_orig_zend_resolve_path(filename, filename_len);
/* Check if requested file already cached (by real path) */
if (resolved_path &&
@@ -1787,9 +1787,9 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
if (key && !ZCG(accel_directives).revalidate_path) {
/* add another "key" for the same bucket */
SHM_UNPROTECT();
- zend_shared_alloc_lock(TSRMLS_C);
- zend_accel_add_key(key, key_length, bucket TSRMLS_CC);
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_lock();
+ zend_accel_add_key(key, key_length, bucket);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
}
ZCG(cache_opline) = (EG(current_execute_data) && key) ? EG(current_execute_data)->opline : NULL;
@@ -1804,10 +1804,10 @@ static char* persistent_zend_resolve_path(const char *filename, int filename_len
}
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
- return accelerator_orig_zend_resolve_path(filename, filename_len TSRMLS_CC);
+ return accelerator_orig_zend_resolve_path(filename, filename_len);
}
-static void zend_reset_cache_vars(TSRMLS_D)
+static void zend_reset_cache_vars(void)
{
ZSMMG(memory_exhausted) = 0;
ZCSG(hits) = 0;
@@ -1820,7 +1820,6 @@ static void zend_reset_cache_vars(TSRMLS_D)
static void accel_activate(void)
{
- TSRMLS_FETCH();
if (!ZCG(enabled) || !accel_startup_ok) {
return;
@@ -1829,7 +1828,7 @@ static void accel_activate(void)
SHM_UNPROTECT();
/* PHP-5.4 and above return "double", but we use 1 sec precision */
ZCG(auto_globals_mask) = 0;
- ZCG(request_time) = (time_t)sapi_get_request_time(TSRMLS_C);
+ ZCG(request_time) = (time_t)sapi_get_request_time();
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
ZCG(include_path_check) = !ZCG(include_path_key);
@@ -1840,14 +1839,14 @@ static void accel_activate(void)
#else
zend_accel_error(ACCEL_LOG_WARNING, "Stuck count for pid %d", getpid());
#endif
- accel_unlock_all(TSRMLS_C);
+ accel_unlock_all();
ZCG(counted) = 0;
}
if (ZCSG(restart_pending)) {
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
if (ZCSG(restart_pending) != 0) { /* check again, to ensure that the cache wasn't already cleaned by another process */
- if (accel_is_inactive(TSRMLS_C) == SUCCESS) {
+ if (accel_is_inactive() == SUCCESS) {
zend_accel_error(ACCEL_LOG_DEBUG, "Restarting!");
ZCSG(restart_pending) = 0;
switch ZCSG(restart_reason) {
@@ -1861,9 +1860,9 @@ static void accel_activate(void)
ZCSG(manual_restarts)++;
break;
}
- accel_restart_enter(TSRMLS_C);
+ accel_restart_enter();
- zend_reset_cache_vars(TSRMLS_C);
+ zend_reset_cache_vars();
zend_accel_hash_clean(&ZCSG(hash));
/* include_paths keeps only the first path */
@@ -1876,17 +1875,17 @@ static void accel_activate(void)
#if !defined(ZTS)
if (ZCG(accel_directives).interned_strings_buffer) {
- accel_interned_strings_restore_state(TSRMLS_C);
+ accel_interned_strings_restore_state();
}
#endif
zend_shared_alloc_restore_state();
ZCSG(accelerator_enabled) = ZCSG(cache_status_before_restart);
ZCSG(last_restart_time) = ZCG(request_time);
- accel_restart_leave(TSRMLS_C);
+ accel_restart_leave();
}
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
/* check if ZCG(function_table) wasn't somehow polluted on the way */
@@ -1926,8 +1925,7 @@ static void accel_fast_zval_dtor(zval *zvalue)
if (Z_REFCOUNTED_P(zvalue) && Z_DELREF_P(zvalue) == 0) {
switch (Z_TYPE_P(zvalue)) {
case IS_ARRAY: {
- TSRMLS_FETCH();
- GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue));
+ GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue));
if (Z_ARR_P(zvalue) != &EG(symbol_table)) {
/* break possible cycles */
ZVAL_NULL(zvalue);
@@ -1937,15 +1935,13 @@ static void accel_fast_zval_dtor(zval *zvalue)
break;
case IS_OBJECT:
{
- TSRMLS_FETCH();
-
+
OBJ_RELEASE(Z_OBJ_P(zvalue));
}
break;
case IS_RESOURCE:
{
- TSRMLS_FETCH();
-
+
/* destroy resource */
zend_list_delete(Z_RES_P(zvalue));
}
@@ -1964,7 +1960,7 @@ static void accel_fast_zval_dtor(zval *zvalue)
}
}
-static int accel_clean_non_persistent_function(zval *zv TSRMLS_DC)
+static int accel_clean_non_persistent_function(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
@@ -1998,7 +1994,7 @@ static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucke
}
}
-static void zend_accel_fast_shutdown(TSRMLS_D)
+static void zend_accel_fast_shutdown(void)
{
if (EG(full_tables_cleanup)) {
EG(symbol_table).ht.pDestructor = accel_fast_zval_dtor;
@@ -2081,19 +2077,18 @@ static void accel_deactivate(void)
* In general, they're restored by persistent_compile_file(), but in case
* the script is aborted abnormally, they may become messed up.
*/
- TSRMLS_FETCH();
if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
- zend_shared_alloc_safe_unlock(TSRMLS_C); /* be sure we didn't leave cache locked */
- accel_unlock_all(TSRMLS_C);
+ zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
+ accel_unlock_all();
ZCG(counted) = 0;
#if !ZEND_DEBUG
if (ZCG(accel_directives).fast_shutdown) {
- zend_accel_fast_shutdown(TSRMLS_C);
+ zend_accel_fast_shutdown();
}
#endif
@@ -2127,7 +2122,7 @@ static int accelerator_remove_cb(zend_extension *element1, zend_extension *eleme
return 0;
}
-static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_extension *, zend_extension *) TSRMLS_DC)
+static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_extension *, zend_extension *))
{
accel_startup_ok = 0;
zps_failure_reason = reason;
@@ -2135,7 +2130,7 @@ static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_e
zend_llist_del_element(&zend_extensions, NULL, (int (*)(void *, void *))cb);
}
-static inline int accel_find_sapi(TSRMLS_D)
+static inline int accel_find_sapi(void)
{
static const char *supported_sapis[] = {
"apache",
@@ -2166,9 +2161,9 @@ static inline int accel_find_sapi(TSRMLS_D)
return FAILURE;
}
-static int zend_accel_init_shm(TSRMLS_D)
+static int zend_accel_init_shm(void)
{
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
accel_shared_globals = zend_shared_alloc(sizeof(zend_accel_shared_globals));
if (!accel_shared_globals) {
@@ -2212,12 +2207,12 @@ static int zend_accel_init_shm(TSRMLS_D)
# ifndef ZTS
if (ZCG(accel_directives).interned_strings_buffer) {
- accel_use_shm_interned_strings(TSRMLS_C);
- accel_interned_strings_save_state(TSRMLS_C);
+ accel_use_shm_interned_strings();
+ accel_interned_strings_save_state();
}
# endif
- zend_reset_cache_vars(TSRMLS_C);
+ zend_reset_cache_vars();
ZCSG(oom_restarts) = 0;
ZCSG(hash_restarts) = 0;
@@ -2228,19 +2223,19 @@ static int zend_accel_init_shm(TSRMLS_D)
ZCSG(last_restart_time) = 0;
ZCSG(restart_in_progress) = 0;
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
return SUCCESS;
}
-static void accel_globals_ctor(zend_accel_globals *accel_globals TSRMLS_DC)
+static void accel_globals_ctor(zend_accel_globals *accel_globals)
{
#if defined(COMPILE_DL_OPCACHE) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
memset(accel_globals, 0, sizeof(zend_accel_globals));
zend_hash_init(&accel_globals->function_table, zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1);
- zend_accel_copy_internal_functions(TSRMLS_C);
+ zend_accel_copy_internal_functions();
}
static void accel_globals_internal_func_dtor(zval *zv)
@@ -2248,7 +2243,7 @@ static void accel_globals_internal_func_dtor(zval *zv)
free(Z_PTR_P(zv));
}
-static void accel_globals_dtor(zend_accel_globals *accel_globals TSRMLS_DC)
+static void accel_globals_dtor(zend_accel_globals *accel_globals)
{
accel_globals->function_table.pDestructor = accel_globals_internal_func_dtor;
zend_hash_destroy(&accel_globals->function_table);
@@ -2258,7 +2253,6 @@ static int accel_startup(zend_extension *extension)
{
zend_function *func;
zend_ini_entry *ini_entry;
- TSRMLS_FETCH();
#ifdef ZTS
accel_globals_id = ts_allocate_id(&accel_globals_id, sizeof(zend_accel_globals), (ts_allocate_ctor) accel_globals_ctor, (ts_allocate_dtor) accel_globals_dtor);
@@ -2270,20 +2264,20 @@ static int accel_startup(zend_extension *extension)
_setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */
#endif
- if (start_accel_module(TSRMLS_C) == FAILURE) {
+ if (start_accel_module() == FAILURE) {
accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
}
/* no supported SAPI found - disable acceleration and stop initialization */
- if (accel_find_sapi(TSRMLS_C) == FAILURE) {
+ if (accel_find_sapi() == FAILURE) {
accel_startup_ok = 0;
if (!ZCG(accel_directives).enable_cli &&
strcmp(sapi_module.name, "cli") == 0) {
- zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb TSRMLS_CC);
+ zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb);
} else {
- zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb TSRMLS_CC);
+ zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb);
}
return SUCCESS;
}
@@ -2296,7 +2290,7 @@ static int accel_startup(zend_extension *extension)
/********************************************/
switch (zend_shared_alloc_startup(ZCG(accel_directives).memory_consumption)) {
case ALLOC_SUCCESS:
- if (zend_accel_init_shm(TSRMLS_C) == FAILURE) {
+ if (zend_accel_init_shm() == FAILURE) {
accel_startup_ok = 0;
return FAILURE;
}
@@ -2307,7 +2301,7 @@ static int accel_startup(zend_extension *extension)
return SUCCESS;
case SUCCESSFULLY_REATTACHED:
accel_shared_globals = (zend_accel_shared_globals *) ZSMMG(app_shared_globals);
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
orig_new_interned_string = zend_new_interned_string;
orig_interned_strings_snapshot = zend_interned_strings_snapshot;
orig_interned_strings_restore = zend_interned_strings_restore;
@@ -2316,9 +2310,9 @@ static int accel_startup(zend_extension *extension)
zend_interned_strings_snapshot = accel_interned_strings_snapshot_for_php;
zend_interned_strings_restore = accel_interned_strings_restore_for_php;
#ifndef ZTS
- accel_use_shm_interned_strings(TSRMLS_C);
+ accel_use_shm_interned_strings();
#endif
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
break;
case FAILED_REATTACHED:
accel_startup_ok = 0;
@@ -2330,7 +2324,7 @@ static int accel_startup(zend_extension *extension)
/* from this point further, shared memory is supposed to be OK */
/* Init auto-global strings */
- zend_accel_init_auto_globals(TSRMLS_C);
+ zend_accel_init_auto_globals();
/* Override compiler */
accelerator_orig_compile_file = zend_compile_file;
@@ -2365,7 +2359,7 @@ static int accel_startup(zend_extension *extension)
!zend_accel_hash_is_full(&ZCSG(include_paths))) {
char *key;
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
key = zend_shared_alloc(ZCG(include_path_len) + 2);
if (key) {
memcpy(key, ZCG(include_path), ZCG(include_path_len) + 1);
@@ -2373,9 +2367,9 @@ static int accel_startup(zend_extension *extension)
ZCG(include_path_key) = key + ZCG(include_path_len) + 1;
zend_accel_hash_update(&ZCSG(include_paths), key, ZCG(include_path_len), 0, ZCG(include_path_key));
} else {
- zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
+ zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM);
}
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
} else {
ZCG(include_path) = "";
@@ -2385,16 +2379,16 @@ static int accel_startup(zend_extension *extension)
ini_entry->on_modify = accel_include_path_on_modify;
}
- zend_shared_alloc_lock(TSRMLS_C);
+ zend_shared_alloc_lock();
zend_shared_alloc_save_state();
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
SHM_PROTECT();
accel_startup_ok = 1;
/* Override file_exists(), is_file() and is_readable() */
- zend_accel_override_file_functions(TSRMLS_C);
+ zend_accel_override_file_functions();
/* Load black list */
accel_blacklist.entries = NULL;
@@ -2407,7 +2401,7 @@ static int accel_startup(zend_extension *extension)
#if 0
/* FIXME: We probably don't need it here */
- zend_accel_copy_internal_functions(TSRMLS_C);
+ zend_accel_copy_internal_functions();
#endif
return SUCCESS;
@@ -2422,7 +2416,7 @@ static void accel_free_ts_resources()
#endif
}
-void accel_shutdown(TSRMLS_D)
+void accel_shutdown(void)
{
zend_ini_entry *ini_entry;
@@ -2455,7 +2449,7 @@ void accel_shutdown(TSRMLS_D)
}
}
-void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
+void zend_accel_schedule_restart(zend_accel_restart_reason reason)
{
if (ZCSG(restart_pending)) {
/* don't schedule twice */
@@ -2479,9 +2473,9 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
/* this is needed because on WIN32 lock is not decreased unless ZCG(counted) is set */
#ifdef ZEND_WIN32
-#define accel_deactivate_now() ZCG(counted) = 1; accel_deactivate_sub(TSRMLS_C)
+#define accel_deactivate_now() ZCG(counted) = 1; accel_deactivate_sub()
#else
-#define accel_deactivate_now() accel_deactivate_sub(TSRMLS_C)
+#define accel_deactivate_now() accel_deactivate_sub()
#endif
/* ensures it is OK to read SHM
@@ -2489,7 +2483,7 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC)
if OK returns SUCCESS
MUST call accelerator_shm_read_unlock after done lock operations
*/
-int accelerator_shm_read_lock(TSRMLS_D)
+int accelerator_shm_read_lock(void)
{
if (ZCG(counted)) {
/* counted means we are holding read lock for SHM, so that nothing bad can happen */
@@ -2497,7 +2491,7 @@ int accelerator_shm_read_lock(TSRMLS_D)
} else {
/* here accelerator is active but we do not hold SHM lock. This means restart was scheduled
or is in progress now */
- accel_activate_add(TSRMLS_C); /* acquire usage lock */
+ accel_activate_add(); /* acquire usage lock */
/* Now if we weren't inside restart, restart would not begin until we remove usage lock */
if (ZCSG(restart_in_progress)) {
/* we already were inside restart this means it's not safe to touch shm */
@@ -2509,7 +2503,7 @@ int accelerator_shm_read_lock(TSRMLS_D)
}
/* must be called ONLY after SUCCESSFUL accelerator_shm_read_lock */
-void accelerator_shm_read_unlock(TSRMLS_D)
+void accelerator_shm_read_unlock(void)
{
if (!ZCG(counted)) {
/* counted is 0 - meaning we had to readlock manually, release readlock now */
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 119148aa27..9b478ae158 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -296,17 +296,17 @@ extern zend_accel_globals accel_globals;
extern char *zps_api_failure_reason;
-void accel_shutdown(TSRMLS_D);
-void zend_accel_schedule_restart(zend_accel_restart_reason reason TSRMLS_DC);
-void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason TSRMLS_DC);
-int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC);
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force TSRMLS_DC);
-int zend_accel_script_optimize(zend_persistent_script *persistent_script TSRMLS_DC);
-int accelerator_shm_read_lock(TSRMLS_D);
-void accelerator_shm_read_unlock(TSRMLS_D);
-
-char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len TSRMLS_DC);
-zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
+void accel_shutdown(void);
+void zend_accel_schedule_restart(zend_accel_restart_reason reason);
+void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
+int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
+int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force);
+int zend_accel_script_optimize(zend_persistent_script *persistent_script);
+int accelerator_shm_read_lock(void);
+void accelerator_shm_read_unlock(void);
+
+char *accel_make_persistent_key_ex(zend_file_handle *file_handle, int path_length, int *key_len);
+zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type);
#if !defined(ZEND_DECLARE_INHERITED_CLASS_DELAYED)
# define ZEND_DECLARE_INHERITED_CLASS_DELAYED 145
@@ -317,7 +317,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
#define IS_ACCEL_INTERNED(str) \
((char*)(str) >= ZCSG(interned_strings_start) && (char*)(str) < ZCSG(interned_strings_end))
-zend_string *accel_new_interned_string(zend_string *str TSRMLS_DC);
+zend_string *accel_new_interned_string(zend_string *str);
# define ZEND_RESULT_TYPE(opline) (opline)->result_type
# define ZEND_RESULT(opline) (opline)->result
diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c
index 37431fb18a..cab33b5b38 100644
--- a/ext/opcache/shared_alloc_win32.c
+++ b/ext/opcache/shared_alloc_win32.c
@@ -188,7 +188,6 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 };
#endif
void **wanted_mapping_base = default_mapping_base_set;
- TSRMLS_FETCH();
zend_shared_alloc_lock_win32();
/* Mapping retries: When Apache2 restarts, the parent process startup routine
diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c
index 7263ed3c93..cbf0ada9bb 100644
--- a/ext/opcache/zend_accelerator_blacklist.c
+++ b/ext/opcache/zend_accelerator_blacklist.c
@@ -237,7 +237,6 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename)
char buf[MAXPATHLEN + 1], real_path[MAXPATHLEN + 1], *blacklist_path = NULL;
FILE *fp;
int path_length, blacklist_path_length;
- TSRMLS_FETCH();
if ((fp = fopen(filename, "r")) == NULL) {
zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename);
@@ -288,9 +287,9 @@ void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename)
path_dup = zend_strndup(pbuf, path_length);
if (blacklist_path) {
- expand_filepath_ex(path_dup, real_path, blacklist_path, blacklist_path_length TSRMLS_CC);
+ expand_filepath_ex(path_dup, real_path, blacklist_path, blacklist_path_length);
} else {
- expand_filepath(path_dup, real_path TSRMLS_CC);
+ expand_filepath(path_dup, real_path);
}
path_length = strlen(real_path);
@@ -358,11 +357,11 @@ zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *v
return ret;
}
-void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument TSRMLS_DC)
+void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument)
{
int i;
for (i = 0; i < blacklist->pos; i++) {
- func(&blacklist->entries[i], argument TSRMLS_CC);
+ func(&blacklist->entries[i], argument);
}
}
diff --git a/ext/opcache/zend_accelerator_blacklist.h b/ext/opcache/zend_accelerator_blacklist.h
index 1990e414b9..60d6cac925 100644
--- a/ext/opcache/zend_accelerator_blacklist.h
+++ b/ext/opcache/zend_accelerator_blacklist.h
@@ -37,7 +37,7 @@ typedef struct _zend_blacklist {
zend_regexp_list *regexp_list;
} zend_blacklist;
-typedef int (*blacklist_apply_func_arg_t)(zend_blacklist_entry *, zval * TSRMLS_DC);
+typedef int (*blacklist_apply_func_arg_t)(zend_blacklist_entry *, zval *);
extern zend_blacklist accel_blacklist;
@@ -46,6 +46,6 @@ void zend_accel_blacklist_shutdown(zend_blacklist *blacklist);
void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename);
zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *verify_path);
-void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument TSRMLS_DC);
+void zend_accel_blacklist_apply(zend_blacklist *blacklist, blacklist_apply_func_arg_t func, void *argument);
#endif /* ZEND_ACCELERATOR_BLACKLIST_H */
diff --git a/ext/opcache/zend_accelerator_debug.c b/ext/opcache/zend_accelerator_debug.c
index 2a386b812b..feed711bf5 100644
--- a/ext/opcache/zend_accelerator_debug.c
+++ b/ext/opcache/zend_accelerator_debug.c
@@ -34,7 +34,6 @@ void zend_accel_error(int type, const char *format, ...)
time_t timestamp;
char *time_string;
FILE * fLog = NULL;
- TSRMLS_FETCH();
if (type > ZCG(accel_directives).log_verbosity_level) {
return;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 3cde5188ca..03afd4468d 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -83,7 +83,7 @@ static zend_function_entry accel_functions[] = {
{ NULL, NULL, NULL, 0, 0 }
};
-static int validate_api_restriction(TSRMLS_D)
+static int validate_api_restriction(void)
{
if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) {
int len = strlen(ZCG(accel_directives).restrict_api);
@@ -217,7 +217,7 @@ static ZEND_INI_MH(OnEnable)
if (stage == ZEND_INI_STAGE_STARTUP ||
stage == ZEND_INI_STAGE_SHUTDOWN ||
stage == ZEND_INI_STAGE_DEACTIVATE) {
- return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
} else {
/* It may be only temporary disabled */
zend_bool *p;
@@ -278,7 +278,7 @@ ZEND_INI_BEGIN()
#endif
ZEND_INI_END()
-static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
+static int filename_is_in_cache(char *filename, int filename_len)
{
char *key;
int key_length;
@@ -292,14 +292,14 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len);
if (persistent_script) {
return !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
}
}
- if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
+ if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length)) != NULL) {
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length);
return persistent_script && !persistent_script->corrupted &&
- validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
+ validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
}
return 0;
@@ -315,7 +315,7 @@ static int accel_file_in_cache(INTERNAL_FUNCTION_PARAMETERS)
Z_STRLEN(zfilename) == 0) {
return 0;
}
- return filename_is_in_cache(Z_STRVAL(zfilename), Z_STRLEN(zfilename) TSRMLS_CC);
+ return filename_is_in_cache(Z_STRVAL(zfilename), Z_STRLEN(zfilename));
}
static void accel_file_exists(INTERNAL_FUNCTION_PARAMETERS)
@@ -354,7 +354,7 @@ static ZEND_MINIT_FUNCTION(zend_accelerator)
return SUCCESS;
}
-void zend_accel_override_file_functions(TSRMLS_D)
+void zend_accel_override_file_functions(void)
{
zend_function *old_function;
if (ZCG(enabled) && accel_startup_ok && ZCG(accel_directives).file_override_enabled) {
@@ -379,7 +379,7 @@ static ZEND_MSHUTDOWN_FUNCTION(zend_accelerator)
(void)type; /* keep the compiler happy */
UNREGISTER_INI_ENTRIES();
- accel_shutdown(TSRMLS_C);
+ accel_shutdown();
return SUCCESS;
}
@@ -452,14 +452,14 @@ static zend_module_entry accel_module_entry = {
STANDARD_MODULE_PROPERTIES
};
-int start_accel_module(TSRMLS_D)
+int start_accel_module(void)
{
- return zend_startup_module(&accel_module_entry TSRMLS_CC);
+ return zend_startup_module(&accel_module_entry);
}
/* {{{ proto array accelerator_get_scripts()
Get the scripts which are accelerated by ZendAccelerator */
-static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
+static int accelerator_get_scripts(zval *return_value)
{
uint i;
zval persistent_script_report;
@@ -468,7 +468,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
struct timeval exec_time;
struct timeval fetch_time;
- if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock(TSRMLS_C) != SUCCESS) {
+ if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return 0;
}
@@ -502,7 +502,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
zend_hash_str_update(Z_ARRVAL_P(return_value), cache_entry->key, cache_entry->key_length, &persistent_script_report);
}
}
- accelerator_shm_read_unlock(TSRMLS_C);
+ accelerator_shm_read_unlock();
return 1;
}
@@ -515,11 +515,11 @@ static ZEND_FUNCTION(opcache_get_status)
zval memory_usage, statistics, scripts;
zend_bool fetch_scripts = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &fetch_scripts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &fetch_scripts) == FAILURE) {
return;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -574,13 +574,13 @@ static ZEND_FUNCTION(opcache_get_status)
if (fetch_scripts) {
/* accelerated scripts */
- if (accelerator_get_scripts(&scripts TSRMLS_CC)) {
+ if (accelerator_get_scripts(&scripts)) {
add_assoc_zval(return_value, "scripts", &scripts);
}
}
}
-static int add_blacklist_path(zend_blacklist_entry *p, zval *return_value TSRMLS_DC)
+static int add_blacklist_path(zend_blacklist_entry *p, zval *return_value)
{
add_next_index_stringl(return_value, p->path, p->path_length);
return 0;
@@ -596,7 +596,7 @@ static ZEND_FUNCTION(opcache_get_configuration)
RETURN_FALSE;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -642,7 +642,7 @@ static ZEND_FUNCTION(opcache_get_configuration)
/* blacklist */
array_init(&blacklist);
- zend_accel_blacklist_apply(&accel_blacklist, add_blacklist_path, &blacklist TSRMLS_CC);
+ zend_accel_blacklist_apply(&accel_blacklist, add_blacklist_path, &blacklist);
add_assoc_zval(return_value, "blacklist", &blacklist);
}
@@ -654,7 +654,7 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -662,7 +662,7 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
- zend_accel_schedule_restart(ACCEL_RESTART_USER TSRMLS_CC);
+ zend_accel_schedule_restart(ACCEL_RESTART_USER);
RETURN_TRUE;
}
@@ -674,15 +674,15 @@ static ZEND_FUNCTION(opcache_invalidate)
size_t script_name_len;
zend_bool force = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &script_name, &script_name_len, &force) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &script_name, &script_name_len, &force) == FAILURE) {
return;
}
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
- if (zend_accel_invalidate(script_name, script_name_len, force TSRMLS_CC) == SUCCESS) {
+ if (zend_accel_invalidate(script_name, script_name_len, force) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -697,7 +697,7 @@ static ZEND_FUNCTION(opcache_compile_file)
zend_op_array *op_array = NULL;
zend_execute_data *orig_execute_data = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &script_name, &script_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &script_name, &script_name_len) == FAILURE) {
return;
}
@@ -714,20 +714,20 @@ static ZEND_FUNCTION(opcache_compile_file)
orig_execute_data = EG(current_execute_data);
zend_try {
- op_array = persistent_compile_file(&handle, ZEND_INCLUDE TSRMLS_CC);
+ op_array = persistent_compile_file(&handle, ZEND_INCLUDE);
} zend_catch {
EG(current_execute_data) = orig_execute_data;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " could not compile file %s", handle.filename);
} zend_end_try();
if(op_array != NULL) {
- destroy_op_array(op_array TSRMLS_CC);
+ destroy_op_array(op_array);
efree(op_array);
RETVAL_TRUE;
} else {
RETVAL_FALSE;
}
- zend_destroy_file_handle(&handle TSRMLS_CC);
+ zend_destroy_file_handle(&handle);
}
/* {{{ proto bool opcache_is_script_cached(string $script)
@@ -737,7 +737,7 @@ static ZEND_FUNCTION(opcache_is_script_cached)
char *script_name;
size_t script_name_len;
- if (!validate_api_restriction(TSRMLS_C)) {
+ if (!validate_api_restriction()) {
RETURN_FALSE;
}
@@ -745,9 +745,9 @@ static ZEND_FUNCTION(opcache_is_script_cached)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &script_name, &script_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &script_name, &script_name_len) == FAILURE) {
return;
}
- RETURN_BOOL(filename_is_in_cache(script_name, script_name_len TSRMLS_CC));
+ RETURN_BOOL(filename_is_in_cache(script_name, script_name_len));
}
diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h
index c7fe7d8e17..65b984a036 100644
--- a/ext/opcache/zend_accelerator_module.h
+++ b/ext/opcache/zend_accelerator_module.h
@@ -22,8 +22,8 @@
#ifndef ZEND_ACCELERATOR_MODULE_H
#define ZEND_ACCELERATOR_MODULE_H
-int start_accel_module(TSRMLS_D);
+int start_accel_module(void);
-void zend_accel_override_file_functions(TSRMLS_D);
+void zend_accel_override_file_functions(void);
#endif /* _ZEND_ACCELERATOR_MODULE_H */
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 22683245f6..860e18a299 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -48,12 +48,11 @@ static const uint32_t uninitialized_bucket = {INVALID_IDX};
static int zend_prepare_function_for_execution(zend_op_array *op_array);
static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind);
-static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC);
+static zend_ast *zend_ast_clone(zend_ast *ast);
static void zend_accel_destroy_zend_function(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
- TSRMLS_FETCH();
if (function->type == ZEND_USER_FUNCTION) {
if (function->op_array.static_variables) {
@@ -63,7 +62,7 @@ static void zend_accel_destroy_zend_function(zval *zv)
}
}
- destroy_zend_function(function TSRMLS_CC);
+ destroy_zend_function(function);
}
static void zend_accel_destroy_zend_class(zval *zv)
@@ -114,16 +113,16 @@ static int is_not_internal_function(zval *zv)
return(function->type != ZEND_INTERNAL_FUNCTION);
}
-void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC)
+void zend_accel_free_user_functions(HashTable *ht)
{
dtor_func_t orig_dtor = ht->pDestructor;
ht->pDestructor = NULL;
- zend_hash_apply(ht, (apply_func_t) is_not_internal_function TSRMLS_CC);
+ zend_hash_apply(ht, (apply_func_t) is_not_internal_function);
ht->pDestructor = orig_dtor;
}
-static int move_user_function(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int move_user_function(zval *zv, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_function *function = Z_PTR_P(zv);
HashTable *function_table = va_arg(args, HashTable *);
@@ -137,16 +136,16 @@ static int move_user_function(zval *zv TSRMLS_DC, int num_args, va_list args, ze
}
}
-void zend_accel_move_user_functions(HashTable *src, HashTable *dst TSRMLS_DC)
+void zend_accel_move_user_functions(HashTable *src, HashTable *dst)
{
dtor_func_t orig_dtor = src->pDestructor;
src->pDestructor = NULL;
- zend_hash_apply_with_arguments(src TSRMLS_CC, (apply_func_args_t)move_user_function, 1, dst);
+ zend_hash_apply_with_arguments(src, (apply_func_args_t)move_user_function, 1, dst);
src->pDestructor = orig_dtor;
}
-static int copy_internal_function(zval *zv, HashTable *function_table TSRMLS_DC)
+static int copy_internal_function(zval *zv, HashTable *function_table)
{
zend_internal_function *function = Z_PTR_P(zv);
if (function->type == ZEND_INTERNAL_FUNCTION) {
@@ -155,9 +154,9 @@ static int copy_internal_function(zval *zv, HashTable *function_table TSRMLS_DC)
return 0;
}
-void zend_accel_copy_internal_functions(TSRMLS_D)
+void zend_accel_copy_internal_functions(void)
{
- zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table) TSRMLS_CC);
+ zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table));
ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table));
}
@@ -171,7 +170,7 @@ static void zend_destroy_property_info(zval *zv)
}
}
-static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC)
+static inline zend_string *zend_clone_str(zend_string *str)
{
zend_string *ret;
@@ -189,7 +188,7 @@ static inline zend_string *zend_clone_str(zend_string *str TSRMLS_DC)
return ret;
}
-static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
+static inline void zend_clone_zval(zval *src, int bind)
{
void *ptr;
@@ -200,7 +199,7 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
switch (Z_TYPE_P(src)) {
case IS_STRING:
case IS_CONSTANT:
- Z_STR_P(src) = zend_clone_str(Z_STR_P(src) TSRMLS_CC);
+ Z_STR_P(src) = zend_clone_str(Z_STR_P(src));
break;
case IS_ARRAY:
if (Z_ARR_P(src) != &EG(symbol_table)) {
@@ -228,7 +227,7 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
if (bind && Z_REFCOUNT_P(src) > 1) {
accel_xlat_set(old, Z_REF_P(src));
}
- zend_clone_zval(Z_REFVAL_P(src), bind TSRMLS_CC);
+ zend_clone_zval(Z_REFVAL_P(src), bind);
}
break;
case IS_CONSTANT_AST:
@@ -242,13 +241,13 @@ static inline void zend_clone_zval(zval *src, int bind TSRMLS_DC)
if (bind && Z_REFCOUNT_P(src) > 1) {
accel_xlat_set(old, Z_AST_P(src));
}
- Z_ASTVAL_P(src) = zend_ast_clone(Z_ASTVAL_P(src) TSRMLS_CC);
+ Z_ASTVAL_P(src) = zend_ast_clone(Z_ASTVAL_P(src));
}
break;
}
}
-static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
+static zend_ast *zend_ast_clone(zend_ast *ast)
{
uint32_t i;
@@ -257,7 +256,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->kind = ZEND_AST_ZVAL;
copy->attr = ast->attr;
ZVAL_COPY_VALUE(&copy->val, zend_ast_get_zval(ast));
- zend_clone_zval(&copy->val, 0 TSRMLS_CC);
+ zend_clone_zval(&copy->val, 0);
return (zend_ast *) copy;
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
@@ -268,7 +267,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->children = list->children;
for (i = 0; i < list->children; i++) {
if (list->child[i]) {
- copy->child[i] = zend_ast_clone(list->child[i] TSRMLS_CC);
+ copy->child[i] = zend_ast_clone(list->child[i]);
} else {
copy->child[i] = NULL;
}
@@ -281,7 +280,7 @@ static zend_ast *zend_ast_clone(zend_ast *ast TSRMLS_DC)
copy->attr = ast->attr;
for (i = 0; i < children; i++) {
if (ast->child[i]) {
- copy->child[i] = zend_ast_clone(ast->child[i] TSRMLS_CC);
+ copy->child[i] = zend_ast_clone(ast->child[i]);
} else {
copy->child[i] = NULL;
}
@@ -295,7 +294,6 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
uint idx;
Bucket *p, *q, *r;
zend_ulong nIndex;
- TSRMLS_FETCH();
ht->nTableSize = source->nTableSize;
ht->nTableMask = source->nTableMask;
@@ -337,7 +335,7 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
/* Copy data */
ZVAL_COPY_VALUE(&q->val, &p->val);
- zend_clone_zval(&q->val, bind TSRMLS_CC);
+ zend_clone_zval(&q->val, bind);
}
} else {
ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t)));
@@ -359,17 +357,17 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)
if (!p->key) {
q->key = NULL;
} else {
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
}
/* Copy data */
ZVAL_COPY_VALUE(&q->val, &p->val);
- zend_clone_zval(&q->val, bind TSRMLS_CC);
+ zend_clone_zval(&q->val, bind);
}
}
}
-static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce TSRMLS_DC)
+static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce)
{
uint idx;
Bucket *p, *q;
@@ -411,7 +409,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class
/* Initialize key */
q->h = p->h;
ZEND_ASSERT(p->key != NULL);
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
/* Copy data */
ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val)));
@@ -446,7 +444,7 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class
}
}
-static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce TSRMLS_DC)
+static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_class_entry *old_ce, zend_class_entry *ce)
{
uint idx;
Bucket *p, *q;
@@ -487,14 +485,14 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla
/* Initialize key */
q->h = p->h;
ZEND_ASSERT(p->key != NULL);
- q->key = zend_clone_str(p->key TSRMLS_CC);
+ q->key = zend_clone_str(p->key);
/* Copy data */
ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val)));
prop_info = Z_PTR(q->val);
/* Copy constructor */
- prop_info->name = zend_clone_str(prop_info->name TSRMLS_CC);
+ prop_info->name = zend_clone_str(prop_info->name);
if (prop_info->doc_comment) {
if (ZCG(accel_directives).load_comments) {
prop_info->doc_comment = zend_string_dup(prop_info->doc_comment, 0);
@@ -548,7 +546,6 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
zend_class_entry *old_ce = ce;
zend_class_entry *new_ce;
zend_function *new_func;
- TSRMLS_FETCH();
*pce = ce = ARENA_REALLOC(old_ce);
ce->refcount = 1;
@@ -564,11 +561,11 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
ce->default_properties_table = emalloc(sizeof(zval) * old_ce->default_properties_count);
for (i = 0; i < old_ce->default_properties_count; i++) {
ZVAL_COPY_VALUE(&ce->default_properties_table[i], &old_ce->default_properties_table[i]);
- zend_clone_zval(&ce->default_properties_table[i], 1 TSRMLS_CC);
+ zend_clone_zval(&ce->default_properties_table[i], 1);
}
}
- zend_hash_clone_methods(&ce->function_table, &old_ce->function_table, old_ce, ce TSRMLS_CC);
+ zend_hash_clone_methods(&ce->function_table, &old_ce->function_table, old_ce, ce);
/* static members */
if (old_ce->default_static_members_table) {
@@ -577,19 +574,19 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
ce->default_static_members_table = emalloc(sizeof(zval) * old_ce->default_static_members_count);
for (i = 0; i < old_ce->default_static_members_count; i++) {
ZVAL_COPY_VALUE(&ce->default_static_members_table[i], &old_ce->default_static_members_table[i]);
- zend_clone_zval(&ce->default_static_members_table[i], 1 TSRMLS_CC);
+ zend_clone_zval(&ce->default_static_members_table[i], 1);
}
}
ce->static_members_table = ce->default_static_members_table;
/* properties_info */
- zend_hash_clone_prop_info(&ce->properties_info, &old_ce->properties_info, old_ce, ce TSRMLS_CC);
+ zend_hash_clone_prop_info(&ce->properties_info, &old_ce->properties_info, old_ce, ce);
/* constants table */
zend_hash_clone_zval(&ce->constants_table, &old_ce->constants_table, 1);
ce->constants_table.u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
- ce->name = zend_clone_str(ce->name TSRMLS_CC);
+ ce->name = zend_clone_str(ce->name);
/* interfaces aren't really implemented, so we create a new table */
if (ce->num_interfaces) {
@@ -650,17 +647,17 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
if (trait_aliases[i]->trait_method) {
if (trait_aliases[i]->trait_method->method_name) {
trait_aliases[i]->trait_method->method_name =
- zend_clone_str(trait_aliases[i]->trait_method->method_name TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->trait_method->method_name);
}
if (trait_aliases[i]->trait_method->class_name) {
trait_aliases[i]->trait_method->class_name =
- zend_clone_str(trait_aliases[i]->trait_method->class_name TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->trait_method->class_name);
}
}
if (trait_aliases[i]->alias) {
trait_aliases[i]->alias =
- zend_clone_str(trait_aliases[i]->alias TSRMLS_CC);
+ zend_clone_str(trait_aliases[i]->alias);
}
i++;
}
@@ -684,9 +681,9 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
memcpy(trait_precedences[i]->trait_method, ce->trait_precedences[i]->trait_method, sizeof(zend_trait_method_reference));
trait_precedences[i]->trait_method->method_name =
- zend_clone_str(trait_precedences[i]->trait_method->method_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->trait_method->method_name);
trait_precedences[i]->trait_method->class_name =
- zend_clone_str(trait_precedences[i]->trait_method->class_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->trait_method->class_name);
if (trait_precedences[i]->exclude_from_classes) {
zend_string **exclude_from_classes;
@@ -699,7 +696,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
j = 0;
while (trait_precedences[i]->exclude_from_classes[j].class_name) {
exclude_from_classes[j] =
- zend_clone_str(trait_precedences[i]->exclude_from_classes[j].class_name TSRMLS_CC);
+ zend_clone_str(trait_precedences[i]->exclude_from_classes[j].class_name);
j++;
}
exclude_from_classes[j] = NULL;
@@ -712,7 +709,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
}
}
-static void zend_accel_function_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor TSRMLS_DC)
+static void zend_accel_function_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor)
{
zend_function *function1, *function2;
uint idx;
@@ -752,7 +749,7 @@ failure:
function1 = Z_PTR(p->val);
function2 = Z_PTR_P(t);
CG(in_compilation) = 1;
- zend_set_compiled_filename(function1->op_array.filename TSRMLS_CC);
+ zend_set_compiled_filename(function1->op_array.filename);
CG(zend_lineno) = function1->op_array.opcodes[0].lineno;
if (function2->type == ZEND_USER_FUNCTION
&& function2->op_array.last > 0) {
@@ -765,7 +762,7 @@ failure:
}
}
-static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor TSRMLS_DC)
+static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, unique_copy_ctor_func_t pCopyConstructor)
{
zend_class_entry *ce1;
uint idx;
@@ -805,12 +802,12 @@ static void zend_accel_class_hash_copy(HashTable *target, HashTable *source, uni
failure:
ce1 = Z_PTR(p->val);
CG(in_compilation) = 1;
- zend_set_compiled_filename(ce1->info.user.filename TSRMLS_CC);
+ zend_set_compiled_filename(ce1->info.user.filename);
CG(zend_lineno) = ce1->info.user.line_start;
zend_error(E_ERROR, "Cannot redeclare class %s", ce1->name->val);
}
-zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory TSRMLS_DC)
+zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory)
{
zend_op_array *op_array;
@@ -829,12 +826,12 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
/* Copy all the necessary stuff from shared memory to regular memory, and protect the shared script */
if (zend_hash_num_elements(&persistent_script->class_table) > 0) {
- zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, (unique_copy_ctor_func_t) zend_class_copy_ctor TSRMLS_CC);
+ zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, (unique_copy_ctor_func_t) zend_class_copy_ctor);
}
/* we must first to copy all classes and then prepare functions, since functions may try to bind
classes - which depend on pre-bind class entries existent in the class table */
if (zend_hash_num_elements(&persistent_script->function_table) > 0) {
- zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, (unique_copy_ctor_func_t)zend_prepare_function_for_execution TSRMLS_CC);
+ zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, (unique_copy_ctor_func_t)zend_prepare_function_for_execution);
}
zend_prepare_function_for_execution(op_array);
@@ -847,7 +844,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
name = zend_mangle_property_name(haltoff, sizeof(haltoff) - 1, persistent_script->full_path->val, persistent_script->full_path->len, 0);
if (!zend_hash_exists(EG(zend_constants), name)) {
- zend_register_long_constant(name->val, name->len, persistent_script->compiler_halt_offset, CONST_CS, 0 TSRMLS_CC);
+ zend_register_long_constant(name->val, name->len, persistent_script->compiler_halt_offset, CONST_CS, 0);
}
zend_string_release(name);
}
@@ -856,17 +853,17 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,
ZCG(current_persistent_script) = NULL;
} else /* if (!from_shared_memory) */ {
if (zend_hash_num_elements(&persistent_script->function_table) > 0) {
- zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, NULL TSRMLS_CC);
+ zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, NULL);
}
if (zend_hash_num_elements(&persistent_script->class_table) > 0) {
- zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC);
+ zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL);
}
}
if (op_array->early_binding != (uint32_t)-1) {
zend_string *orig_compiled_filename = CG(compiled_filename);
CG(compiled_filename) = persistent_script->full_path;
- zend_do_delayed_early_binding(op_array TSRMLS_CC);
+ zend_do_delayed_early_binding(op_array);
CG(compiled_filename) = orig_compiled_filename;
}
diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h
index cbcb2ffa8e..7b3f099e65 100644
--- a/ext/opcache/zend_accelerator_util_funcs.h
+++ b/ext/opcache/zend_accelerator_util_funcs.h
@@ -25,15 +25,15 @@
#include "zend.h"
#include "ZendAccelerator.h"
-void zend_accel_copy_internal_functions(TSRMLS_D);
+void zend_accel_copy_internal_functions(void);
zend_persistent_script* create_persistent_script(void);
void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements);
-void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC);
-void zend_accel_move_user_functions(HashTable *str, HashTable *dst TSRMLS_DC);
+void zend_accel_free_user_functions(HashTable *ht);
+void zend_accel_move_user_functions(HashTable *str, HashTable *dst);
-zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory TSRMLS_DC);
+zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, int from_shared_memory);
#define ADLER32_INIT 1 /* initial Adler-32 value */
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index f790a5d778..cb4f63b0ef 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -29,9 +29,9 @@
#include "zend_operators.h"
#define zend_accel_store(p, size) \
- (p = _zend_shared_memdup((void*)p, size, 1 TSRMLS_CC))
+ (p = _zend_shared_memdup((void*)p, size, 1))
#define zend_accel_memdup(p, size) \
- _zend_shared_memdup((void*)p, size, 0 TSRMLS_CC)
+ _zend_shared_memdup((void*)p, size, 0)
#define zend_accel_store_string(str) do { \
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
@@ -62,14 +62,14 @@
} \
} while (0)
-typedef void (*zend_persist_func_t)(zval* TSRMLS_DC);
+typedef void (*zend_persist_func_t)(zval*);
-static void zend_persist_zval(zval *z TSRMLS_DC);
-static void zend_persist_zval_const(zval *z TSRMLS_DC);
+static void zend_persist_zval(zval *z);
+static void zend_persist_zval_const(zval *z);
static const uint32_t uninitialized_bucket = {INVALID_IDX};
-static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement TSRMLS_DC)
+static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement)
{
uint idx;
Bucket *p;
@@ -102,11 +102,11 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
}
/* persist the data itself */
- pPersistElement(&p->val TSRMLS_CC);
+ pPersistElement(&p->val);
}
}
-static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC)
+static void zend_hash_persist_immutable(HashTable *ht)
{
uint idx;
Bucket *p;
@@ -138,18 +138,18 @@ static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC)
}
/* persist the data itself */
- zend_persist_zval_const(&p->val TSRMLS_CC);
+ zend_persist_zval_const(&p->val);
}
}
-static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
+static zend_ast *zend_persist_ast(zend_ast *ast)
{
uint32_t i;
zend_ast *node;
if (ast->kind == ZEND_AST_ZVAL) {
zend_ast_zval *copy = zend_accel_memdup(ast, sizeof(zend_ast_zval));
- zend_persist_zval(&copy->val TSRMLS_CC);
+ zend_persist_zval(&copy->val);
node = (zend_ast *) copy;
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
@@ -157,7 +157,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
for (i = 0; i < list->children; i++) {
if (copy->child[i]) {
- copy->child[i] = zend_persist_ast(copy->child[i] TSRMLS_CC);
+ copy->child[i] = zend_persist_ast(copy->child[i]);
}
}
node = (zend_ast *) copy;
@@ -166,7 +166,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
node = zend_accel_memdup(ast, sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
for (i = 0; i < children; i++) {
if (node->child[i]) {
- node->child[i] = zend_persist_ast(node->child[i] TSRMLS_CC);
+ node->child[i] = zend_persist_ast(node->child[i]);
}
}
}
@@ -175,7 +175,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast TSRMLS_DC)
return node;
}
-static void zend_persist_zval(zval *z TSRMLS_DC)
+static void zend_persist_zval(zval *z)
{
zend_uchar flags;
void *new_ptr;
@@ -196,11 +196,11 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
} else {
if (Z_IMMUTABLE_P(z)) {
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
+ zend_hash_persist_immutable(Z_ARRVAL_P(z));
} else {
GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
/* make immutable array */
Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
@@ -214,7 +214,7 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_REF_P(z) = new_ptr;
} else {
zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
- zend_persist_zval(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
@@ -223,13 +223,13 @@ static void zend_persist_zval(zval *z TSRMLS_DC)
Z_AST_P(z) = new_ptr;
} else {
zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
- Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z) TSRMLS_CC);
+ Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_zval_const(zval *z TSRMLS_DC)
+static void zend_persist_zval_const(zval *z)
{
zend_uchar flags;
void *new_ptr;
@@ -250,11 +250,11 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
} else {
if (Z_IMMUTABLE_P(z)) {
Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist_immutable(Z_ARRVAL_P(z) TSRMLS_CC);
+ zend_hash_persist_immutable(Z_ARRVAL_P(z));
} else {
GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
- zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
/* make immutable array */
Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
@@ -268,7 +268,7 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_REF_P(z) = new_ptr;
} else {
zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
- zend_persist_zval(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
@@ -277,13 +277,13 @@ static void zend_persist_zval_const(zval *z TSRMLS_DC)
Z_AST_P(z) = new_ptr;
} else {
zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
- Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z) TSRMLS_CC);
+ Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_script* main_persistent_script TSRMLS_DC)
+static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_script* main_persistent_script)
{
int already_stored = 0;
zend_op *persist_ptr;
@@ -306,14 +306,14 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
memset(&fake_execute_data, 0, sizeof(fake_execute_data));
fake_execute_data.func = (zend_function*)op_array;
EG(current_execute_data) = &fake_execute_data;
- if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) {
+ if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
main_persistent_script->compiler_halt_offset = Z_LVAL_P(offset);
}
EG(current_execute_data) = orig_execute_data;
}
if (op_array->static_variables) {
- zend_hash_persist(op_array->static_variables, zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(op_array->static_variables, zend_persist_zval);
zend_accel_store(op_array->static_variables, sizeof(HashTable));
}
@@ -332,7 +332,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
orig_literals = op_array->literals;
op_array->literals = p;
while (p < end) {
- zend_persist_zval(p TSRMLS_CC);
+ zend_persist_zval(p);
p++;
}
efree(orig_literals);
@@ -487,16 +487,16 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
}
}
-static void zend_persist_op_array(zval *zv TSRMLS_DC)
+static void zend_persist_op_array(zval *zv)
{
memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_op_array));
zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem));
Z_PTR_P(zv) = ZCG(arena_mem);
ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_op_array)));
- zend_persist_op_array_ex(Z_PTR_P(zv), NULL TSRMLS_CC);
+ zend_persist_op_array_ex(Z_PTR_P(zv), NULL);
}
-static void zend_persist_property_info(zval *zv TSRMLS_DC)
+static void zend_persist_property_info(zval *zv)
{
zend_property_info *prop;
@@ -518,7 +518,7 @@ static void zend_persist_property_info(zval *zv TSRMLS_DC)
}
}
-static void zend_persist_class_entry(zval *zv TSRMLS_DC)
+static void zend_persist_class_entry(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
@@ -528,13 +528,13 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
ce = Z_PTR_P(zv) = ZCG(arena_mem);
ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_class_entry)));
zend_accel_store_interned_string(ce->name);
- zend_hash_persist(&ce->function_table, zend_persist_op_array TSRMLS_CC);
+ zend_hash_persist(&ce->function_table, zend_persist_op_array);
if (ce->default_properties_table) {
int i;
zend_accel_store(ce->default_properties_table, sizeof(zval) * ce->default_properties_count);
for (i = 0; i < ce->default_properties_count; i++) {
- zend_persist_zval(&ce->default_properties_table[i] TSRMLS_CC);
+ zend_persist_zval(&ce->default_properties_table[i]);
}
}
if (ce->default_static_members_table) {
@@ -542,12 +542,12 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
zend_accel_store(ce->default_static_members_table, sizeof(zval) * ce->default_static_members_count);
for (i = 0; i < ce->default_static_members_count; i++) {
- zend_persist_zval(&ce->default_static_members_table[i] TSRMLS_CC);
+ zend_persist_zval(&ce->default_static_members_table[i]);
}
}
ce->static_members_table = NULL;
- zend_hash_persist(&ce->constants_table, zend_persist_zval TSRMLS_CC);
+ zend_hash_persist(&ce->constants_table, zend_persist_zval);
if (ZEND_CE_FILENAME(ce)) {
/* do not free! PHP has centralized filename storage, compiler will free it */
@@ -564,7 +564,7 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
ZEND_CE_DOC_COMMENT(ce) = NULL;
}
}
- zend_hash_persist(&ce->properties_info, zend_persist_property_info TSRMLS_CC);
+ zend_hash_persist(&ce->properties_info, zend_persist_property_info);
if (ce->num_interfaces && ce->interfaces) {
efree(ce->interfaces);
}
@@ -631,7 +631,7 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC)
}
}
-static int zend_update_property_info_ce(zval *zv TSRMLS_DC)
+static int zend_update_property_info_ce(zval *zv)
{
zend_property_info *prop = Z_PTR_P(zv);
@@ -639,7 +639,7 @@ static int zend_update_property_info_ce(zval *zv TSRMLS_DC)
return 0;
}
-static int zend_update_parent_ce(zval *zv TSRMLS_DC)
+static int zend_update_parent_ce(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
@@ -703,17 +703,17 @@ static int zend_update_parent_ce(zval *zv TSRMLS_DC)
ce->__debugInfo = zend_shared_alloc_get_xlat_entry(ce->__debugInfo);
ce->__debugInfo->op_array.refcount++;
}
- zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce TSRMLS_CC);
+ zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce);
return 0;
}
-static void zend_accel_persist_class_table(HashTable *class_table TSRMLS_DC)
+static void zend_accel_persist_class_table(HashTable *class_table)
{
- zend_hash_persist(class_table, zend_persist_class_entry TSRMLS_CC);
- zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce TSRMLS_CC);
+ zend_hash_persist(class_table, zend_persist_class_entry);
+ zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
}
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length TSRMLS_DC)
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
{
script->mem = ZCG(mem);
@@ -726,9 +726,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
script->arena_mem = ZCG(arena_mem) = ZCG(mem);
ZCG(mem) = (void*)((char*)ZCG(mem) + script->arena_size);
- zend_accel_persist_class_table(&script->class_table TSRMLS_CC);
- zend_hash_persist(&script->function_table, zend_persist_op_array TSRMLS_CC);
- zend_persist_op_array_ex(&script->main_op_array, script TSRMLS_CC);
+ zend_accel_persist_class_table(&script->class_table);
+ zend_hash_persist(&script->function_table, zend_persist_op_array);
+ zend_persist_op_array_ex(&script->main_op_array, script);
return script;
}
diff --git a/ext/opcache/zend_persist.h b/ext/opcache/zend_persist.h
index 1b95a4ab04..1ae7fabf4e 100644
--- a/ext/opcache/zend_persist.h
+++ b/ext/opcache/zend_persist.h
@@ -23,7 +23,7 @@
#define ZEND_PERSIST_H
int zend_accel_script_persistable(zend_persistent_script *script);
-uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length TSRMLS_DC);
-zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length TSRMLS_DC);
+uint zend_accel_script_persist_calc(zend_persistent_script *script, char *key, unsigned int key_length);
+zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length);
#endif /* ZEND_PERSIST_H */
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index 6a35c5ca9b..9e96d5da42 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -35,7 +35,7 @@
ADD_DUP_SIZE((str), _STR_HEADER_SIZE + (str)->len + 1)
# define ADD_INTERNED_STRING(str, do_free) do { \
if (!IS_ACCEL_INTERNED(str)) { \
- zend_string *tmp = accel_new_interned_string(str TSRMLS_CC); \
+ zend_string *tmp = accel_new_interned_string(str); \
if (tmp != (str)) { \
if (do_free) { \
/*zend_string_release(str);*/ \
@@ -47,9 +47,9 @@
} \
} while (0)
-static void zend_persist_zval_calc(zval *z TSRMLS_DC);
+static void zend_persist_zval_calc(zval *z);
-static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement TSRMLS_DC) TSRMLS_DC)
+static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement))
{
uint idx;
Bucket *p;
@@ -74,23 +74,23 @@ static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *
GC_FLAGS(p->key) |= flags;
}
- pPersistElement(&p->val TSRMLS_CC);
+ pPersistElement(&p->val);
}
}
-static void zend_persist_ast_calc(zend_ast *ast TSRMLS_DC)
+static void zend_persist_ast_calc(zend_ast *ast)
{
uint32_t i;
if (ast->kind == ZEND_AST_ZVAL) {
ADD_SIZE(sizeof(zend_ast_zval));
- zend_persist_zval_calc(zend_ast_get_zval(ast) TSRMLS_CC);
+ zend_persist_zval_calc(zend_ast_get_zval(ast));
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
ADD_SIZE(sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
for (i = 0; i < list->children; i++) {
if (list->child[i]) {
- zend_persist_ast_calc(list->child[i] TSRMLS_CC);
+ zend_persist_ast_calc(list->child[i]);
}
}
} else {
@@ -98,13 +98,13 @@ static void zend_persist_ast_calc(zend_ast *ast TSRMLS_DC)
ADD_SIZE(sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
for (i = 0; i < children; i++) {
if (ast->child[i]) {
- zend_persist_ast_calc(ast->child[i] TSRMLS_CC);
+ zend_persist_ast_calc(ast->child[i]);
}
}
}
}
-static void zend_persist_zval_calc(zval *z TSRMLS_DC)
+static void zend_persist_zval_calc(zval *z)
{
zend_uchar flags;
uint size;
@@ -123,27 +123,27 @@ static void zend_persist_zval_calc(zval *z TSRMLS_DC)
size = zend_shared_memdup_size(Z_ARR_P(z), sizeof(zend_array));
if (size) {
ADD_SIZE(size);
- zend_hash_persist_calc(Z_ARRVAL_P(z), zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(Z_ARRVAL_P(z), zend_persist_zval_calc);
}
break;
case IS_REFERENCE:
size = zend_shared_memdup_size(Z_REF_P(z), sizeof(zend_reference));
if (size) {
ADD_SIZE(size);
- zend_persist_zval_calc(Z_REFVAL_P(z) TSRMLS_CC);
+ zend_persist_zval_calc(Z_REFVAL_P(z));
}
break;
case IS_CONSTANT_AST:
size = zend_shared_memdup_size(Z_AST_P(z), sizeof(zend_ast_ref));
if (size) {
ADD_SIZE(size);
- zend_persist_ast_calc(Z_ASTVAL_P(z) TSRMLS_CC);
+ zend_persist_ast_calc(Z_ASTVAL_P(z));
}
break;
}
}
-static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
+static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
{
if (op_array->type != ZEND_USER_FUNCTION) {
return;
@@ -151,7 +151,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
if (op_array->static_variables) {
ADD_DUP_SIZE(op_array->static_variables, sizeof(HashTable));
- zend_hash_persist_calc(op_array->static_variables, zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(op_array->static_variables, zend_persist_zval_calc);
}
if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) {
@@ -170,7 +170,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
zval *end = p + op_array->last_literal;
ADD_DUP_SIZE(op_array->literals, sizeof(zval) * op_array->last_literal);
while (p < end) {
- zend_persist_zval_calc(p TSRMLS_CC);
+ zend_persist_zval_calc(p);
p++;
}
}
@@ -230,13 +230,13 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)
}
}
-static void zend_persist_op_array_calc(zval *zv TSRMLS_DC)
+static void zend_persist_op_array_calc(zval *zv)
{
ADD_ARENA_SIZE(sizeof(zend_op_array));
- zend_persist_op_array_calc_ex(Z_PTR_P(zv) TSRMLS_CC);
+ zend_persist_op_array_calc_ex(Z_PTR_P(zv));
}
-static void zend_persist_property_info_calc(zval *zv TSRMLS_DC)
+static void zend_persist_property_info_calc(zval *zv)
{
zend_property_info *prop = Z_PTR_P(zv);
@@ -247,20 +247,20 @@ static void zend_persist_property_info_calc(zval *zv TSRMLS_DC)
}
}
-static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
+static void zend_persist_class_entry_calc(zval *zv)
{
zend_class_entry *ce = Z_PTR_P(zv);
if (ce->type == ZEND_USER_CLASS) {
ADD_ARENA_SIZE(sizeof(zend_class_entry));
ADD_INTERNED_STRING(ce->name, 0);
- zend_hash_persist_calc(&ce->function_table, zend_persist_op_array_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->function_table, zend_persist_op_array_calc);
if (ce->default_properties_table) {
int i;
ADD_SIZE(sizeof(zval) * ce->default_properties_count);
for (i = 0; i < ce->default_properties_count; i++) {
- zend_persist_zval_calc(&ce->default_properties_table[i] TSRMLS_CC);
+ zend_persist_zval_calc(&ce->default_properties_table[i]);
}
}
if (ce->default_static_members_table) {
@@ -268,10 +268,10 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
ADD_SIZE(sizeof(zval) * ce->default_static_members_count);
for (i = 0; i < ce->default_static_members_count; i++) {
- zend_persist_zval_calc(&ce->default_static_members_table[i] TSRMLS_CC);
+ zend_persist_zval_calc(&ce->default_static_members_table[i]);
}
}
- zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc);
if (ZEND_CE_FILENAME(ce)) {
ADD_STRING(ZEND_CE_FILENAME(ce));
@@ -280,7 +280,7 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
ADD_STRING(ZEND_CE_DOC_COMMENT(ce));
}
- zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc TSRMLS_CC);
+ zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc);
if (ce->trait_aliases) {
int i = 0;
@@ -329,12 +329,12 @@ static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC)
}
}
-static void zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC)
+static void zend_accel_persist_class_table_calc(HashTable *class_table)
{
- zend_hash_persist_calc(class_table, zend_persist_class_entry_calc TSRMLS_CC);
+ zend_hash_persist_calc(class_table, zend_persist_class_entry_calc);
}
-uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length TSRMLS_DC)
+uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length)
{
new_persistent_script->mem = NULL;
new_persistent_script->size = 0;
@@ -346,9 +346,9 @@ uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_scrip
ADD_DUP_SIZE(key, key_length + 1);
ADD_STRING(new_persistent_script->full_path);
- zend_accel_persist_class_table_calc(&new_persistent_script->class_table TSRMLS_CC);
- zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc TSRMLS_CC);
- zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array TSRMLS_CC);
+ zend_accel_persist_class_table_calc(&new_persistent_script->class_table);
+ zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc);
+ zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array);
new_persistent_script->size += new_persistent_script->arena_size;
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index 43a0263ee5..4036abe06f 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -157,7 +157,6 @@ int zend_shared_alloc_startup(size_t requested_size)
const zend_shared_memory_handler_entry *he;
int res = ALLOC_FAILURE;
- TSRMLS_FETCH();
/* shared_free must be valid before we call zend_shared_alloc()
* - make it temporarily point to a local variable
@@ -298,7 +297,6 @@ void *zend_shared_alloc(size_t size)
{
int i;
unsigned int block_size = ZEND_ALIGNED_SIZE(size);
- TSRMLS_FETCH();
#if 1
if (!ZCG(locked)) {
@@ -335,7 +333,7 @@ int zend_shared_memdup_size(void *source, size_t size)
return ZEND_ALIGNED_SIZE(size);
}
-void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRMLS_DC)
+void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source)
{
void *old_p, *retval;
@@ -353,10 +351,10 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRML
return retval;
}
-void zend_shared_alloc_safe_unlock(TSRMLS_D)
+void zend_shared_alloc_safe_unlock(void)
{
if (ZCG(locked)) {
- zend_shared_alloc_unlock(TSRMLS_C);
+ zend_shared_alloc_unlock();
}
}
@@ -366,7 +364,7 @@ static FLOCK_STRUCTURE(mem_write_lock, F_WRLCK, SEEK_SET, 0, 1);
static FLOCK_STRUCTURE(mem_write_unlock, F_UNLCK, SEEK_SET, 0, 1);
#endif
-void zend_shared_alloc_lock(TSRMLS_D)
+void zend_shared_alloc_lock(void)
{
#ifndef ZEND_WIN32
@@ -405,7 +403,7 @@ void zend_shared_alloc_lock(TSRMLS_D)
zend_hash_init(&xlat_table, 128, NULL, NULL, 1);
}
-void zend_shared_alloc_unlock(TSRMLS_D)
+void zend_shared_alloc_unlock(void)
{
/* Destroy translation table */
zend_hash_destroy(&xlat_table);
@@ -476,7 +474,7 @@ const char *zend_accel_get_shared_model(void)
return g_shared_model;
}
-void zend_accel_shared_protect(int mode TSRMLS_DC)
+void zend_accel_shared_protect(int mode)
{
#ifdef HAVE_MPROTECT
int i;
diff --git a/ext/opcache/zend_shared_alloc.h b/ext/opcache/zend_shared_alloc.h
index ec7cc14d07..1476073f71 100644
--- a/ext/opcache/zend_shared_alloc.h
+++ b/ext/opcache/zend_shared_alloc.h
@@ -124,7 +124,7 @@ void zend_shared_alloc_shutdown(void);
void *zend_shared_alloc(size_t size);
/* copy into shared memory */
-void *_zend_shared_memdup(void *p, size_t size, zend_bool free_source TSRMLS_DC);
+void *_zend_shared_memdup(void *p, size_t size, zend_bool free_source);
int zend_shared_memdup_size(void *p, size_t size);
typedef union _align_test {
@@ -143,9 +143,9 @@ typedef union _align_test {
((size + PLATFORM_ALIGNMENT - 1) & ~(PLATFORM_ALIGNMENT - 1))
/* exclusive locking */
-void zend_shared_alloc_lock(TSRMLS_D);
-void zend_shared_alloc_unlock(TSRMLS_D); /* returns the allocated size during lock..unlock */
-void zend_shared_alloc_safe_unlock(TSRMLS_D);
+void zend_shared_alloc_lock(void);
+void zend_shared_alloc_unlock(void); /* returns the allocated size during lock..unlock */
+void zend_shared_alloc_safe_unlock(void);
/* old/new mapping functions */
void zend_shared_alloc_clear_xlat_table(void);
@@ -158,7 +158,7 @@ void zend_shared_alloc_restore_state(void);
const char *zend_accel_get_shared_model(void);
/* memory write protection */
-void zend_accel_shared_protect(int mode TSRMLS_DC);
+void zend_accel_shared_protect(int mode);
#ifdef USE_MMAP
extern zend_shared_memory_handlers zend_alloc_mmap_handlers;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 60d36ff743..a69ce8190b 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -542,7 +542,7 @@ int php_openssl_get_x509_list_id(void) /* {{{ */
/* }}} */
/* {{{ resource destructors */
-static void php_pkey_free(zend_resource *rsrc TSRMLS_DC)
+static void php_pkey_free(zend_resource *rsrc)
{
EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr;
@@ -551,13 +551,13 @@ static void php_pkey_free(zend_resource *rsrc TSRMLS_DC)
EVP_PKEY_free(pkey);
}
-static void php_x509_free(zend_resource *rsrc TSRMLS_DC)
+static void php_x509_free(zend_resource *rsrc)
{
X509 *x509 = (X509 *)rsrc->ptr;
X509_free(x509);
}
-static void php_csr_free(zend_resource *rsrc TSRMLS_DC)
+static void php_csr_free(zend_resource *rsrc)
{
X509_REQ * csr = (X509_REQ*)rsrc->ptr;
X509_REQ_free(csr);
@@ -565,9 +565,9 @@ static void php_csr_free(zend_resource *rsrc TSRMLS_DC)
/* }}} */
/* {{{ openssl open_basedir check */
-inline static int php_openssl_open_base_dir_chk(char *filename TSRMLS_DC)
+inline static int php_openssl_open_base_dir_chk(char *filename)
{
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
return -1;
}
@@ -615,15 +615,15 @@ struct php_x509_request { /* {{{ */
};
/* }}} */
-static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC);
-static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval TSRMLS_DC);
-static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC);
-static X509_STORE * setup_verify(zval * calist TSRMLS_DC);
+static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval);
+static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval);
+static int php_openssl_is_private_key(EVP_PKEY* pkey);
+static X509_STORE * setup_verify(zval * calist);
static STACK_OF(X509) * load_all_certs_from_file(char *certfile);
-static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource ** resourceval TSRMLS_DC);
-static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC);
+static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource ** resourceval);
+static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req);
-static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname TSRMLS_DC) /* {{{ */
+static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int shortname) /* {{{ */
{
zval *data;
zval subitem, tmp;
@@ -690,7 +690,7 @@ static void add_assoc_asn1_string(zval * val, char * key, ASN1_STRING * str) /*
}
/* }}} */
-static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
+static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
{
/*
This is how the time string is formatted:
@@ -706,22 +706,22 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
long gmadjust = 0;
if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME && ASN1_STRING_type(timestr) != V_ASN1_GENERALIZEDTIME) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp");
+ php_error_docref(NULL, E_WARNING, "illegal ASN1 data type for timestamp");
return (time_t)-1;
}
if (ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal length in timestamp");
+ php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
return (time_t)-1;
}
if (ASN1_STRING_length(timestr) < 13) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data);
+ php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
if (ASN1_STRING_type(timestr) == V_ASN1_GENERALIZEDTIME && ASN1_STRING_length(timestr) < 15) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data);
+ php_error_docref(NULL, E_WARNING, "unable to parse time string %s correctly", timestr->data);
return (time_t)-1;
}
@@ -783,9 +783,9 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */
/* }}} */
#if OPENSSL_VERSION_NUMBER >= 0x10000002L
-static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config TSRMLS_DC) /* {{{ */
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH_OF(CONF_VALUE) * config) /* {{{ */
#else
-static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config TSRMLS_DC)
+static inline int php_openssl_config_check_syntax(const char * section_label, const char * config_filename, const char * section, LHASH * config)
#endif
{
X509V3_CTX ctx;
@@ -793,7 +793,7 @@ static inline int php_openssl_config_check_syntax(const char * section_label, co
X509V3_set_ctx_test(&ctx);
X509V3_set_conf_lhash(&ctx, config);
if (!X509V3_EXT_add_conf(config, &ctx, (char *)section, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading %s section %s of %s",
+ php_error_docref(NULL, E_WARNING, "Error loading %s section %s of %s",
section_label,
section,
config_filename);
@@ -803,7 +803,7 @@ static inline int php_openssl_config_check_syntax(const char * section_label, co
}
/* }}} */
-static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
+static int add_oid_section(struct php_x509_request * req) /* {{{ */
{
char * str;
STACK_OF(CONF_VALUE) * sktmp;
@@ -816,13 +816,13 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
}
sktmp = CONF_get_section(req->req_config, str);
if (sktmp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem loading oid section %s", str);
+ php_error_docref(NULL, E_WARNING, "problem loading oid section %s", str);
return FAILURE;
}
for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
cnf = sk_CONF_VALUE_value(sktmp, i);
if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value);
+ php_error_docref(NULL, E_WARNING, "problem creating object %s=%s", cnf->name, cnf->value);
return FAILURE;
}
}
@@ -831,11 +831,11 @@ static int add_oid_section(struct php_x509_request * req TSRMLS_DC) /* {{{ */
/* }}} */
#define PHP_SSL_REQ_INIT(req) memset(req, 0, sizeof(*req))
-#define PHP_SSL_REQ_DISPOSE(req) php_openssl_dispose_config(req TSRMLS_CC)
-#define PHP_SSL_REQ_PARSE(req, zval) php_openssl_parse_config(req, zval TSRMLS_CC)
+#define PHP_SSL_REQ_DISPOSE(req) php_openssl_dispose_config(req)
+#define PHP_SSL_REQ_PARSE(req, zval) php_openssl_parse_config(req, zval)
#define PHP_SSL_CONFIG_SYNTAX_CHECK(var) if (req->var && php_openssl_config_check_syntax(#var, \
- req->config_filename, req->var, req->req_config TSRMLS_CC) == FAILURE) return FAILURE
+ req->config_filename, req->var, req->req_config) == FAILURE) return FAILURE
#define SET_OPTIONAL_STRING_ARG(key, varname, defval) \
if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key, sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_STRING) \
@@ -853,7 +853,7 @@ static const EVP_CIPHER * php_openssl_get_evp_cipher_from_algo(zend_long algo);
int openssl_spki_cleanup(const char *src, char *dest);
-static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args TSRMLS_DC) /* {{{ */
+static int php_openssl_parse_config(struct php_x509_request * req, zval * optional_args) /* {{{ */
{
char * str;
zval * item;
@@ -869,14 +869,14 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
/* read in the oids */
str = CONF_get_string(req->req_config, NULL, "oid_file");
- if (str && !php_openssl_open_base_dir_chk(str TSRMLS_CC)) {
+ if (str && !php_openssl_open_base_dir_chk(str)) {
BIO *oid_bio = BIO_new_file(str, "r");
if (oid_bio) {
OBJ_create_objects(oid_bio);
BIO_free(oid_bio);
}
}
- if (add_oid_section(req TSRMLS_CC) == FAILURE) {
+ if (add_oid_section(req) == FAILURE) {
return FAILURE;
}
SET_OPTIONAL_STRING_ARG("digest_alg", req->digest_name,
@@ -909,7 +909,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
zend_long cipher_algo = Z_LVAL_P(item);
const EVP_CIPHER* cipher = php_openssl_get_evp_cipher_from_algo(cipher_algo);
if (cipher == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm for private key.");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm for private key.");
return FAILURE;
} else {
req->priv_key_encrypt_cipher = cipher;
@@ -936,7 +936,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
/* set the string mask */
str = CONF_get_string(req->req_config, req->section_name, "string_mask");
if (str && !ASN1_STRING_set_default_mask_asc(str)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid global string mask setting %s", str);
+ php_error_docref(NULL, E_WARNING, "Invalid global string mask setting %s", str);
return FAILURE;
}
@@ -946,7 +946,7 @@ static int php_openssl_parse_config(struct php_x509_request * req, zval * option
}
/* }}} */
-static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC) /* {{{ */
+static void php_openssl_dispose_config(struct php_x509_request * req) /* {{{ */
{
if (req->priv_key) {
EVP_PKEY_free(req->priv_key);
@@ -963,7 +963,7 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC)
}
/* }}} */
-static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */
+static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
{
char buffer[MAXPATHLEN];
@@ -980,7 +980,7 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se
}
if (file == NULL || !RAND_load_file(file, -1)) {
if (RAND_status() == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to load random state; not enough random data!");
+ php_error_docref(NULL, E_WARNING, "unable to load random state; not enough random data!");
return FAILURE;
}
return FAILURE;
@@ -994,7 +994,6 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see
{
char buffer[MAXPATHLEN];
- TSRMLS_FETCH();
if (egdsocket || !seeded) {
/* if we did not manage to read the seed file, we should not write
@@ -1005,7 +1004,7 @@ static int php_openssl_write_rand_file(const char * file, int egdsocket, int see
file = RAND_file_name(buffer, sizeof(buffer));
}
if (file == NULL || !RAND_write_file(file)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to write random state");
+ php_error_docref(NULL, E_WARNING, "unable to write random state");
return FAILURE;
}
return SUCCESS;
@@ -1227,23 +1226,23 @@ PHP_MINIT_FUNCTION(openssl)
strlcpy(default_ssl_conf_filename, config_filename, sizeof(default_ssl_conf_filename));
}
- php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("ssl", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory);
#ifndef OPENSSL_NO_SSL2
- php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory);
#endif
- php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("tlsv1.0", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tls", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("tlsv1.0", php_openssl_ssl_socket_factory);
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
- php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory TSRMLS_CC);
- php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tlsv1.1", php_openssl_ssl_socket_factory);
+ php_stream_xport_register("tlsv1.2", php_openssl_ssl_socket_factory);
#endif
/* override the default tcp socket provider */
- php_stream_xport_register("tcp", php_openssl_ssl_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tcp", php_openssl_ssl_socket_factory);
- php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("https", &php_stream_http_wrapper);
+ php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper);
REGISTER_INI_ENTRIES();
@@ -1270,23 +1269,23 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
{
EVP_cleanup();
- php_unregister_url_stream_wrapper("https" TSRMLS_CC);
- php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("https");
+ php_unregister_url_stream_wrapper("ftps");
- php_stream_xport_unregister("ssl" TSRMLS_CC);
+ php_stream_xport_unregister("ssl");
#ifndef OPENSSL_NO_SSL2
- php_stream_xport_unregister("sslv2" TSRMLS_CC);
+ php_stream_xport_unregister("sslv2");
#endif
- php_stream_xport_unregister("sslv3" TSRMLS_CC);
- php_stream_xport_unregister("tls" TSRMLS_CC);
- php_stream_xport_unregister("tlsv1.0" TSRMLS_CC);
+ php_stream_xport_unregister("sslv3");
+ php_stream_xport_unregister("tls");
+ php_stream_xport_unregister("tlsv1.0");
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
- php_stream_xport_unregister("tlsv1.1" TSRMLS_CC);
- php_stream_xport_unregister("tlsv1.2" TSRMLS_CC);
+ php_stream_xport_unregister("tlsv1.1");
+ php_stream_xport_unregister("tlsv1.2");
#endif
/* reinstate the default tcp handler */
- php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC);
+ php_stream_xport_register("tcp", php_stream_generic_socket_factory);
UNREGISTER_INI_ENTRIES();
@@ -1325,7 +1324,7 @@ PHP_FUNCTION(openssl_get_cert_locations)
If you supply makeresource, the result will be registered as an x509 resource and
it's value returned in makeresource.
*/
-static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_resource **resourceval)
{
X509 *cert = NULL;
@@ -1337,7 +1336,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509", &type, 1, le_x509);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509", &type, 1, le_x509);
if (!what) {
return NULL;
}
@@ -1365,7 +1364,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
/* read cert from the named file */
BIO *in;
- if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1) TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(Z_STRVAL_P(val) + (sizeof("file://") - 1))) {
return NULL;
}
@@ -1391,7 +1390,7 @@ static X509 * php_openssl_x509_from_zval(zval * val, int makeresource, zend_reso
}
if (cert && makeresource && resourceval) {
- *resourceval = zend_register_resource(NULL, cert, le_x509 TSRMLS_CC);
+ *resourceval = zend_register_resource(NULL, cert, le_x509);
}
return cert;
}
@@ -1410,18 +1409,18 @@ PHP_FUNCTION(openssl_x509_export_to_file)
char * filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zp|b", &zcert, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return;
}
@@ -1434,7 +1433,7 @@ PHP_FUNCTION(openssl_x509_export_to_file)
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
if (certresource == NULL && cert) {
X509_free(cert);
@@ -1461,15 +1460,15 @@ PHP_FUNCTION(openssl_spki_new)
NETSCAPE_SPKI *spki=NULL;
const EVP_MD *mdtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z", &zpkey, &challenge, &challenge_len, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z", &zpkey, &challenge, &challenge_len, &method) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, 1, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(zpkey, 0, challenge, 1, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied private key");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied private key");
goto cleanup;
}
@@ -1477,19 +1476,19 @@ PHP_FUNCTION(openssl_spki_new)
if (Z_TYPE_P(method) == IS_LONG) {
algo = Z_LVAL_P(method);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Algorithm must be of supported type");
+ php_error_docref(NULL, E_WARNING, "Algorithm must be of supported type");
goto cleanup;
}
}
mdtype = php_openssl_get_evp_md_from_algo(algo);
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
goto cleanup;
}
if ((spki = NETSCAPE_SPKI_new()) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create new SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to create new SPKAC");
goto cleanup;
}
@@ -1498,18 +1497,18 @@ PHP_FUNCTION(openssl_spki_new)
}
if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to embed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to embed public key");
goto cleanup;
}
if (!NETSCAPE_SPKI_sign(spki, pkey, mdtype)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to sign with specified algorithm");
+ php_error_docref(NULL, E_WARNING, "Unable to sign with specified algorithm");
goto cleanup;
}
spkstr = NETSCAPE_SPKI_b64_encode(spki);
if (!spkstr){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to encode SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to encode SPKAC");
goto cleanup;
}
@@ -1553,13 +1552,13 @@ PHP_FUNCTION(openssl_spki_verify)
EVP_PKEY *pkey = NULL;
NETSCAPE_SPKI *spki = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1567,19 +1566,19 @@ PHP_FUNCTION(openssl_spki_verify)
openssl_spki_cleanup(spkstr, spkstr_cleaned);
if (strlen(spkstr_cleaned)<=0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SPKAC");
+ php_error_docref(NULL, E_WARNING, "Invalid SPKAC");
goto cleanup;
}
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC");
goto cleanup;
}
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key");
goto cleanup;
}
@@ -1614,13 +1613,13 @@ PHP_FUNCTION(openssl_spki_export)
NETSCAPE_SPKI *spki = NULL;
BIO *out = BIO_new(BIO_s_mem());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1629,13 +1628,13 @@ PHP_FUNCTION(openssl_spki_export)
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode supplied SPKAC");
goto cleanup;
}
pkey = X509_PUBKEY_get(spki->spkac->pubkey);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to acquire signed public key");
+ php_error_docref(NULL, E_WARNING, "Unable to acquire signed public key");
goto cleanup;
}
@@ -1672,13 +1671,13 @@ PHP_FUNCTION(openssl_spki_export_challenge)
NETSCAPE_SPKI *spki = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &spkstr, &spkstr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &spkstr, &spkstr_len) == FAILURE) {
return;
}
RETVAL_FALSE;
if (spkstr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to use supplied SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to use supplied SPKAC");
goto cleanup;
}
@@ -1687,7 +1686,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
spki = NETSCAPE_SPKI_b64_decode(spkstr_cleaned, strlen(spkstr_cleaned));
if (spki == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to decode SPKAC");
+ php_error_docref(NULL, E_WARNING, "Unable to decode SPKAC");
goto cleanup;
}
@@ -1729,14 +1728,14 @@ PHP_FUNCTION(openssl_x509_export)
BIO * bio_out;
zend_resource *certresource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/|b", &zcert, &zout, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|b", &zcert, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
@@ -1761,7 +1760,7 @@ PHP_FUNCTION(openssl_x509_export)
}
/* }}} */
-zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw TSRMLS_DC)
+zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw)
{
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
@@ -1769,10 +1768,10 @@ zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_b
zend_string *ret;
if (!(mdtype = EVP_get_digestbyname(method))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
return NULL;
} else if (!X509_digest(peer, mdtype, md, &n)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not generate signature");
+ php_error_docref(NULL, E_ERROR, "Could not generate signature");
return NULL;
}
@@ -1797,17 +1796,17 @@ PHP_FUNCTION(openssl_x509_fingerprint)
size_t method_len;
zend_string *fingerprint;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|sb", &zcert, &method, &method_len, &raw_output) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
RETURN_FALSE;
}
- fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output TSRMLS_CC);
+ fingerprint = php_openssl_x509_fingerprint(cert, method, raw_output);
if (fingerprint) {
RETVAL_STR(fingerprint);
} else {
@@ -1830,14 +1829,14 @@ PHP_FUNCTION(openssl_x509_check_private_key)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zcert, &zkey) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zcert, &zkey) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
RETURN_FALSE;
}
- key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zkey, 0, "", 1, &keyresource);
if (key) {
RETVAL_BOOL(X509_check_private_key(cert, key));
}
@@ -1936,10 +1935,10 @@ PHP_FUNCTION(openssl_x509_parse)
BUF_MEM *bio_buf;
char buf[256];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcert, &useshortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcert, &useshortnames) == FAILURE) {
return;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
RETURN_FALSE;
}
@@ -1950,7 +1949,7 @@ PHP_FUNCTION(openssl_x509_parse)
}
/* add_assoc_bool(return_value, "valid", cert->valid); */
- add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, "subject", X509_get_subject_name(cert), useshortnames);
/* hash as used in CA directories to lookup cert by subject name */
{
char buf[32];
@@ -1958,7 +1957,7 @@ PHP_FUNCTION(openssl_x509_parse)
add_assoc_string(return_value, "hash", buf);
}
- add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, "issuer", X509_get_issuer_name(cert), useshortnames);
add_assoc_long(return_value, "version", X509_get_version(cert));
add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert)));
@@ -1966,8 +1965,8 @@ PHP_FUNCTION(openssl_x509_parse)
add_assoc_asn1_string(return_value, "validFrom", X509_get_notBefore(cert));
add_assoc_asn1_string(return_value, "validTo", X509_get_notAfter(cert));
- add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert) TSRMLS_CC));
- add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert) TSRMLS_CC));
+ add_assoc_long(return_value, "validFrom_time_t", asn1_time_to_time_t(X509_get_notBefore(cert)));
+ add_assoc_long(return_value, "validTo_time_t", asn1_time_to_time_t(X509_get_notAfter(cert)));
tmpstr = (char *)X509_alias_get0(cert, NULL);
if (tmpstr) {
@@ -2058,27 +2057,26 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
STACK_OF(X509) *stack=NULL, *ret=NULL;
BIO *in=NULL;
X509_INFO *xi;
- TSRMLS_FETCH();
if(!(stack = sk_X509_new_null())) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
+ php_error_docref(NULL, E_ERROR, "memory allocation failure");
goto end;
}
- if (php_openssl_open_base_dir_chk(certfile TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(certfile)) {
sk_X509_free(stack);
goto end;
}
if(!(in=BIO_new_file(certfile, "r"))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening the file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "error opening the file, %s", certfile);
sk_X509_free(stack);
goto end;
}
/* This loads from a file, a stack of x509/crl/pkey sets */
if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error reading the file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "error reading the file, %s", certfile);
sk_X509_free(stack);
goto end;
}
@@ -2093,7 +2091,7 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile)
X509_INFO_free(xi);
}
if(!sk_X509_num(stack)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no certificates in file, %s", certfile);
+ php_error_docref(NULL, E_WARNING, "no certificates in file, %s", certfile);
sk_X509_free(stack);
goto end;
}
@@ -2111,11 +2109,10 @@ static int check_cert(X509_STORE *ctx, X509 *x, STACK_OF(X509) *untrustedchain,
{
int ret=0;
X509_STORE_CTX *csc;
- TSRMLS_FETCH();
csc = X509_STORE_CTX_new();
if (csc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "memory allocation failure");
+ php_error_docref(NULL, E_ERROR, "memory allocation failure");
return 0;
}
X509_STORE_CTX_init(csc, ctx, x, untrustedchain);
@@ -2143,7 +2140,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
size_t untrusted_len = 0;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zl|a!s", &zcert, &purpose, &zcainfo, &untrusted, &untrusted_len) == FAILURE) {
return;
}
@@ -2156,11 +2153,11 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
}
}
- cainfo = setup_verify(zcainfo TSRMLS_CC);
+ cainfo = setup_verify(zcainfo);
if (cainfo == NULL) {
goto clean_exit;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -2189,7 +2186,7 @@ clean_exit:
* calist is an array containing file and directory names. create a
* certificate store and add those certs to it for use in verification.
*/
-static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
+static X509_STORE * setup_verify(zval * calist)
{
X509_STORE *store;
X509_LOOKUP * dir_lookup, * file_lookup;
@@ -2208,14 +2205,14 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
convert_to_string_ex(item);
if (VCWD_STAT(Z_STRVAL_P(item), &sb) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to stat %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "unable to stat %s", Z_STRVAL_P(item));
continue;
}
if ((sb.st_mode & S_IFREG) == S_IFREG) {
file_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
if (file_lookup == NULL || !X509_LOOKUP_load_file(file_lookup, Z_STRVAL_P(item), X509_FILETYPE_PEM)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading file %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "error loading file %s", Z_STRVAL_P(item));
} else {
nfiles++;
}
@@ -2223,7 +2220,7 @@ static X509_STORE * setup_verify(zval * calist TSRMLS_DC)
} else {
dir_lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
if (dir_lookup == NULL || !X509_LOOKUP_add_dir(dir_lookup, Z_STRVAL_P(item), X509_FILETYPE_PEM)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error loading directory %s", Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "error loading directory %s", Z_STRVAL_P(item));
} else {
ndirs++;
}
@@ -2255,14 +2252,14 @@ PHP_FUNCTION(openssl_x509_read)
X509 *x509;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
- x509 = php_openssl_x509_from_zval(cert, 1, &res TSRMLS_CC);
+ x509 = php_openssl_x509_from_zval(cert, 1, &res);
ZVAL_RES(return_value, res);
if (x509 == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied parameter cannot be coerced into an X509 certificate!");
+ php_error_docref(NULL, E_WARNING, "supplied parameter cannot be coerced into an X509 certificate!");
RETURN_FALSE;
}
}
@@ -2275,7 +2272,7 @@ PHP_FUNCTION(openssl_x509_free)
zval *x509;
X509 *cert;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &x509) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &x509) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(cert, X509 *, x509, -1, "OpenSSL X.509", le_x509);
@@ -2297,7 +2294,7 @@ static void php_sk_X509_free(STACK_OF(X509) * sk) /* {{{ */
}
/* }}} */
-static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
+static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts) /* {{{ */
{
zval * zcertval;
STACK_OF(X509) * sk = NULL;
@@ -2309,7 +2306,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
/* get certs */
if (Z_TYPE_P(zcerts) == IS_ARRAY) {
ZEND_HASH_FOREACH_VAL(HASH_OF(zcerts), zcertval) {
- cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -2326,7 +2323,7 @@ static STACK_OF(X509) * php_array_to_X509_sk(zval * zcerts TSRMLS_DC) /* {{{ */
} ZEND_HASH_FOREACH_END();
} else {
/* a single certificate */
- cert = php_openssl_x509_from_zval(zcerts, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcerts, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
@@ -2364,26 +2361,26 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
zval * item;
STACK_OF(X509) *ca = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zpzs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE)
return;
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
goto cleanup;
}
@@ -2396,7 +2393,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
*/
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL)
- ca = php_array_to_X509_sk(item TSRMLS_CC);
+ ca = php_array_to_X509_sk(item);
/* end parse extra config */
/*PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, STACK_OF(X509) *ca,
@@ -2411,7 +2408,7 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file)
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
BIO_free(bio_out);
@@ -2445,23 +2442,23 @@ PHP_FUNCTION(openssl_pkcs12_export)
zval * item;
STACK_OF(X509) *ca = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/zs|a", &zcert, &zout, &zpkey, &pass, &pass_len, &args) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/zs|a", &zcert, &zout, &zpkey, &pass, &pass_len, &args) == FAILURE)
return;
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 1");
return;
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to cert");
goto cleanup;
}
@@ -2470,7 +2467,7 @@ PHP_FUNCTION(openssl_pkcs12_export)
friendly_name = Z_STRVAL_P(item);
if (args && (item = zend_hash_str_find(Z_ARRVAL_P(args), "extracerts", sizeof("extracerts")-1)) != NULL)
- ca = php_array_to_X509_sk(item TSRMLS_CC);
+ ca = php_array_to_X509_sk(item);
/* end parse extra config */
p12 = PKCS12_create(pass, friendly_name, priv_key, cert, ca, 0, 0, 0, 0, 0);
@@ -2515,7 +2512,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
BIO * bio_in = NULL;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/s", &zp12, &zp12_len, &zout, &pass, &pass_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/s", &zp12, &zp12_len, &zout, &pass, &pass_len) == FAILURE)
return;
RETVAL_FALSE;
@@ -2598,7 +2595,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
/* {{{ x509 CSR functions */
/* {{{ php_openssl_make_REQ */
-static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs TSRMLS_DC)
+static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, zval * dn, zval * attribs)
{
STACK_OF(CONF_VALUE) * dn_sk, *attr_sk = NULL;
char * str, *dn_sect, *attr_sect;
@@ -2642,7 +2639,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_UTF8,
(unsigned char*)Z_STRVAL_P(item), -1, -1, 0))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"dn: add_entry_by_NID %d -> %s (failed; check error"
" queue and value of string_mask OpenSSL option "
"if illegal characters are reported)",
@@ -2650,7 +2647,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex->val);
+ php_error_docref(NULL, E_WARNING, "dn: %s is not a recognized name", strindex->val);
}
}
} ZEND_HASH_FOREACH_END();
@@ -2695,11 +2692,11 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
continue;
}
if (!X509_NAME_add_entry_by_txt(subj, type, MBSTRING_UTF8, (unsigned char*)v->value, -1, -1, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value);
+ php_error_docref(NULL, E_WARNING, "add_entry_by_txt %s -> %s (failed)", type, v->value);
return FAILURE;
}
if (!X509_NAME_entry_count(subj)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no objects specified in config file");
+ php_error_docref(NULL, E_WARNING, "no objects specified in config file");
return FAILURE;
}
}
@@ -2712,11 +2709,11 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
nid = OBJ_txt2nid(strindex->val);
if (nid != NID_undef) {
if (!X509_NAME_add_entry_by_NID(subj, nid, MBSTRING_UTF8, (unsigned char*)Z_STRVAL_P(item), -1, -1, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_P(item));
+ php_error_docref(NULL, E_WARNING, "attribs: add_entry_by_NID %d -> %s (failed)", nid, Z_STRVAL_P(item));
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "dn: %s is not a recognized name", strindex->val);
+ php_error_docref(NULL, E_WARNING, "dn: %s is not a recognized name", strindex->val);
}
} ZEND_HASH_FOREACH_END();
for (i = 0; i < sk_CONF_VALUE_num(attr_sk); i++) {
@@ -2727,7 +2724,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
continue;
}
if (!X509_REQ_add1_attr_by_txt(csr, v->name, MBSTRING_UTF8, (unsigned char*)v->value, -1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"add1_attr_by_txt %s -> %s (failed; check error queue "
"and value of string_mask OpenSSL option if illegal "
"characters are reported)",
@@ -2744,7 +2741,7 @@ static int php_openssl_make_REQ(struct php_x509_request * req, X509_REQ * csr, z
/* }}} */
/* {{{ php_openssl_csr_from_zval */
-static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_resource **resourceval)
{
X509_REQ * csr = NULL;
char * filename = NULL;
@@ -2757,7 +2754,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509 CSR", &type, 1, le_csr);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509 CSR", &type, 1, le_csr);
if (what) {
if (resourceval) {
*resourceval = Z_RES_P(val);
@@ -2774,7 +2771,7 @@ static X509_REQ * php_openssl_csr_from_zval(zval * val, int makeresource, zend_r
filename = Z_STRVAL_P(val) + (sizeof("file://") - 1);
}
if (filename) {
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return NULL;
}
in = BIO_new_file(filename, "r");
@@ -2800,18 +2797,18 @@ PHP_FUNCTION(openssl_csr_export_to_file)
BIO * bio_out;
zend_resource *csr_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp|b", &zcsr, &filename, &filename_len, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
return;
}
@@ -2823,7 +2820,7 @@ PHP_FUNCTION(openssl_csr_export_to_file)
PEM_write_bio_X509_REQ(bio_out, csr);
RETVAL_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening file %s", filename);
+ php_error_docref(NULL, E_WARNING, "error opening file %s", filename);
}
if (csr_resource == NULL && csr) {
@@ -2843,15 +2840,15 @@ PHP_FUNCTION(openssl_csr_export)
BIO * bio_out;
zend_resource *csr_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|b", &zcsr, &zout, &notext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|b", &zcsr, &zout, &notext) == FAILURE) {
return;
}
RETVAL_FALSE;
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
@@ -2893,31 +2890,31 @@ PHP_FUNCTION(openssl_csr_sign)
int i;
struct php_x509_request req;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz!zl|a!l", &zcsr, &zcert, &zpkey, &num_days, &args, &serial) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz!zl|a!l", &zcsr, &zcert, &zpkey, &num_days, &args, &serial) == FAILURE)
return;
RETVAL_FALSE;
PHP_SSL_REQ_INIT(&req);
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get CSR from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get CSR from parameter 1");
return;
}
if (zcert) {
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 2");
+ php_error_docref(NULL, E_WARNING, "cannot get cert from parameter 2");
goto cleanup;
}
}
- priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource TSRMLS_CC);
+ priv_key = php_openssl_evp_from_zval(zpkey, 0, "", 1, &keyresource);
if (priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get private key from parameter 3");
+ php_error_docref(NULL, E_WARNING, "cannot get private key from parameter 3");
goto cleanup;
}
if (cert && !X509_check_private_key(cert, priv_key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key does not correspond to signing cert");
+ php_error_docref(NULL, E_WARNING, "private key does not correspond to signing cert");
goto cleanup;
}
@@ -2927,17 +2924,17 @@ PHP_FUNCTION(openssl_csr_sign)
/* Check that the request matches the signature */
key = X509_REQ_get_pubkey(csr);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error unpacking public key");
+ php_error_docref(NULL, E_WARNING, "error unpacking public key");
goto cleanup;
}
i = X509_REQ_verify(csr, key);
if (i < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature verification problems");
+ php_error_docref(NULL, E_WARNING, "Signature verification problems");
goto cleanup;
}
else if (i == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Signature did not match the certificate request");
+ php_error_docref(NULL, E_WARNING, "Signature did not match the certificate request");
goto cleanup;
}
@@ -2945,7 +2942,7 @@ PHP_FUNCTION(openssl_csr_sign)
new_cert = X509_new();
if (new_cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory");
+ php_error_docref(NULL, E_WARNING, "No memory");
goto cleanup;
}
/* Version 3 cert */
@@ -2981,12 +2978,12 @@ PHP_FUNCTION(openssl_csr_sign)
/* Now sign it */
if (!X509_sign(new_cert, priv_key, req.digest)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to sign it");
+ php_error_docref(NULL, E_WARNING, "failed to sign it");
goto cleanup;
}
/* Succeeded; lets return the cert */
- zend_register_resource(return_value, new_cert, le_x509 TSRMLS_CC);
+ zend_register_resource(return_value, new_cert, le_x509);
new_cert = NULL;
cleanup:
@@ -3025,7 +3022,7 @@ PHP_FUNCTION(openssl_csr_new)
int we_made_the_key = 1;
zend_resource *key_resource;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az/|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "az/|a!a!", &dn, &out_pkey, &args, &attribs) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3035,20 +3032,20 @@ PHP_FUNCTION(openssl_csr_new)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS) {
/* Generate or use a private key */
if (Z_TYPE_P(out_pkey) != IS_NULL) {
- req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, &key_resource TSRMLS_CC);
+ req.priv_key = php_openssl_evp_from_zval(out_pkey, 0, NULL, 0, &key_resource);
if (req.priv_key != NULL) {
we_made_the_key = 0;
}
}
if (req.priv_key == NULL) {
- php_openssl_generate_private_key(&req TSRMLS_CC);
+ php_openssl_generate_private_key(&req);
}
if (req.priv_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to generate a private key");
+ php_error_docref(NULL, E_WARNING, "Unable to generate a private key");
} else {
csr = X509_REQ_new();
if (csr) {
- if (php_openssl_make_REQ(&req, csr, dn, attribs TSRMLS_CC) == SUCCESS) {
+ if (php_openssl_make_REQ(&req, csr, dn, attribs) == SUCCESS) {
X509V3_CTX ext_ctx;
X509V3_set_ctx(&ext_ctx, NULL, NULL, csr, NULL, 0);
@@ -3058,21 +3055,21 @@ PHP_FUNCTION(openssl_csr_new)
if (req.request_extensions_section && !X509V3_EXT_REQ_add_conf(req.req_config,
&ext_ctx, req.request_extensions_section, csr))
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error loading extension section %s", req.request_extensions_section);
+ php_error_docref(NULL, E_WARNING, "Error loading extension section %s", req.request_extensions_section);
} else {
RETVAL_TRUE;
if (X509_REQ_sign(csr, req.priv_key, req.digest)) {
- zend_register_resource(return_value, csr, le_csr TSRMLS_CC);
+ zend_register_resource(return_value, csr, le_csr);
csr = NULL;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request");
+ php_error_docref(NULL, E_WARNING, "Error signing request");
}
if (we_made_the_key) {
/* and a resource for the private key */
zval_dtor(out_pkey);
- zend_register_resource(out_pkey, req.priv_key, le_key TSRMLS_CC);
+ zend_register_resource(out_pkey, req.priv_key, le_key);
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
} else if (key_resource != NULL) {
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
@@ -3105,11 +3102,11 @@ PHP_FUNCTION(openssl_csr_get_subject)
X509_NAME * subject;
X509_REQ * csr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcsr, &use_shortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcsr, &use_shortnames) == FAILURE) {
return;
}
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
RETURN_FALSE;
@@ -3118,7 +3115,7 @@ PHP_FUNCTION(openssl_csr_get_subject)
subject = X509_REQ_get_subject_name(csr);
array_init(return_value);
- add_assoc_name_entry(return_value, NULL, subject, use_shortnames TSRMLS_CC);
+ add_assoc_name_entry(return_value, NULL, subject, use_shortnames);
return;
}
/* }}} */
@@ -3134,18 +3131,18 @@ PHP_FUNCTION(openssl_csr_get_public_key)
X509_REQ * csr;
EVP_PKEY *tpubkey;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &zcsr, &use_shortnames) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcsr, &use_shortnames) == FAILURE) {
return;
}
- csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource TSRMLS_CC);
+ csr = php_openssl_csr_from_zval(zcsr, 0, &csr_resource);
if (csr == NULL) {
RETURN_FALSE;
}
tpubkey=X509_REQ_get_pubkey(csr);
- zend_register_resource(return_value, tpubkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, tpubkey, le_key);
return;
}
/* }}} */
@@ -3167,7 +3164,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
empty string rather than NULL for the passphrase - NULL causes a passphrase prompt to be emitted in
the Apache error log!
*/
-static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval TSRMLS_DC)
+static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * passphrase, int makeresource, zend_resource **resourceval)
{
EVP_PKEY * key = NULL;
X509 * cert = NULL;
@@ -3193,7 +3190,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* get passphrase */
if ((zphrase = zend_hash_index_find(HASH_OF(val), 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
+ php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
return NULL;
}
@@ -3207,7 +3204,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* now set val to be the key param and continue */
if ((val = zend_hash_index_find(HASH_OF(val), 0)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
+ php_error_docref(NULL, E_WARNING, "key array must be of the form array(0 => key, 1 => phrase)");
TMP_CLEAN;
}
}
@@ -3216,7 +3213,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
void * what;
int type;
- what = zend_fetch_resource(val TSRMLS_CC, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key);
+ what = zend_fetch_resource(val, -1, "OpenSSL X.509/key", &type, 2, le_x509, le_key);
if (!what) {
TMP_CLEAN;
}
@@ -3231,16 +3228,16 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
} else if (type == le_key) {
int is_priv;
- is_priv = php_openssl_is_private_key((EVP_PKEY*)what TSRMLS_CC);
+ is_priv = php_openssl_is_private_key((EVP_PKEY*)what);
/* check whether it is actually a private key if requested */
if (!public_key && !is_priv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param is a public key");
+ php_error_docref(NULL, E_WARNING, "supplied key param is a public key");
TMP_CLEAN;
}
if (public_key && is_priv) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Don't know how to get public key from this private key");
+ php_error_docref(NULL, E_WARNING, "Don't know how to get public key from this private key");
TMP_CLEAN;
} else {
if (Z_TYPE(tmp) == IS_STRING) {
@@ -3268,7 +3265,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
}
/* it's an X509 file/cert of some kind, and we need to extract the data from that */
if (public_key) {
- cert = php_openssl_x509_from_zval(val, 0, &cert_res TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(val, 0, &cert_res);
free_cert = (cert_res == NULL);
/* actual extraction done later */
if (!cert) {
@@ -3290,7 +3287,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
BIO *in;
if (filename) {
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
TMP_CLEAN;
}
in = BIO_new_file(filename, "r");
@@ -3325,20 +3322,20 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
/* }}} */
/* {{{ php_openssl_generate_private_key */
-static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req TSRMLS_DC)
+static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req)
{
char * randfile = NULL;
int egdsocket, seeded;
EVP_PKEY * return_val = NULL;
if (req->priv_key_bits < MIN_KEY_LENGTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "private key length is too short; it needs to be at least %d bits, not %d",
+ php_error_docref(NULL, E_WARNING, "private key length is too short; it needs to be at least %d bits, not %d",
MIN_KEY_LENGTH, req->priv_key_bits);
return NULL;
}
randfile = CONF_get_string(req->req_config, req->section_name, "RANDFILE");
- php_openssl_load_rand_file(randfile, &egdsocket, &seeded TSRMLS_CC);
+ php_openssl_load_rand_file(randfile, &egdsocket, &seeded);
if ((req->priv_key = EVP_PKEY_new()) != NULL) {
switch(req->priv_key_type) {
@@ -3384,7 +3381,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported private key type");
+ php_error_docref(NULL, E_WARNING, "Unsupported private key type");
}
}
@@ -3402,7 +3399,7 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
/* {{{ php_openssl_is_private_key
Check whether the supplied key is a private key by checking if the secret prime factors are set */
-static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
+static int php_openssl_is_private_key(EVP_PKEY* pkey)
{
assert(pkey != NULL);
@@ -3448,7 +3445,7 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
break;
}
return 1;
@@ -3484,7 +3481,7 @@ PHP_FUNCTION(openssl_pkey_new)
zval * args = NULL;
zval *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!", &args) == FAILURE) {
return;
}
RETVAL_FALSE;
@@ -3508,7 +3505,7 @@ PHP_FUNCTION(openssl_pkey_new)
OPENSSL_PKEY_SET_BN(Z_ARRVAL_P(data), rsa, iqmp);
if (rsa->n && rsa->d) {
if (EVP_PKEY_assign_RSA(pkey, rsa)) {
- zend_register_resource(return_value, pkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, pkey, le_key);
return;
}
}
@@ -3533,7 +3530,7 @@ PHP_FUNCTION(openssl_pkey_new)
DSA_generate_key(dsa);
}
if (EVP_PKEY_assign_DSA(pkey, dsa)) {
- zend_register_resource(return_value, pkey, le_key TSRMLS_CC);
+ zend_register_resource(return_value, pkey, le_key);
return;
}
}
@@ -3557,7 +3554,7 @@ PHP_FUNCTION(openssl_pkey_new)
DH_generate_key(dh);
}
if (EVP_PKEY_assign_DH(pkey, dh)) {
- ZVAL_COPY_VALUE(return_value, zend_list_insert(pkey, le_key TSRMLS_CC));
+ ZVAL_COPY_VALUE(return_value, zend_list_insert(pkey, le_key));
return;
}
}
@@ -3573,9 +3570,9 @@ PHP_FUNCTION(openssl_pkey_new)
if (PHP_SSL_REQ_PARSE(&req, args) == SUCCESS)
{
- if (php_openssl_generate_private_key(&req TSRMLS_CC)) {
+ if (php_openssl_generate_private_key(&req)) {
/* pass back a key resource */
- zend_register_resource(return_value, req.priv_key, le_key TSRMLS_CC);
+ zend_register_resource(return_value, req.priv_key, le_key);
/* make sure the cleanup code doesn't zap it! */
req.priv_key = NULL;
}
@@ -3600,19 +3597,19 @@ PHP_FUNCTION(openssl_pkey_export_to_file)
BIO * bio_out = NULL;
const EVP_CIPHER * cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zp|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zp|s!a!", &zpkey, &filename, &filename_len, &passphrase, &passphrase_len, &args) == FAILURE) {
return;
}
RETVAL_FALSE;
- key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
RETURN_FALSE;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
RETURN_FALSE;
}
@@ -3672,15 +3669,15 @@ PHP_FUNCTION(openssl_pkey_export)
BIO * bio_out = NULL;
const EVP_CIPHER * cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz/|s!a!", &zpkey, &out, &passphrase, &passphrase_len, &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz/|s!a!", &zpkey, &out, &passphrase, &passphrase_len, &args) == FAILURE) {
return;
}
RETVAL_FALSE;
- key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource TSRMLS_CC);
+ key = php_openssl_evp_from_zval(zpkey, 0, passphrase, 0, &key_resource);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get key from parameter 1");
+ php_error_docref(NULL, E_WARNING, "cannot get key from parameter 1");
RETURN_FALSE;
}
@@ -3742,10 +3739,10 @@ PHP_FUNCTION(openssl_pkey_get_public)
EVP_PKEY *pkey;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cert) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cert) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &res TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(cert, 1, NULL, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
}
@@ -3761,7 +3758,7 @@ PHP_FUNCTION(openssl_pkey_free)
zval *key;
EVP_PKEY *pkey;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -3779,10 +3776,10 @@ PHP_FUNCTION(openssl_pkey_get_private)
size_t passphrase_len = sizeof("")-1;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &cert, &passphrase, &passphrase_len) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &res TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(cert, 0, passphrase, 1, &res);
if (pkey == NULL) {
RETURN_FALSE;
@@ -3804,7 +3801,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
char *pbio;
zend_long ktype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -3943,7 +3940,7 @@ PHP_FUNCTION(openssl_pbkdf2)
const EVP_MD *digest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssll|s",
&password, &password_len,
&salt, &salt_len,
&key_length, &iterations,
@@ -3962,7 +3959,7 @@ PHP_FUNCTION(openssl_pbkdf2)
}
if (!digest) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
RETURN_FALSE;
}
@@ -4004,7 +4001,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
RETVAL_LONG(-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|papp", &filename, &filename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl|papp", &filename, &filename_len,
&flags, &signersfilename, &signersfilename_len, &cainfo,
&extracerts, &extracerts_len, &datafilename, &datafilename_len) == FAILURE) {
return;
@@ -4019,12 +4016,12 @@ PHP_FUNCTION(openssl_pkcs7_verify)
flags = flags & ~PKCS7_DETACHED;
- store = setup_verify(cainfo TSRMLS_CC);
+ store = setup_verify(cainfo);
if (!store) {
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(filename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(filename)) {
goto clean_exit;
}
@@ -4042,7 +4039,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
if (datafilename) {
- if (php_openssl_open_base_dir_chk(datafilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(datafilename)) {
goto clean_exit;
}
@@ -4062,7 +4059,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
if (signersfilename) {
BIO *certout;
- if (php_openssl_open_base_dir_chk(signersfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(signersfilename)) {
goto clean_exit;
}
@@ -4077,7 +4074,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
BIO_free(certout);
sk_X509_free(signers);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "signature OK, but cannot open %s for writing", signersfilename);
+ php_error_docref(NULL, E_WARNING, "signature OK, but cannot open %s for writing", signersfilename);
RETVAL_LONG(-1);
}
}
@@ -4116,12 +4113,12 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppza!|ll", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppza!|ll", &infilename, &infilename_len,
&outfilename, &outfilename_len, &zrecipcerts, &zheaders, &flags, &cipherid) == FAILURE)
return;
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
return;
}
@@ -4142,7 +4139,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
ZEND_HASH_FOREACH_VAL(HASH_OF(zrecipcerts), zcertval) {
zend_resource *certresource;
- cert = php_openssl_x509_from_zval(zcertval, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcertval, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -4161,7 +4158,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
/* a single certificate */
zend_resource *certresource;
- cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zrecipcerts, 0, &certresource);
if (cert == NULL) {
goto clean_exit;
}
@@ -4181,7 +4178,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
cipher = php_openssl_get_evp_cipher_from_algo(cipherid);
if (cipher == NULL) {
/* shouldn't happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get cipher");
+ php_error_docref(NULL, E_WARNING, "Failed to get cipher");
goto clean_exit;
}
@@ -4243,7 +4240,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
char * extracertsfilename = NULL;
size_t extracertsfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppzza!|lp",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppzza!|lp",
&infilename, &infilename_len, &outfilename, &outfilename_len,
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
&extracertsfilename_len) == FAILURE) {
@@ -4259,37 +4256,37 @@ PHP_FUNCTION(openssl_pkcs7_sign)
}
}
- privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource TSRMLS_CC);
+ privkey = php_openssl_evp_from_zval(zprivkey, 0, "", 0, &keyresource);
if (privkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting private key");
+ php_error_docref(NULL, E_WARNING, "error getting private key");
goto clean_exit;
}
- cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(zcert, 0, &certresource);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error getting cert");
+ php_error_docref(NULL, E_WARNING, "error getting cert");
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
goto clean_exit;
}
infile = BIO_new_file(infilename, "r");
if (infile == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening input file %s!", infilename);
+ php_error_docref(NULL, E_WARNING, "error opening input file %s!", infilename);
goto clean_exit;
}
outfile = BIO_new_file(outfilename, "w");
if (outfile == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening output file %s!", outfilename);
+ php_error_docref(NULL, E_WARNING, "error opening output file %s!", outfilename);
goto clean_exit;
}
p7 = PKCS7_sign(cert, privkey, others, infile, flags);
if (p7 == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error creating PKCS7 structure!");
+ php_error_docref(NULL, E_WARNING, "error creating PKCS7 structure!");
goto clean_exit;
}
@@ -4344,26 +4341,26 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
char * outfilename;
size_t outfilename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppz|z", &infilename, &infilename_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppz|z", &infilename, &infilename_len,
&outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) {
return;
}
RETVAL_FALSE;
- cert = php_openssl_x509_from_zval(recipcert, 0, &certresval TSRMLS_CC);
+ cert = php_openssl_x509_from_zval(recipcert, 0, &certresval);
if (cert == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 3 to x509 cert");
+ php_error_docref(NULL, E_WARNING, "unable to coerce parameter 3 to x509 cert");
goto clean_exit;
}
- key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, &keyresval TSRMLS_CC);
+ key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, &keyresval);
if (key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get private key");
+ php_error_docref(NULL, E_WARNING, "unable to get private key");
goto clean_exit;
}
- if (php_openssl_open_base_dir_chk(infilename TSRMLS_CC) || php_openssl_open_base_dir_chk(outfilename TSRMLS_CC)) {
+ if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) {
goto clean_exit;
}
@@ -4414,15 +4411,15 @@ PHP_FUNCTION(openssl_private_encrypt)
size_t data_len;
zend_long padding = RSA_PKCS1_PADDING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key param is not a valid private key");
+ php_error_docref(NULL, E_WARNING, "key param is not a valid private key");
RETURN_FALSE;
}
@@ -4439,7 +4436,7 @@ PHP_FUNCTION(openssl_private_encrypt)
padding) == cryptedlen);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
if (successful) {
@@ -4473,14 +4470,14 @@ PHP_FUNCTION(openssl_private_decrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid private key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid private key");
RETURN_FALSE;
}
@@ -4502,7 +4499,7 @@ PHP_FUNCTION(openssl_private_decrypt)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
efree(crypttemp);
@@ -4538,13 +4535,13 @@ PHP_FUNCTION(openssl_public_encrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE)
return;
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
}
@@ -4561,7 +4558,7 @@ PHP_FUNCTION(openssl_public_encrypt)
padding) == cryptedlen);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
@@ -4596,14 +4593,14 @@ PHP_FUNCTION(openssl_public_decrypt)
char * data;
size_t data_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|l", &data, &data_len, &crypted, &key, &padding) == FAILURE) {
return;
}
RETVAL_FALSE;
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key parameter is not a valid public key");
+ php_error_docref(NULL, E_WARNING, "key parameter is not a valid public key");
RETURN_FALSE;
}
@@ -4626,7 +4623,7 @@ PHP_FUNCTION(openssl_public_decrypt)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!");
+ php_error_docref(NULL, E_WARNING, "key type not supported in this PHP build!");
}
@@ -4685,12 +4682,12 @@ PHP_FUNCTION(openssl_sign)
zend_long signature_algo = OPENSSL_ALGO_SHA1;
const EVP_MD *mdtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z|z", &data, &data_len, &signature, &key, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z|z", &data, &data_len, &signature, &key, &method) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a private key");
+ php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a private key");
RETURN_FALSE;
}
@@ -4702,11 +4699,11 @@ PHP_FUNCTION(openssl_sign)
} else if (Z_TYPE_P(method) == IS_STRING) {
mdtype = EVP_get_digestbyname(Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
@@ -4749,7 +4746,7 @@ PHP_FUNCTION(openssl_verify)
zval *method = NULL;
zend_long signature_algo = OPENSSL_ALGO_SHA1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz|z", &data, &data_len, &signature, &signature_len, &key, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssz|z", &data, &data_len, &signature, &signature_len, &key, &method) == FAILURE) {
return;
}
@@ -4761,17 +4758,17 @@ PHP_FUNCTION(openssl_verify)
} else if (Z_TYPE_P(method) == IS_STRING) {
mdtype = EVP_get_digestbyname(Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
- pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(key, 1, NULL, 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied key param cannot be coerced into a public key");
+ php_error_docref(NULL, E_WARNING, "supplied key param cannot be coerced into a public key");
RETURN_FALSE;
}
@@ -4804,20 +4801,20 @@ PHP_FUNCTION(openssl_seal)
const EVP_CIPHER *cipher;
EVP_CIPHER_CTX ctx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z/a/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/a/|s", &data, &data_len, &sealdata, &ekeys, &pubkeys, &method, &method_len) == FAILURE) {
return;
}
pubkeysht = HASH_OF(pubkeys);
nkeys = pubkeysht ? zend_hash_num_elements(pubkeysht) : 0;
if (!nkeys) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array");
+ php_error_docref(NULL, E_WARNING, "Fourth argument to openssl_seal() must be a non-empty array");
RETURN_FALSE;
}
if (method) {
cipher = EVP_get_cipherbyname(method);
if (!cipher) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
} else {
@@ -4834,9 +4831,9 @@ PHP_FUNCTION(openssl_seal)
/* get the public keys we are using to seal this data */
i = 0;
ZEND_HASH_FOREACH_VAL(pubkeysht, pubkey) {
- pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i] TSRMLS_CC);
+ pkeys[i] = php_openssl_evp_from_zval(pubkey, 1, NULL, 0, &key_resources[i]);
if (pkeys[i] == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not a public key (%dth member of pubkeys)", i+1);
+ php_error_docref(NULL, E_WARNING, "not a public key (%dth member of pubkeys)", i+1);
RETVAL_FALSE;
goto clean_exit;
}
@@ -4933,20 +4930,20 @@ PHP_FUNCTION(openssl_open)
size_t method_len = 0;
const EVP_CIPHER *cipher;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/sz|s", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey, &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/sz|s", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey, &method, &method_len) == FAILURE) {
return;
}
- pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource TSRMLS_CC);
+ pkey = php_openssl_evp_from_zval(privkey, 0, "", 0, &keyresource);
if (pkey == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to coerce parameter 4 into a private key");
+ php_error_docref(NULL, E_WARNING, "unable to coerce parameter 4 into a private key");
RETURN_FALSE;
}
if (method) {
cipher = EVP_get_cipherbyname(method);
if (!cipher) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm.");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm.");
RETURN_FALSE;
}
} else {
@@ -4997,7 +4994,7 @@ PHP_FUNCTION(openssl_get_md_methods)
{
zend_bool aliases = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &aliases) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
return;
}
array_init(return_value);
@@ -5013,7 +5010,7 @@ PHP_FUNCTION(openssl_get_cipher_methods)
{
zend_bool aliases = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &aliases) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &aliases) == FAILURE) {
return;
}
array_init(return_value);
@@ -5035,12 +5032,12 @@ PHP_FUNCTION(openssl_digest)
unsigned int siglen;
zend_string *sigbuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &data, &data_len, &method, &method_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &data, &data_len, &method, &method_len, &raw_output) == FAILURE) {
return;
}
mdtype = EVP_get_digestbyname(method);
if (!mdtype) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown signature algorithm");
RETURN_FALSE;
}
@@ -5070,7 +5067,7 @@ PHP_FUNCTION(openssl_digest)
}
/* }}} */
-static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_required_len TSRMLS_DC)
+static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_required_len)
{
char *iv_new;
@@ -5089,14 +5086,14 @@ static zend_bool php_openssl_validate_iv(char **piv, int *piv_len, int iv_requir
}
if (*piv_len < iv_required_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is only %d bytes long, cipher expects an IV of precisely %d bytes, padding with \\0", *piv_len, iv_required_len);
+ php_error_docref(NULL, E_WARNING, "IV passed is only %d bytes long, cipher expects an IV of precisely %d bytes, padding with \\0", *piv_len, iv_required_len);
memcpy(iv_new, *piv, *piv_len);
*piv_len = iv_required_len;
*piv = iv_new;
return 1;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "IV passed is %d bytes long which is longer than the %d expected by selected cipher, truncating", *piv_len, iv_required_len);
+ php_error_docref(NULL, E_WARNING, "IV passed is %d bytes long which is longer than the %d expected by selected cipher, truncating", *piv_len, iv_required_len);
memcpy(iv_new, *piv, iv_required_len);
*piv_len = iv_required_len;
*piv = iv_new;
@@ -5118,12 +5115,12 @@ PHP_FUNCTION(openssl_encrypt)
unsigned char *key;
zend_bool free_iv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
return;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
@@ -5138,9 +5135,9 @@ PHP_FUNCTION(openssl_encrypt)
max_iv_len = EVP_CIPHER_iv_length(cipher_type);
if (iv_len <= 0 && max_iv_len > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Using an empty Initialization Vector (iv) is potentially insecure and not recommended");
+ php_error_docref(NULL, E_WARNING, "Using an empty Initialization Vector (iv) is potentially insecure and not recommended");
}
- free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, max_iv_len TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, max_iv_len);
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5199,25 +5196,25 @@ PHP_FUNCTION(openssl_decrypt)
zend_string *base64_str = NULL;
zend_bool free_iv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|ls", &data, &data_len, &method, &method_len, &password, &password_len, &options, &iv, &iv_len) == FAILURE) {
return;
}
if (!method_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
if (!(options & OPENSSL_RAW_DATA)) {
base64_str = php_base64_decode((unsigned char*)data, data_len);
if (!base64_str) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to base64 decode the input");
+ php_error_docref(NULL, E_WARNING, "Failed to base64 decode the input");
RETURN_FALSE;
}
data_len = base64_str->len;
@@ -5233,7 +5230,7 @@ PHP_FUNCTION(openssl_decrypt)
key = (unsigned char*)password;
}
- free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, EVP_CIPHER_iv_length(cipher_type) TSRMLS_CC);
+ free_iv = php_openssl_validate_iv(&iv, (int *)&iv_len, EVP_CIPHER_iv_length(cipher_type));
outlen = data_len + EVP_CIPHER_block_size(cipher_type);
outbuf = zend_string_alloc(outlen, 0);
@@ -5277,18 +5274,18 @@ PHP_FUNCTION(openssl_cipher_iv_length)
size_t method_len;
const EVP_CIPHER *cipher_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &method, &method_len) == FAILURE) {
return;
}
if (!method_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
cipher_type = EVP_get_cipherbyname(method);
if (!cipher_type) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown cipher algorithm");
+ php_error_docref(NULL, E_WARNING, "Unknown cipher algorithm");
RETURN_FALSE;
}
@@ -5309,7 +5306,7 @@ PHP_FUNCTION(openssl_dh_compute_key)
zend_string *data;
int len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sr", &pub_str, &pub_len, &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sr", &pub_str, &pub_len, &key) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pkey, EVP_PKEY *, key, -1, "OpenSSL key", le_key);
@@ -5344,7 +5341,7 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
zval *zstrong_result_returned = NULL;
int strong_result = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) {
return;
}
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index df2b6dd58e..312fb08386 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -75,7 +75,7 @@
#define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i)))
extern php_stream* php_openssl_get_stream_from_ssl_handle(const SSL *ssl);
-extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw TSRMLS_DC);
+extern zend_string* php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw);
extern int php_openssl_get_ssl_stream_data_index();
extern int php_openssl_get_x509_list_id(void);
@@ -119,7 +119,7 @@ typedef struct _php_openssl_netstream_data_t {
/* it doesn't matter that we do some hash traversal here, since it is done only
* in an error condition arising from a network connection problem */
-static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) /* {{{ */
+static int is_http_stream_talking_to_iis(php_stream *stream) /* {{{ */
{
if (Z_TYPE(stream->wrapperdata) == IS_ARRAY && stream->wrapper && strcasecmp(stream->wrapper->wops->label, "HTTP") == 0) {
/* the wrapperdata is an array zval containing the headers */
@@ -140,7 +140,7 @@ static int is_http_stream_talking_to_iis(php_stream *stream TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init TSRMLS_DC) /* {{{ */
+static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes);
@@ -164,8 +164,8 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
case SSL_ERROR_SYSCALL:
if (ERR_peek_error() == 0) {
if (nr_bytes == 0) {
- if (!is_http_stream_talking_to_iis(stream TSRMLS_CC) && ERR_get_error() != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (!is_http_stream_talking_to_iis(stream) && ERR_get_error() != 0) {
+ php_error_docref(NULL, E_WARNING,
"SSL: fatal protocol error");
}
SSL_set_shutdown(sslsock->ssl_handle, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
@@ -174,7 +174,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
} else {
char *estr = php_socket_strerror(php_socket_errno(), NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL: %s", estr);
efree(estr);
@@ -191,7 +191,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
switch (ERR_GET_REASON(ecode)) {
case SSL_R_NO_SHARED_CIPHER:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option)");
+ php_error_docref(NULL, E_WARNING, "SSL_R_NO_SHARED_CIPHER: no suitable shared cipher could be used. This could be because the server is missing an SSL certificate (local_cert context option)");
retry = 0;
break;
@@ -207,7 +207,7 @@ static int handle_ssl_error(php_stream *stream, int nr_bytes, zend_bool is_init
smart_str_0(&ebuf);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL operation failed with code %d. %s%s",
err,
ebuf.s ? "OpenSSL Error messages:\n" : "",
@@ -232,7 +232,6 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
zval *val;
zend_ulong allowed_depth = OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH;
- TSRMLS_FETCH();
ret = preverify_ok;
@@ -247,7 +246,7 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
/* if allow_self_signed is set, make sure that verification succeeds */
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT &&
GET_VER_OPT("allow_self_signed") &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ret = 1;
}
@@ -263,12 +262,12 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
}
/* }}} */
-static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected TSRMLS_DC)
+static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected)
{
zend_string *fingerprint;
int result = -1;
- fingerprint = php_openssl_x509_fingerprint(peer, method, 0 TSRMLS_CC);
+ fingerprint = php_openssl_x509_fingerprint(peer, method, 0);
if (fingerprint) {
result = strcmp(expected, fingerprint->val);
zend_string_release(fingerprint);
@@ -277,7 +276,7 @@ static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *
return result;
}
-static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
+static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
{
if (Z_TYPE_P(val) == IS_STRING) {
const char *method = NULL;
@@ -292,14 +291,14 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
break;
}
- return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val) TSRMLS_CC) == 0;
+ return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val)) == 0;
} else if (Z_TYPE_P(val) == IS_ARRAY) {
zval *current;
zend_string *key;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), key, current) {
if (key && Z_TYPE_P(current) == IS_STRING
- && php_x509_fingerprint_cmp(peer, key->val, Z_STRVAL_P(current) TSRMLS_CC) != 0
+ && php_x509_fingerprint_cmp(peer, key->val, Z_STRVAL_P(current)) != 0
) {
return 0;
}
@@ -343,7 +342,7 @@ static zend_bool matches_wildcard_name(const char *subjectname, const char *cert
}
/* }}} */
-static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
+static zend_bool matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
{
int i, san_name_len;
zend_bool is_match = 0;
@@ -364,7 +363,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC
/* prevent null byte poisoning */
if (san_name_len != strlen((const char*)cert_name)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer SAN entry is malformed");
+ php_error_docref(NULL, E_WARNING, "Peer SAN entry is malformed");
} else {
is_match = matches_wildcard_name(subject_name, (const char *)cert_name);
}
@@ -380,7 +379,7 @@ static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC
}
/* }}} */
-static zend_bool matches_common_name(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
+static zend_bool matches_common_name(X509 *peer, const char *subject_name) /* {{{ */
{
char buf[1024];
X509_NAME *cert_name;
@@ -391,20 +390,20 @@ static zend_bool matches_common_name(X509 *peer, const char *subject_name TSRMLS
cert_name_len = X509_NAME_get_text_by_NID(cert_name, NID_commonName, buf, sizeof(buf));
if (cert_name_len == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate peer certificate CN");
+ php_error_docref(NULL, E_WARNING, "Unable to locate peer certificate CN");
} else if (cert_name_len != strlen(buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf);
+ php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' is malformed", cert_name_len, buf);
} else if (matches_wildcard_name(subject_name, buf)) {
is_match = 1;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", cert_name_len, buf, subject_name);
+ php_error_docref(NULL, E_WARNING, "Peer certificate CN=`%.*s' did not match expected CN=`%s'", cert_name_len, buf, subject_name);
}
return is_match;
}
/* }}} */
-static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stream TSRMLS_DC) /* {{{ */
+static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *peer_name = NULL;
@@ -417,18 +416,18 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
must_verify_peer = GET_VER_OPT("verify_peer")
- ? zend_is_true(val TSRMLS_CC)
+ ? zend_is_true(val)
: sslsock->is_client;
has_cnmatch_ctx_opt = GET_VER_OPT("CN_match");
must_verify_peer_name = (has_cnmatch_ctx_opt || GET_VER_OPT("verify_peer_name"))
- ? zend_is_true(val TSRMLS_CC)
+ ? zend_is_true(val)
: sslsock->is_client;
- must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(val TSRMLS_CC));
+ must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(val));
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
+ php_error_docref(NULL, E_WARNING, "Could not get peer certificate");
return FAILURE;
}
@@ -440,13 +439,13 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* fine */
break;
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
- if (GET_VER_OPT("allow_self_signed") && zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("allow_self_signed") && zend_is_true(val)) {
/* allowed */
break;
}
/* not allowed, so fall through */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Could not verify peer: code:%d %s",
err,
X509_verify_cert_error_string(err)
@@ -458,14 +457,14 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* If a peer_fingerprint match is required this trumps peer and peer_name verification */
if (must_verify_fingerprint) {
if (Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_ARRAY) {
- if (!php_x509_fingerprint_match(peer, val TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (!php_x509_fingerprint_match(peer, val)) {
+ php_error_docref(NULL, E_WARNING,
"Peer fingerprint doesn't match"
);
return FAILURE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected peer fingerprint must be a string or an array"
);
}
@@ -487,9 +486,9 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
}
if (peer_name) {
- if (matches_san_list(peer, peer_name TSRMLS_CC)) {
+ if (matches_san_list(peer, peer_name)) {
return SUCCESS;
- } else if (matches_common_name(peer, peer_name TSRMLS_CC)) {
+ } else if (matches_common_name(peer, peer_name)) {
return SUCCESS;
} else {
return FAILURE;
@@ -534,7 +533,6 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
zval *val;
zend_bool is_self_signed = 0;
- TSRMLS_FETCH();
stream = (php_stream*)arg;
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -552,7 +550,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
err_code = e;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error encoding X509 certificate: %d: %s", err_code, ERR_error_string(err_code, err_buf));
+ php_error_docref(NULL, E_WARNING, "Error encoding X509 certificate: %d: %s", err_code, ERR_error_string(err_code, err_buf));
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
@@ -560,7 +558,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
OPENSSL_free(der_buf);
if (cert_ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error creating certificate context: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error creating certificate context: %s", php_win_err());
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
}
@@ -582,7 +580,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
chain_flags = CERT_CHAIN_CACHE_END_CERT | CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT;
if (!CertGetCertificateChain(NULL, cert_ctx, NULL, NULL, &chain_params, chain_flags, NULL, &cert_chain_ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error getting certificate chain: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error getting certificate chain: %s", php_win_err());
CertFreeCertificateContext(cert_ctx);
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
@@ -623,7 +621,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
cert_name = X509_get_subject_name(x509_store_ctx->cert);
index = X509_NAME_get_index_by_NID(cert_name, NID_commonName, -1);
if (index < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate certificate CN");
+ php_error_docref(NULL, E_WARNING, "Unable to locate certificate CN");
CertFreeCertificateChain(cert_chain_ctx);
CertFreeCertificateContext(cert_ctx);
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
@@ -633,7 +631,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
num_wchars = MultiByteToWideChar(CP_UTF8, 0, (char*)cert_name_utf8, -1, NULL, 0);
if (num_wchars == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
+ php_error_docref(NULL, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
OPENSSL_free(cert_name_utf8);
CertFreeCertificateChain(cert_chain_ctx);
CertFreeCertificateContext(cert_ctx);
@@ -644,7 +642,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
num_wchars = MultiByteToWideChar(CP_UTF8, 0, (char*)cert_name_utf8, -1, server_name, num_wchars);
if (num_wchars == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
+ php_error_docref(NULL, E_WARNING, "Unable to convert %s to wide character string", cert_name_utf8);
efree(server_name);
OPENSSL_free(cert_name_utf8);
CertFreeCertificateChain(cert_chain_ctx);
@@ -666,14 +664,14 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
CertFreeCertificateContext(cert_ctx);
if (!verify_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error verifying certificate chain policy: %s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "Error verifying certificate chain policy: %s", php_win_err());
RETURN_CERT_VERIFY_FAILURE(SSL_R_CERTIFICATE_VERIFY_FAILED);
}
if (chain_policy_status.dwError != 0) {
/* The chain does not match the policy */
if (is_self_signed && chain_policy_status.dwError == CERT_E_UNTRUSTEDROOT
- && GET_VER_OPT("allow_self_signed") && zend_is_true(val TSRMLS_CC)) {
+ && GET_VER_OPT("allow_self_signed") && zend_is_true(val)) {
/* allow self-signed certs */
X509_STORE_CTX_set_error(x509_store_ctx, X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
} else {
@@ -687,7 +685,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
/* }}} */
#endif
-static long load_stream_cafile(X509_STORE *cert_store, const char *cafile TSRMLS_DC) /* {{{ */
+static long load_stream_cafile(X509_STORE *cert_store, const char *cafile) /* {{{ */
{
php_stream *stream;
X509 *cert;
@@ -767,7 +765,7 @@ static long load_stream_cafile(X509_STORE *cert_store, const char *cafile TSRMLS
}
/* }}} */
-static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *cafile = NULL;
@@ -788,7 +786,7 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
if (cafile || capath) {
if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) {
- if (cafile && !load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile TSRMLS_CC)) {
+ if (cafile && !load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile)) {
return FAILURE;
}
}
@@ -801,7 +799,7 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
if (sslsock->is_client && !SSL_CTX_set_default_verify_paths(ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Unable to set default verify locations and no CA settings specified");
return FAILURE;
}
@@ -814,13 +812,13 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
}
/* }}} */
-static void disable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static void disable_peer_verification(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, NULL);
}
/* }}} */
-static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
+static int set_local_cert(SSL_CTX *ctx, php_stream *stream) /* {{{ */
{
zval *val = NULL;
char *certfile = NULL;
@@ -834,7 +832,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
if (VCWD_REALPATH(certfile, resolved_path_buff)) {
/* a certificate to use for authentication */
if (SSL_CTX_use_certificate_chain_file(ctx, resolved_path_buff) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set local cert chain file `%s'; Check that your cafile/capath settings include details of your certificate and its issuer", certfile);
+ php_error_docref(NULL, E_WARNING, "Unable to set local cert chain file `%s'; Check that your cafile/capath settings include details of your certificate and its issuer", certfile);
return FAILURE;
}
GET_VER_OPT_STRING("local_pk", private_key);
@@ -843,13 +841,13 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
char resolved_path_buff_pk[MAXPATHLEN];
if (VCWD_REALPATH(private_key, resolved_path_buff_pk)) {
if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff_pk, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff_pk);
+ php_error_docref(NULL, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff_pk);
return FAILURE;
}
}
} else {
if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff);
+ php_error_docref(NULL, E_WARNING, "Unable to set private key file `%s'", resolved_path_buff);
return FAILURE;
}
}
@@ -871,7 +869,7 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
} while (0);
#endif
if (!SSL_CTX_check_private_key(ctx)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Private key does not match certificate!");
+ php_error_docref(NULL, E_WARNING, "Private key does not match certificate!");
}
}
}
@@ -880,13 +878,13 @@ static int set_local_cert(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ */
}
/* }}} */
-static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is_client TSRMLS_DC) /* {{{ */
+static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is_client) /* {{{ */
{
if (method_value == STREAM_CRYPTO_METHOD_SSLv2) {
#ifndef OPENSSL_NO_SSL2
return is_client ? SSLv2_client_method() : SSLv2_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -894,7 +892,7 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#ifndef OPENSSL_NO_SSL3
return is_client ? SSLv3_client_method() : SSLv3_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -904,7 +902,7 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
return is_client ? TLSv1_1_client_method() : TLSv1_1_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
@@ -912,19 +910,19 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
return is_client ? TLSv1_2_client_method() : TLSv1_2_server_method();
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid crypto method");
return NULL;
}
}
/* }}} */
-static zend_long php_get_crypto_method_ctx_flags(zend_long method_flags TSRMLS_DC) /* {{{ */
+static zend_long php_get_crypto_method_ctx_flags(zend_long method_flags) /* {{{ */
{
zend_long ssl_ctx_options = SSL_OP_ALL;
@@ -987,8 +985,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
if (sslsock->reneg->tokens > sslsock->reneg->limit) {
zval *val;
- TSRMLS_FETCH();
-
+
sslsock->reneg->should_close = 1;
if (PHP_STREAM_CONTEXT(stream) && (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
@@ -1000,7 +997,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
/* Closing the stream inside this callback would segfault! */
stream->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
- if (FAILURE == call_user_function_ex(EG(function_table), NULL, val, &retval, 1, &param, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == call_user_function_ex(EG(function_table), NULL, val, &retval, 1, &param, 0, NULL)) {
php_error(E_WARNING, "SSL: failed invoking reneg limit notification callback");
}
stream->flags ^= PHP_STREAM_FLAG_NO_FCLOSE;
@@ -1012,7 +1009,7 @@ static void limit_handshake_reneg(const SSL *ssl) /* {{{ */
zval_ptr_dtor(&retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SSL: client-initiated handshake rate limit exceeded by peer");
}
}
@@ -1069,7 +1066,7 @@ static void init_server_reneg_limit(php_stream *stream, php_openssl_netstream_da
}
/* }}} */
-static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
int rsa_key_size;
@@ -1078,7 +1075,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
if ((val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "rsa_key_size")) != NULL) {
rsa_key_size = (int) Z_LVAL_P(val);
if ((rsa_key_size != 1) && (rsa_key_size & (rsa_key_size - 1))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size);
+ php_error_docref(NULL, E_WARNING, "RSA key size requires a power of 2: %d", rsa_key_size);
rsa_key_size = 2048;
}
} else {
@@ -1088,7 +1085,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
rsa = RSA_generate_key(rsa_key_size, RSA_F4, NULL, NULL);
if (!SSL_CTX_set_tmp_rsa(ctx, rsa)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed setting RSA key");
+ php_error_docref(NULL, E_WARNING, "Failed setting RSA key");
RSA_free(rsa);
return FAILURE;
}
@@ -1099,7 +1096,7 @@ static int set_server_rsa_key(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{
}
/* }}} */
-static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
+static int set_server_dh_param(SSL_CTX *ctx, char *dh_path) /* {{{ */
{
DH *dh;
BIO* bio;
@@ -1107,7 +1104,7 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
bio = BIO_new_file(dh_path, "r");
if (bio == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid dh_param file: %s", dh_path);
+ php_error_docref(NULL, E_WARNING, "Invalid dh_param file: %s", dh_path);
return FAILURE;
}
@@ -1115,12 +1112,12 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
BIO_free(bio);
if (dh == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed reading DH params from file: %s", dh_path);
+ php_error_docref(NULL, E_WARNING, "Failed reading DH params from file: %s", dh_path);
return FAILURE;
}
if (SSL_CTX_set_tmp_dh(ctx, dh) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DH param assignment failed");
+ php_error_docref(NULL, E_WARNING, "DH param assignment failed");
DH_free(dh);
return FAILURE;
}
@@ -1132,7 +1129,7 @@ static int set_server_dh_param(SSL_CTX *ctx, char *dh_path TSRMLS_DC) /* {{{ */
/* }}} */
#ifdef HAVE_ECDH
-static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
int curve_nid;
@@ -1144,7 +1141,7 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
curve_str = Z_STRVAL_P(val);
curve_nid = OBJ_sn2nid(curve_str);
if (curve_nid == NID_undef) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid ECDH curve: %s", curve_str);
+ php_error_docref(NULL, E_WARNING, "Invalid ECDH curve: %s", curve_str);
return FAILURE;
}
} else {
@@ -1153,7 +1150,7 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
ecdh = EC_KEY_new_by_curve_name(curve_nid);
if (ecdh == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed generating ECDH curve");
return FAILURE;
@@ -1167,19 +1164,19 @@ static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /*
/* }}} */
#endif
-static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC) /* {{{ */
+static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *val;
long ssl_ctx_options = SSL_CTX_get_options(ctx);
#ifdef HAVE_ECDH
- if (FAILURE == set_server_ecdh_curve(stream, ctx TSRMLS_CC)) {
+ if (FAILURE == set_server_ecdh_curve(stream, ctx)) {
return FAILURE;
}
#else
val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "ecdh_curve");
if (val != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"ECDH curve support not compiled into the OpenSSL lib against which PHP is linked");
return FAILURE;
@@ -1188,25 +1185,25 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
if ((val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", "dh_param")) != NULL) {
convert_to_string_ex(val);
- if (FAILURE == set_server_dh_param(ctx, Z_STRVAL_P(val) TSRMLS_CC)) {
+ if (FAILURE == set_server_dh_param(ctx, Z_STRVAL_P(val))) {
return FAILURE;
}
}
- if (FAILURE == set_server_rsa_key(stream, ctx TSRMLS_CC)) {
+ if (FAILURE == set_server_rsa_key(stream, ctx)) {
return FAILURE;
}
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "honor_cipher_order")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ssl_ctx_options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
}
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "single_dh_use")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
ssl_ctx_options |= SSL_OP_SINGLE_DH_USE;
}
@@ -1214,7 +1211,7 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
#ifdef HAVE_ECDH
if (NULL != (val = php_stream_context_get_option(
PHP_STREAM_CONTEXT(stream), "ssl", "single_ecdh_use")) &&
- zend_is_true(val TSRMLS_CC)) {
+ zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_SINGLE_ECDH_USE;
}
#endif
@@ -1257,7 +1254,7 @@ static int server_sni_callback(SSL *ssl_handle, int *al, void *arg) /* {{{ */
}
/* }}} */
-static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC)
+static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock)
{
zval *val;
zval *current;
@@ -1268,7 +1265,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX *ctx;
/* If the stream ctx disables SNI we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val)) {
return SUCCESS;
}
@@ -1278,7 +1275,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
}
if (Z_TYPE_P(val) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs requires an array mapping host names to cert paths"
);
return FAILURE;
@@ -1286,7 +1283,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
sslsock->sni_cert_count = zend_hash_num_elements(Z_ARRVAL_P(val));
if (sslsock->sni_cert_count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs host cert array must not be empty"
);
return FAILURE;
@@ -1298,7 +1295,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(val), key_index,key, current) {
if (!key) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"SNI_server_certs array requires string host name keys"
);
return FAILURE;
@@ -1310,7 +1307,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
ctx = SSL_CTX_new(SSLv23_server_method());
if (SSL_CTX_use_certificate_chain_file(ctx, resolved_path_buff) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting local cert chain file `%s'; " \
"check that your cafile/capath settings include " \
"details of your certificate and its issuer",
@@ -1319,7 +1316,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX_free(ctx);
return FAILURE;
} else if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting private key from file `%s'",
resolved_path_buff
);
@@ -1331,7 +1328,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
++i;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"failed setting local cert chain file `%s'; file not found",
Z_STRVAL_P(current)
);
@@ -1344,13 +1341,13 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
return SUCCESS;
}
-static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC) /* {{{ */
+static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock) /* {{{ */
{
zval *val;
char *sni_server_name;
/* If SNI is explicitly disabled we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(val)) {
return;
}
@@ -1383,7 +1380,7 @@ int php_openssl_setup_crypto(php_stream *stream,
if (sslsock->ssl_handle) {
if (sslsock->s.is_blocked) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL/TLS already set-up for this stream");
+ php_error_docref(NULL, E_WARNING, "SSL/TLS already set-up for this stream");
return FAILURE;
} else {
return SUCCESS;
@@ -1400,13 +1397,13 @@ int php_openssl_setup_crypto(php_stream *stream,
/* Should we use a specific crypto method or is generic SSLv23 okay? */
if ((method_flags & (method_flags-1)) == 0) {
ssl_ctx_options = SSL_OP_ALL;
- method = php_select_crypto_method(method_flags, sslsock->is_client TSRMLS_CC);
+ method = php_select_crypto_method(method_flags, sslsock->is_client);
if (method == NULL) {
return FAILURE;
}
} else {
method = sslsock->is_client ? SSLv23_client_method() : SSLv23_server_method();
- ssl_ctx_options = php_get_crypto_method_ctx_flags(method_flags TSRMLS_CC);
+ ssl_ctx_options = php_get_crypto_method_ctx_flags(method_flags);
if (ssl_ctx_options == -1) {
return FAILURE;
}
@@ -1420,12 +1417,12 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
if (sslsock->ctx == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL context creation failure");
+ php_error_docref(NULL, E_WARNING, "SSL context creation failure");
return FAILURE;
}
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL
- if (GET_VER_OPT("no_ticket") && zend_is_true(val TSRMLS_CC)) {
+ if (GET_VER_OPT("no_ticket") && zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_NO_TICKET;
}
#endif
@@ -1435,14 +1432,14 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- if (!GET_VER_OPT("disable_compression") || zend_is_true(val TSRMLS_CC)) {
+ if (!GET_VER_OPT("disable_compression") || zend_is_true(val)) {
ssl_ctx_options |= SSL_OP_NO_COMPRESSION;
}
#endif
- if (GET_VER_OPT("verify_peer") && !zend_is_true(val TSRMLS_CC)) {
- disable_peer_verification(sslsock->ctx, stream TSRMLS_CC);
- } else if (FAILURE == enable_peer_verification(sslsock->ctx, stream TSRMLS_CC)) {
+ if (GET_VER_OPT("verify_peer") && !zend_is_true(val)) {
+ disable_peer_verification(sslsock->ctx, stream);
+ } else if (FAILURE == enable_peer_verification(sslsock->ctx, stream)) {
return FAILURE;
}
@@ -1463,7 +1460,7 @@ int php_openssl_setup_crypto(php_stream *stream,
return FAILURE;
}
}
- if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) {
+ if (FAILURE == set_local_cert(sslsock->ctx, stream)) {
return FAILURE;
}
@@ -1471,14 +1468,14 @@ int php_openssl_setup_crypto(php_stream *stream,
if (sslsock->is_client == 0 &&
PHP_STREAM_CONTEXT(stream) &&
- FAILURE == set_server_specific_opts(stream, sslsock->ctx TSRMLS_CC)
+ FAILURE == set_server_specific_opts(stream, sslsock->ctx)
) {
return FAILURE;
}
sslsock->ssl_handle = SSL_new(sslsock->ctx);
if (sslsock->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL handle creation failure");
+ php_error_docref(NULL, E_WARNING, "SSL handle creation failure");
SSL_CTX_free(sslsock->ctx);
sslsock->ctx = NULL;
return FAILURE;
@@ -1487,12 +1484,12 @@ int php_openssl_setup_crypto(php_stream *stream,
}
if (!SSL_set_fd(sslsock->ssl_handle, sslsock->s.socket)) {
- handle_ssl_error(stream, 0, 1 TSRMLS_CC);
+ handle_ssl_error(stream, 0, 1);
}
#ifdef HAVE_SNI
/* Enable server-side SNI */
- if (sslsock->is_client == 0 && enable_server_sni(stream, sslsock TSRMLS_CC) == FAILURE) {
+ if (sslsock->is_client == 0 && enable_server_sni(stream, sslsock) == FAILURE) {
return FAILURE;
}
#endif
@@ -1511,9 +1508,9 @@ int php_openssl_setup_crypto(php_stream *stream,
if (cparam->inputs.session) {
if (cparam->inputs.session->ops != &php_openssl_socket_ops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied session stream must be an SSL enabled stream");
+ php_error_docref(NULL, E_WARNING, "supplied session stream must be an SSL enabled stream");
} else if (((php_openssl_netstream_data_t*)cparam->inputs.session->abstract)->ssl_handle == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "supplied SSL session stream is not initialized");
+ php_error_docref(NULL, E_WARNING, "supplied SSL session stream is not initialized");
} else {
SSL_copy_session_id(sslsock->ssl_handle, ((php_openssl_netstream_data_t*)cparam->inputs.session->abstract)->ssl_handle);
}
@@ -1551,23 +1548,23 @@ static zend_array *capture_session_meta(SSL *ssl_handle) /* {{{ */
}
/* }}} */
-static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *sslsock, X509 *peer_cert TSRMLS_DC) /* {{{ */
+static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *sslsock, X509 *peer_cert) /* {{{ */
{
zval *val, zcert;
int cert_captured = 0;
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_peer_cert")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
- zend_register_resource(&zcert, peer_cert, php_openssl_get_x509_list_id() TSRMLS_CC);
+ zend_register_resource(&zcert, peer_cert, php_openssl_get_x509_list_id());
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_certificate", &zcert);
cert_captured = 1;
}
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_peer_cert_chain")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
zval arr;
STACK_OF(X509) *chain;
@@ -1580,7 +1577,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
for (i = 0; i < sk_X509_num(chain); i++) {
X509 *mycert = X509_dup(sk_X509_value(chain, i));
- zend_register_resource(&zcert, mycert, php_openssl_get_x509_list_id() TSRMLS_CC);
+ zend_register_resource(&zcert, mycert, php_openssl_get_x509_list_id());
add_next_index_zval(&arr, &zcert);
}
@@ -1614,7 +1611,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
#ifdef HAVE_SNI
if (sslsock->is_client) {
- enable_client_sni(stream, sslsock TSRMLS_CC);
+ enable_client_sni(stream, sslsock);
}
#endif
@@ -1627,7 +1624,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
sslsock->state_set = 1;
}
- if (SUCCESS == php_set_sock_blocking(sslsock->s.socket, 0 TSRMLS_CC)) {
+ if (SUCCESS == php_set_sock_blocking(sslsock->s.socket, 0)) {
sslsock->s.is_blocked = 0;
}
@@ -1660,14 +1657,14 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (elapsed_time.tv_sec > timeout->tv_sec ||
(elapsed_time.tv_sec == timeout->tv_sec &&
elapsed_time.tv_usec > timeout->tv_usec)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL: Handshake timed out");
+ php_error_docref(NULL, E_WARNING, "SSL: Handshake timed out");
return -1;
}
}
if (n <= 0) {
/* in case of SSL_ERROR_WANT_READ/WRITE, do not retry in non-blocking mode */
- retry = handle_ssl_error(stream, n, blocked TSRMLS_CC);
+ retry = handle_ssl_error(stream, n, blocked);
if (retry) {
/* wait until something interesting happens in the socket. It may be a
* timeout. Also consider the unlikely of possibility of a write block */
@@ -1690,17 +1687,17 @@ static int php_openssl_enable_crypto(php_stream *stream,
}
} while (retry);
- if (sslsock->s.is_blocked != blocked && SUCCESS == php_set_sock_blocking(sslsock->s.socket, blocked TSRMLS_CC)) {
+ if (sslsock->s.is_blocked != blocked && SUCCESS == php_set_sock_blocking(sslsock->s.socket, blocked)) {
sslsock->s.is_blocked = blocked;
}
if (n == 1) {
peer_cert = SSL_get_peer_certificate(sslsock->ssl_handle);
if (peer_cert && PHP_STREAM_CONTEXT(stream)) {
- cert_captured = capture_peer_certs(stream, sslsock, peer_cert TSRMLS_CC);
+ cert_captured = capture_peer_certs(stream, sslsock, peer_cert);
}
- if (FAILURE == apply_peer_verification_policy(sslsock->ssl_handle, peer_cert, stream TSRMLS_CC)) {
+ if (FAILURE == apply_peer_verification_policy(sslsock->ssl_handle, peer_cert, stream)) {
SSL_shutdown(sslsock->ssl_handle);
n = -1;
} else {
@@ -1711,7 +1708,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "capture_session_meta")) &&
- zend_is_true(val TSRMLS_CC)
+ zend_is_true(val)
) {
zval meta_arr;
ZVAL_ARR(&meta_arr, capture_session_meta(sslsock->ssl_handle));
@@ -1726,7 +1723,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
n = -1;
peer_cert = SSL_get_peer_certificate(sslsock->ssl_handle);
if (peer_cert && PHP_STREAM_CONTEXT(stream)) {
- cert_captured = capture_peer_certs(stream, sslsock, peer_cert TSRMLS_CC);
+ cert_captured = capture_peer_certs(stream, sslsock, peer_cert);
}
}
@@ -1745,7 +1742,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
return -1;
}
-static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int didwrite;
@@ -1757,7 +1754,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
didwrite = SSL_write(sslsock->ssl_handle, buf, count);
if (didwrite <= 0) {
- retry = handle_ssl_error(stream, didwrite, 0 TSRMLS_CC);
+ retry = handle_ssl_error(stream, didwrite, 0);
} else {
break;
}
@@ -1767,7 +1764,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
php_stream_notify_progress_increment(PHP_STREAM_CONTEXT(stream), didwrite, 0);
}
} else {
- didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
+ didwrite = php_stream_socket_ops.write(stream, buf, count);
}
if (didwrite < 0) {
@@ -1778,7 +1775,7 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
}
/* }}} */
-static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
int nr_bytes = 0;
@@ -1791,12 +1788,12 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
if (sslsock->reneg && sslsock->reneg->should_close) {
/* renegotiation rate limiting triggered */
- php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
+ php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR);
nr_bytes = 0;
stream->eof = 1;
break;
} else if (nr_bytes <= 0) {
- retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
+ retry = handle_ssl_error(stream, nr_bytes, 0);
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
} else {
@@ -1811,7 +1808,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
}
else
{
- nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
+ nr_bytes = php_stream_socket_ops.read(stream, buf, count);
}
if (nr_bytes < 0) {
@@ -1822,7 +1819,7 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
}
/* }}} */
-static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_close(php_stream *stream, int close_handle) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
#ifdef PHP_WIN32
@@ -1890,20 +1887,20 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_
}
/* }}} */
-static int php_openssl_sockop_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_flush(php_stream *stream) /* {{{ */
{
- return php_stream_socket_ops.flush(stream TSRMLS_CC);
+ return php_stream_socket_ops.flush(stream);
}
/* }}} */
-static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
- return php_stream_socket_ops.stat(stream, ssb TSRMLS_CC);
+ return php_stream_socket_ops.stat(stream, ssb);
}
/* }}} */
static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock,
- php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC)
+ php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
@@ -1951,9 +1948,9 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
clisockdata->method = sock->method;
if (php_stream_xport_crypto_setup(xparam->outputs.client, clisockdata->method,
- NULL TSRMLS_CC) < 0 || php_stream_xport_crypto_enable(
- xparam->outputs.client, 1 TSRMLS_CC) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto");
+ NULL) < 0 || php_stream_xport_crypto_enable(
+ xparam->outputs.client, 1) < 0) {
+ php_error_docref(NULL, E_WARNING, "Failed to enable crypto");
php_stream_close(xparam->outputs.client);
xparam->outputs.client = NULL;
@@ -1965,7 +1962,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
return xparam->outputs.client == NULL ? -1 : 0;
}
-static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_openssl_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
php_stream_xport_crypto_param *cparam = (php_stream_xport_crypto_param *)ptrparam;
@@ -2030,11 +2027,11 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
switch(cparam->op) {
case STREAM_XPORT_CRYPTO_OP_SETUP:
- cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam TSRMLS_CC);
+ cparam->outputs.returncode = php_openssl_setup_crypto(stream, sslsock, cparam);
return PHP_STREAM_OPTION_RETURN_OK;
break;
case STREAM_XPORT_CRYPTO_OP_ENABLE:
- cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam TSRMLS_CC);
+ cparam->outputs.returncode = php_openssl_enable_crypto(stream, sslsock, cparam);
return PHP_STREAM_OPTION_RETURN_OK;
break;
default:
@@ -2051,16 +2048,16 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
case STREAM_XPORT_OP_CONNECT_ASYNC:
/* TODO: Async connects need to check the enable_on_connect option when
* we notice that the connect has actually been established */
- php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC);
+ php_stream_socket_ops.set_option(stream, option, value, ptrparam);
if ((sslsock->enable_on_connect) &&
((xparam->outputs.returncode == 0) ||
(xparam->op == STREAM_XPORT_OP_CONNECT_ASYNC &&
xparam->outputs.returncode == 1 && xparam->outputs.error_code == EINPROGRESS)))
{
- if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to enable crypto");
+ if (php_stream_xport_crypto_setup(stream, sslsock->method, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_error_docref(NULL, E_WARNING, "Failed to enable crypto");
xparam->outputs.returncode = -1;
}
}
@@ -2069,7 +2066,7 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
case STREAM_XPORT_OP_ACCEPT:
/* we need to copy the additional fields that the underlying tcp transport
* doesn't know about */
- xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC TSRMLS_CC);
+ xparam->outputs.returncode = php_openssl_tcp_sockop_accept(stream, sslsock, xparam STREAMS_CC);
return PHP_STREAM_OPTION_RETURN_OK;
@@ -2080,10 +2077,10 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
}
}
- return php_stream_socket_ops.set_option(stream, option, value, ptrparam TSRMLS_CC);
+ return php_stream_socket_ops.set_option(stream, option, value, ptrparam);
}
-static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret)
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -2144,7 +2141,7 @@ static zend_long get_crypto_method(php_stream_context *ctx, zend_long crypto_met
return crypto_method;
}
-static char *get_url_name(const char *resourcename, size_t resourcenamelen, int is_persistent TSRMLS_DC)
+static char *get_url_name(const char *resourcename, size_t resourcenamelen, int is_persistent)
{
php_url *url;
@@ -2183,7 +2180,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
const char *resourcename, size_t resourcenamelen,
const char *persistent_id, int options, int flags,
struct timeval *timeout,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_openssl_netstream_data_t *sslsock = NULL;
@@ -2219,7 +2216,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->method = get_crypto_method(context, STREAM_CRYPTO_METHOD_ANY_CLIENT);
} else if (strncmp(proto, "sslv2", protolen) == 0) {
#ifdef OPENSSL_NO_SSL2
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#else
sslsock->enable_on_connect = 1;
@@ -2227,7 +2224,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
#endif
} else if (strncmp(proto, "sslv3", protolen) == 0) {
#ifdef OPENSSL_NO_SSL3
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#else
sslsock->enable_on_connect = 1;
@@ -2244,7 +2241,7 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->enable_on_connect = 1;
sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
} else if (strncmp(proto, "tlsv1.2", protolen) == 0) {
@@ -2252,12 +2249,12 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->enable_on_connect = 1;
sslsock->method = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
+ php_error_docref(NULL, E_WARNING, "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against");
return NULL;
#endif
}
- sslsock->url_name = get_url_name(resourcename, resourcenamelen, !!persistent_id TSRMLS_CC);
+ sslsock->url_name = get_url_name(resourcename, resourcenamelen, !!persistent_id);
return stream;
}
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 1b5efed1c1..d26e691075 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl)
{
php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU);
php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU);
- php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC);
+ php_add_tick_function(pcntl_signal_dispatch);
return SUCCESS;
}
@@ -545,7 +545,7 @@ PHP_FUNCTION(pcntl_fork)
id = fork();
if (id == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d", errno);
}
RETURN_LONG((zend_long) id);
@@ -558,7 +558,7 @@ PHP_FUNCTION(pcntl_alarm)
{
zend_long seconds;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &seconds) == FAILURE)
return;
RETURN_LONG ((zend_long) alarm(seconds));
@@ -574,7 +574,7 @@ PHP_FUNCTION(pcntl_waitpid)
int status;
pid_t child_id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/|l", &pid, &z_status, &options) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz/|l", &pid, &z_status, &options) == FAILURE)
return;
convert_to_long_ex(z_status);
@@ -602,7 +602,7 @@ PHP_FUNCTION(pcntl_wait)
int status;
pid_t child_id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|l", &z_status, &options) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/|l", &z_status, &options) == FAILURE)
return;
convert_to_long_ex(z_status);
@@ -635,7 +635,7 @@ PHP_FUNCTION(pcntl_wifexited)
#ifdef WIFEXITED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -653,7 +653,7 @@ PHP_FUNCTION(pcntl_wifstopped)
#ifdef WIFSTOPPED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -671,7 +671,7 @@ PHP_FUNCTION(pcntl_wifsignaled)
#ifdef WIFSIGNALED
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -689,7 +689,7 @@ PHP_FUNCTION(pcntl_wexitstatus)
#ifdef WEXITSTATUS
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -707,7 +707,7 @@ PHP_FUNCTION(pcntl_wtermsig)
#ifdef WTERMSIG
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -725,7 +725,7 @@ PHP_FUNCTION(pcntl_wstopsig)
#ifdef WSTOPSIG
zend_long status_word;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &status_word) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
return;
}
@@ -753,7 +753,7 @@ PHP_FUNCTION(pcntl_exec)
size_t path_len;
zend_ulong key_num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
return;
}
@@ -811,7 +811,7 @@ PHP_FUNCTION(pcntl_exec)
if (execve(path, argv, envp) == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
/* Cleanup */
@@ -821,7 +821,7 @@ PHP_FUNCTION(pcntl_exec)
if (execv(path, argv) == -1) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Error has occurred: (errno %d) %s", errno, strerror(errno));
}
}
@@ -840,12 +840,12 @@ PHP_FUNCTION(pcntl_signal)
zend_long signo;
zend_bool restart_syscalls = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz|b", &signo, &handle, &restart_syscalls) == FAILURE) {
return;
}
if (signo < 1 || signo > 32) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid signal");
+ php_error_docref(NULL, E_WARNING, "Invalid signal");
RETURN_FALSE;
}
@@ -865,21 +865,21 @@ PHP_FUNCTION(pcntl_signal)
/* Special long value case for SIG_DFL and SIG_IGN */
if (Z_TYPE_P(handle) == IS_LONG) {
if (Z_LVAL_P(handle) != (zend_long) SIG_DFL && Z_LVAL_P(handle) != (zend_long) SIG_IGN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value for handle argument specified");
+ php_error_docref(NULL, E_WARNING, "Invalid value for handle argument specified");
RETURN_FALSE;
}
if (php_signal(signo, (Sigfunc *) Z_LVAL_P(handle), (int) restart_syscalls) == SIG_ERR) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
+ php_error_docref(NULL, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
zend_hash_index_del(&PCNTL_G(php_signal_table), signo);
RETURN_TRUE;
}
- if (!zend_is_callable(handle, 0, &func_name TSRMLS_CC)) {
+ if (!zend_is_callable(handle, 0, &func_name)) {
PCNTL_G(last_error) = EINVAL;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a callable function name error", func_name->val);
+ php_error_docref(NULL, E_WARNING, "%s is not a callable function name error", func_name->val);
zend_string_release(func_name);
RETURN_FALSE;
}
@@ -892,7 +892,7 @@ PHP_FUNCTION(pcntl_signal)
if (php_signal4(signo, pcntl_signal_handler, (int) restart_syscalls, 1) == SIG_ERR) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
+ php_error_docref(NULL, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -917,13 +917,13 @@ PHP_FUNCTION(pcntl_sigprocmask)
zval *user_set, *user_oldset = NULL, *user_signo;
sigset_t set, oldset;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|z/", &how, &user_set, &user_oldset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "la|z/", &how, &user_set, &user_oldset) == FAILURE) {
return;
}
if (sigemptyset(&set) != 0 || sigemptyset(&oldset) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -935,14 +935,14 @@ PHP_FUNCTION(pcntl_sigprocmask)
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
if (sigprocmask(how, &set, &oldset) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -977,18 +977,18 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
struct timespec timeout;
if (timedwait) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z/ll", &user_set, &user_siginfo, &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|z/ll", &user_set, &user_siginfo, &tv_sec, &tv_nsec) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|z/", &user_set, &user_siginfo) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|z/", &user_set, &user_siginfo) == FAILURE) {
return;
}
}
if (sigemptyset(&set) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -1000,7 +1000,7 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
} ZEND_HASH_FOREACH_END();
@@ -1014,7 +1014,7 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{
}
if (signo == -1 && errno != EAGAIN) {
PCNTL_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
/*
@@ -1096,7 +1096,7 @@ PHP_FUNCTION(pcntl_getpriority)
zend_long pid = getpid();
int pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &pid, &who) == FAILURE) {
RETURN_FALSE;
}
@@ -1109,13 +1109,13 @@ PHP_FUNCTION(pcntl_getpriority)
PCNTL_G(last_error) = errno;
switch (errno) {
case ESRCH:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: No process was located using the given parameters", errno);
break;
case EINVAL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Invalid identifier flag", errno);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
+ php_error_docref(NULL, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
@@ -1135,7 +1135,7 @@ PHP_FUNCTION(pcntl_setpriority)
zend_long pid = getpid();
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &pri, &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &pri, &pid, &who) == FAILURE) {
RETURN_FALSE;
}
@@ -1143,19 +1143,19 @@ PHP_FUNCTION(pcntl_setpriority)
PCNTL_G(last_error) = errno;
switch (errno) {
case ESRCH:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: No process was located using the given parameters", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: No process was located using the given parameters", errno);
break;
case EINVAL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Invalid identifier flag", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Invalid identifier flag", errno);
break;
case EPERM:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: A process was located, but neither its effective nor real user ID matched the effective user ID of the caller", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: A process was located, but neither its effective nor real user ID matched the effective user ID of the caller", errno);
break;
case EACCES:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
+ php_error_docref(NULL, E_WARNING, "Error %d: Only a super user may attempt to increase the process priority", errno);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error %d has occurred", errno);
+ php_error_docref(NULL, E_WARNING, "Unknown error %d has occurred", errno);
break;
}
RETURN_FALSE;
@@ -1180,7 +1180,7 @@ PHP_FUNCTION(pcntl_strerror)
{
zend_long error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &error) == FAILURE) {
RETURN_FALSE;
}
@@ -1192,7 +1192,6 @@ PHP_FUNCTION(pcntl_strerror)
static void pcntl_signal_handler(int signo)
{
struct php_pcntl_pending_signal *psig;
- TSRMLS_FETCH();
psig = PCNTL_G(spares);
if (!psig) {
@@ -1221,7 +1220,6 @@ void pcntl_signal_dispatch()
struct php_pcntl_pending_signal *queue, *next;
sigset_t mask;
sigset_t old_mask;
- TSRMLS_FETCH();
if(!PCNTL_G(pending_signals)) {
return;
@@ -1252,7 +1250,7 @@ void pcntl_signal_dispatch()
/* Call php signal handler - Note that we do not report errors, and we ignore the return value */
/* FIXME: this is probably broken when multiple signals are handled in this while loop (retval) */
- call_user_function(EG(function_table), NULL, handle, &retval, 1, &param TSRMLS_CC);
+ call_user_function(EG(function_table), NULL, handle, &retval, 1, &param);
zval_ptr_dtor(&param);
zval_ptr_dtor(&retval);
}
diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c
index aa2139342c..4090fe6fb9 100644
--- a/ext/pcntl/php_signal.c
+++ b/ext/pcntl/php_signal.c
@@ -29,7 +29,6 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
{
struct sigaction act,oact;
#ifdef ZEND_SIGNALS
- TSRMLS_FETCH();
#endif
act.sa_handler = func;
if (mask_all) {
@@ -48,7 +47,7 @@ Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all)
#endif
}
#ifdef ZEND_SIGNALS
- if (zend_sigaction(signo, &act, &oact TSRMLS_CC) < 0)
+ if (zend_sigaction(signo, &act, &oact) < 0)
#else
if (sigaction(signo, &act, &oact) < 0)
#endif
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6f9f2aebbf..0555f596a9 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -56,7 +56,7 @@ enum {
ZEND_DECLARE_MODULE_GLOBALS(pcre)
-static void pcre_handle_exec_error(int pcre_code TSRMLS_DC) /* {{{ */
+static void pcre_handle_exec_error(int pcre_code) /* {{{ */
{
int preg_code = 0;
@@ -173,7 +173,7 @@ static PHP_MSHUTDOWN_FUNCTION(pcre)
/* }}} */
/* {{{ static pcre_clean_cache */
-static int pcre_clean_cache(zval *data, void *arg TSRMLS_DC)
+static int pcre_clean_cache(zval *data, void *arg)
{
int *num_clean = (int *)arg;
@@ -187,7 +187,7 @@ static int pcre_clean_cache(zval *data, void *arg TSRMLS_DC)
/* }}} */
/* {{{ static make_subpats_table */
-static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_DC)
+static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce)
{
pcre_extra *extra = pce->extra;
int name_cnt = pce->name_count, name_size, ni = 0;
@@ -201,7 +201,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
rc2 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size);
rc = rc2 ? rc2 : rc1;
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
@@ -210,7 +210,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1];
subpat_names[name_idx] = name_table + 2;
if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric named subpatterns are not allowed");
+ php_error_docref(NULL, E_WARNING, "Numeric named subpatterns are not allowed");
efree(subpat_names);
return NULL;
}
@@ -222,7 +222,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
/* {{{ pcre_get_compiled_regex_cache
*/
-PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC)
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
{
pcre *re = NULL;
pcre_extra *extra;
@@ -281,7 +281,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
get to the end without encountering a delimiter. */
while (isspace((int)*(unsigned char *)p)) p++;
if (*p == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
p < regex->val + regex->len ? "Null byte in regex" : "Empty regular expression");
return NULL;
}
@@ -290,7 +290,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
or a backslash. */
delimiter = *p++;
if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Delimiter must not be alphanumeric or backslash");
+ php_error_docref(NULL,E_WARNING, "Delimiter must not be alphanumeric or backslash");
return NULL;
}
@@ -330,11 +330,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
if (*pp == 0) {
if (pp < regex->val + regex->len) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ php_error_docref(NULL,E_WARNING, "Null byte in regex");
} else if (start_delimiter == end_delimiter) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
+ php_error_docref(NULL,E_WARNING, "No ending delimiter '%c' found", delimiter);
} else {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
+ php_error_docref(NULL,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
}
return NULL;
}
@@ -379,9 +379,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
default:
if (pp[-1]) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ php_error_docref(NULL,E_WARNING, "Unknown modifier '%c'", pp[-1]);
} else {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ php_error_docref(NULL,E_WARNING, "Null byte in regex");
}
efree(pattern);
return NULL;
@@ -401,7 +401,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
tables);
if (re == NULL) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
+ php_error_docref(NULL,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset);
efree(pattern);
if (tables) {
pefree((void*)tables, 1);
@@ -427,7 +427,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
}
if (error != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern");
+ php_error_docref(NULL, E_WARNING, "Error while studying pattern");
}
} else {
extra = NULL;
@@ -442,7 +442,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
*/
if (zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) {
int num_clean = PCRE_CACHE_SIZE / 8;
- zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean TSRMLS_CC);
+ zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean);
}
/* Store the compiled pattern and extra info in the cache. */
@@ -457,13 +457,13 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &new_entry.capture_count);
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &new_entry.name_count);
if (rc < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
+ php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc);
return NULL;
}
@@ -483,9 +483,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
/* {{{ pcre_get_compiled_regex
*/
-PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *preg_options TSRMLS_DC)
+PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *preg_options)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
if (extra) {
*extra = pce ? pce->extra : NULL;
@@ -500,9 +500,9 @@ PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int
/* {{{ pcre_get_compiled_regex_ex
*/
-PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC)
+PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *compile_options)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
if (extra) {
*extra = pce ? pce->extra : NULL;
@@ -548,7 +548,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
zend_long start_offset = 0; /* Where the new search starts */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/ll", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/ll", &regex,
&subject, &subpats, &flags, &start_offset) == FAILURE) {
RETURN_FALSE;
}
@@ -564,18 +564,18 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
php_pcre_match_impl(pce, subject->val, (int)subject->len, return_value, subpats,
- global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC);
+ global, ZEND_NUM_ARGS() >= 4, flags, start_offset);
}
/* }}} */
/* {{{ php_pcre_match_impl() */
PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC)
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset)
{
zval result_set, /* Holds a set of subpatterns after
a global match */
@@ -621,7 +621,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
}
if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) ||
(!global && subpats_order != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid flags specified");
+ php_error_docref(NULL, E_WARNING, "Invalid flags specified");
return;
}
} else {
@@ -657,7 +657,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
*/
subpat_names = NULL;
if (pce->name_count > 0) {
- subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
+ subpat_names = make_subpats_table(num_subpats, pce);
if (!subpat_names) {
RETURN_FALSE;
}
@@ -690,7 +690,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -711,7 +711,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
efree(offsets);
}
if (match_sets) efree(match_sets);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get subpatterns list failed");
+ php_error_docref(NULL, E_WARNING, "Get subpatterns list failed");
RETURN_FALSE;
}
@@ -839,7 +839,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
} else
break;
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
break;
}
@@ -951,7 +951,7 @@ static int preg_get_backref(char **str, int *backref)
/* {{{ preg_do_repl_func
*/
-static zend_string *preg_do_repl_func(zval *function, char *subject, int *offsets, char **subpat_names, int count, unsigned char *mark TSRMLS_DC)
+static zend_string *preg_do_repl_func(zval *function, char *subject, int *offsets, char **subpat_names, int count, unsigned char *mark)
{
zend_string *result_str;
zval retval; /* Function return value */
@@ -975,12 +975,12 @@ static zend_string *preg_do_repl_func(zval *function, char *subject, int *offset
add_assoc_string(&args[0], "MARK", (char *) mark);
}
- if (call_user_function_ex(EG(function_table), NULL, function, &retval, 1, args, 0, NULL TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (call_user_function_ex(EG(function_table), NULL, function, &retval, 1, args, 0, NULL) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
result_str = zval_get_string(&retval);
zval_ptr_dtor(&retval);
} else {
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+ php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
}
result_str = zend_string_init(&subject[offsets[0]], offsets[1] - offsets[0], 0);
@@ -995,7 +995,7 @@ static zend_string *preg_do_repl_func(zval *function, char *subject, int *offset
/* {{{ preg_do_eval
*/
static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject,
- int *offsets, int count TSRMLS_DC)
+ int *offsets, int count)
{
zval retval; /* Return value from evaluation */
char *eval_str_end, /* End of eval string */
@@ -1032,7 +1032,7 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
match = subject + offsets[backref<<1];
match_len = offsets[(backref<<1)+1] - offsets[backref<<1];
if (match_len) {
- esc_match = php_addslashes(match, match_len, 0 TSRMLS_CC);
+ esc_match = php_addslashes(match, match_len, 0);
} else {
esc_match = zend_string_init(match, match_len, 0);
}
@@ -1054,11 +1054,11 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
smart_str_appendl(&code, segment, walk - segment);
smart_str_0(&code);
- compiled_string_description = zend_make_compiled_string_description("regexp code" TSRMLS_CC);
+ compiled_string_description = zend_make_compiled_string_description("regexp code");
/* Run the code */
- if (zend_eval_stringl(code.s->val, code.s->len, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
+ if (zend_eval_stringl(code.s->val, code.s->len, &retval, compiled_string_description) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.s->val);
+ php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, code.s->val);
/* zend_error() does not return in this case */
}
efree(compiled_string_description);
@@ -1079,23 +1079,23 @@ static zend_string *preg_do_eval(char *eval_str, int eval_str_len, char *subject
PHPAPI zend_string *php_pcre_replace(zend_string *regex,
char *subject, int subject_len,
zval *replace_val, int is_callable_replace,
- int limit, int *replace_count TSRMLS_DC)
+ int limit, int *replace_count)
{
pcre_cache_entry *pce; /* Compiled regular expression */
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
return NULL;
}
return php_pcre_replace_impl(pce, subject, subject_len, replace_val,
- is_callable_replace, limit, replace_count TSRMLS_CC);
+ is_callable_replace, limit, replace_count);
}
/* }}} */
/* {{{ php_pcre_replace_impl() */
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *replace_val,
- int is_callable_replace, int limit, int *replace_count TSRMLS_DC)
+ int is_callable_replace, int limit, int *replace_count)
{
pcre_extra *extra = pce->extra;/* Holds results of studying */
pcre_extra extra_data; /* Used locally for exec options */
@@ -1136,7 +1136,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
eval = pce->preg_options & PREG_REPLACE_EVAL;
if (is_callable_replace) {
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifier /e cannot be used with replacement callback");
+ php_error_docref(NULL, E_WARNING, "Modifier /e cannot be used with replacement callback");
return NULL;
}
} else {
@@ -1146,7 +1146,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
}
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The /e modifier is deprecated, use preg_replace_callback instead");
+ php_error_docref(NULL, E_DEPRECATED, "The /e modifier is deprecated, use preg_replace_callback instead");
}
/* Calculate the size of the offsets array, and allocate memory for it. */
@@ -1164,7 +1164,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
*/
subpat_names = NULL;
if (pce->name_count > 0) {
- subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC);
+ subpat_names = make_subpats_table(num_subpats, pce);
if (!subpat_names) {
return NULL;
}
@@ -1193,7 +1193,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL,E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -1211,11 +1211,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* If evaluating, do it and add the return string's length */
if (eval) {
eval_result = preg_do_eval(replace, replace_len, subject,
- offsets, count TSRMLS_CC);
+ offsets, count);
new_len += (int)eval_result->len;
} else if (is_callable_replace) {
/* Use custom function to get replacement string and its length. */
- eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark TSRMLS_CC);
+ eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark);
new_len += (int)eval_result->len;
} else { /* do regular substitution */
walk = replace;
@@ -1309,7 +1309,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
break;
}
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
zend_string_free(result);
result = NULL;
break;
@@ -1343,7 +1343,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
/* {{{ php_replace_in_subject
*/
-static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *subject, int limit, int is_callable_replace, int *replace_count TSRMLS_DC)
+static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *subject, int limit, int is_callable_replace, int *replace_count)
{
zval *regex_entry,
*replace_entry = NULL,
@@ -1397,7 +1397,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
replace_value,
is_callable_replace,
limit,
- replace_count TSRMLS_CC)) != NULL) {
+ replace_count)) != NULL) {
zend_string_release(subject_str);
subject_str = result;
} else {
@@ -1417,7 +1417,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
replace,
is_callable_replace,
limit,
- replace_count TSRMLS_CC);
+ replace_count);
zend_string_release(subject_str);
return result;
}
@@ -1443,7 +1443,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
#ifndef FAST_ZPP
/* Get function parameters and do error-checking. */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|lz/", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|lz/", &regex, &replace, &subject, &limit, &zcount) == FAILURE) {
return;
}
#else
@@ -1458,7 +1458,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
#endif
if (!is_callable_replace && Z_TYPE_P(replace) == IS_ARRAY && Z_TYPE_P(regex) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
+ php_error_docref(NULL, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
RETURN_FALSE;
}
@@ -1467,8 +1467,8 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
convert_to_string_ex(replace);
}
if (is_callable_replace) {
- if (!zend_is_callable(replace, 0, &callback_name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name->val);
+ if (!zend_is_callable(replace, 0, &callback_name)) {
+ php_error_docref(NULL, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name->val);
zend_string_release(callback_name);
ZVAL_DUP(return_value, subject);
return;
@@ -1493,7 +1493,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
and add the result to the return_value array. */
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
old_replace_count = replace_count;
- if ((result = php_replace_in_subject(regex, replace, subject_entry, limit_val, is_callable_replace, &replace_count TSRMLS_CC)) != NULL) {
+ if ((result = php_replace_in_subject(regex, replace, subject_entry, limit_val, is_callable_replace, &replace_count)) != NULL) {
if (!is_filter || replace_count > old_replace_count) {
/* Add to return array */
if (string_key) {
@@ -1508,7 +1508,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
} ZEND_HASH_FOREACH_END();
} else { /* if subject is not an array */
old_replace_count = replace_count;
- if ((result = php_replace_in_subject(regex, replace, subject, limit_val, is_callable_replace, &replace_count TSRMLS_CC)) != NULL) {
+ if ((result = php_replace_in_subject(regex, replace, subject, limit_val, is_callable_replace, &replace_count)) != NULL) {
if (!is_filter || replace_count > old_replace_count) {
RETVAL_STR(result);
} else {
@@ -1560,7 +1560,7 @@ static PHP_FUNCTION(preg_split)
/* Get function parameters and do error checking */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", &regex,
&subject, &subject_len, &limit_val, &flags) == FAILURE) {
RETURN_FALSE;
}
@@ -1575,18 +1575,18 @@ static PHP_FUNCTION(preg_split)
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
- php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags TSRMLS_CC);
+ php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags);
}
/* }}} */
/* {{{ php_pcre_split
*/
PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zend_long limit_val, zend_long flags TSRMLS_DC)
+ zend_long limit_val, zend_long flags)
{
pcre_extra *extra = NULL; /* Holds results of studying */
pcre *re_bump = NULL; /* Regex instance for empty matches */
@@ -1651,7 +1651,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC,E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL,E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
}
@@ -1702,7 +1702,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
if (re_bump == NULL) {
int dummy;
zend_string *regex = zend_string_init("/./us", sizeof("/./us")-1, 0);
- re_bump = pcre_get_compiled_regex(regex, &extra_bump, &dummy TSRMLS_CC);
+ re_bump = pcre_get_compiled_regex(regex, &extra_bump, &dummy);
zend_string_release(regex);
if (re_bump == NULL) {
RETURN_FALSE;
@@ -1712,7 +1712,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
subject_len, start_offset,
exoptions, offsets, size_offsets);
if (count < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
RETURN_FALSE;
}
} else {
@@ -1722,7 +1722,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
} else
break;
} else {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
break;
}
@@ -1778,7 +1778,7 @@ static PHP_FUNCTION(preg_quote)
/* Get the arguments and check for errors */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &in_str, &in_str_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &in_str, &in_str_len,
&delim, &delim_len) == FAILURE) {
return;
}
@@ -1867,7 +1867,7 @@ static PHP_FUNCTION(preg_grep)
/* Get arguments and do error checking */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sa|l", &regex,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sa|l", &regex,
&input, &flags) == FAILURE) {
return;
}
@@ -1881,15 +1881,15 @@ static PHP_FUNCTION(preg_grep)
#endif
/* Compile regex or get it from cache. */
- if ((pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC)) == NULL) {
+ if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
RETURN_FALSE;
}
- php_pcre_grep_impl(pce, input, return_value, flags TSRMLS_CC);
+ php_pcre_grep_impl(pce, input, return_value, flags);
}
/* }}} */
-PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags TSRMLS_DC) /* {{{ */
+PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags) /* {{{ */
{
zval *entry; /* An entry in the input array */
pcre_extra *extra = pce->extra;/* Holds results of studying */
@@ -1939,10 +1939,10 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
/* Check for too many substrings condition. */
if (count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
+ php_error_docref(NULL, E_NOTICE, "Matched, but too many substrings");
count = size_offsets/3;
} else if (count < 0 && count != PCRE_ERROR_NOMATCH) {
- pcre_handle_exec_error(count TSRMLS_CC);
+ pcre_handle_exec_error(count);
zend_string_release(subject_str);
break;
}
@@ -1978,7 +1978,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
static PHP_FUNCTION(preg_last_error)
{
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
#else
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index 5ed39deaea..86f13e3447 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -33,9 +33,9 @@
#include <locale.h>
#endif
-PHPAPI zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC);
+PHPAPI zend_string *php_pcre_replace(zend_string *regex, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count);
+PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
+PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry
@@ -54,19 +54,19 @@ typedef struct {
int refcount;
} pcre_cache_entry;
-PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC);
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC);
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset);
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
+ int is_callable_replace, int limit, int *replace_count);
PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zend_long limit_val, zend_long flags TSRMLS_DC);
+ zend_long limit_val, zend_long flags);
PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value,
- zend_long flags TSRMLS_DC);
+ zend_long flags);
ZEND_BEGIN_MODULE_GLOBALS(pcre)
HashTable pcre_cache;
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 61c68ff46d..0e2759793b 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -77,7 +77,7 @@ PDO_API char *php_pdo_str_tolower_dup(const char *src, int len) /* {{{ */
}
/* }}} */
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC) /* {{{ */
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
{
#if defined(HAVE_SPL)
if (!root) {
@@ -93,7 +93,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC) /* {{{
}
}
#endif
- return zend_exception_get_default(TSRMLS_C);
+ return zend_exception_get_default();
}
/* }}} */
@@ -309,7 +309,7 @@ PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_s
/* }}} */
static const char digit_vec[] = "0123456789";
-PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC) /* {{{ */
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
{
char buffer[65];
char outbuf[65] = "";
@@ -368,12 +368,12 @@ PHP_MINIT_FUNCTION(pdo)
INIT_CLASS_ENTRY(ce, "PDOException", NULL);
- pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0 TSRMLS_CC) TSRMLS_CC);
+ pdo_exception_ce = zend_register_internal_class_ex(&ce, php_pdo_get_exception_base(0));
- zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(pdo_exception_ce, "errorInfo", sizeof("errorInfo")-1, ZEND_ACC_PUBLIC);
- pdo_dbh_init(TSRMLS_C);
- pdo_stmt_init(TSRMLS_C);
+ pdo_dbh_init();
+ pdo_stmt_init();
return SUCCESS;
}
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 571e08b4c0..abd0590e1c 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -36,9 +36,9 @@
#include "zend_object_handlers.h"
#include "zend_hash.h"
-static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSRMLS_DC);
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value);
-void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp TSRMLS_DC) /* {{{ */
+void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp) /* {{{ */
{
pdo_error_type *pdo_err = &dbh->error_code;
char *message = NULL;
@@ -72,24 +72,24 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
}
if (dbh && dbh->error_mode != PDO_ERRMODE_EXCEPTION) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
} else {
zval ex, info;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_string(def_ex, &ex, "message", sizeof("message")-1, message TSRMLS_CC);
- zend_update_property_string(def_ex, &ex, "code", sizeof("code")-1, *pdo_err TSRMLS_CC);
+ zend_update_property_string(def_ex, &ex, "message", sizeof("message")-1, message);
+ zend_update_property_string(def_ex, &ex, "code", sizeof("code")-1, *pdo_err);
array_init(&info);
add_next_index_string(&info, *pdo_err);
add_next_index_long(&info, 0);
- zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo")-1, &info TSRMLS_CC);
+ zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo")-1, &info);
zval_ptr_dtor(&info);
- zend_throw_exception_object(&ex TSRMLS_CC);
+ zend_throw_exception_object(&ex);
}
if (message) {
@@ -98,7 +98,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
}
/* }}} */
-PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */
{
pdo_error_type *pdo_err = &dbh->error_code;
const char *msg = "<<Unknown>>";
@@ -127,7 +127,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
add_next_index_string(&info, *pdo_err);
- if (dbh->methods->fetch_err(dbh, stmt, &info TSRMLS_CC)) {
+ if (dbh->methods->fetch_err(dbh, stmt, &info)) {
zval *item;
if ((item = zend_hash_index_find(Z_ARRVAL(info), 1)) != NULL) {
@@ -147,21 +147,21 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
}
if (dbh->error_mode == PDO_ERRMODE_WARNING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message->val);
+ php_error_docref(NULL, E_WARNING, "%s", message->val);
} else if (EG(exception) == NULL) {
zval ex;
- zend_class_entry *def_ex = php_pdo_get_exception_base(1 TSRMLS_CC), *pdo_ex = php_pdo_get_exception();
+ zend_class_entry *def_ex = php_pdo_get_exception_base(1), *pdo_ex = php_pdo_get_exception();
object_init_ex(&ex, pdo_ex);
- zend_update_property_str(def_ex, &ex, "message", sizeof("message") - 1, message TSRMLS_CC);
- zend_update_property_string(def_ex, &ex, "code", sizeof("code") - 1, *pdo_err TSRMLS_CC);
+ zend_update_property_str(def_ex, &ex, "message", sizeof("message") - 1, message);
+ zend_update_property_string(def_ex, &ex, "code", sizeof("code") - 1, *pdo_err);
if (!Z_ISUNDEF(info)) {
- zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo") - 1, &info TSRMLS_CC);
+ zend_update_property(pdo_ex, &ex, "errorInfo", sizeof("errorInfo") - 1, &info);
}
- zend_throw_exception_object(&ex TSRMLS_CC);
+ zend_throw_exception_object(&ex);
}
if (!Z_ISUNDEF(info)) {
@@ -178,7 +178,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC) /* {{{
}
/* }}} */
-static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) /* {{{ */
+static char *dsn_from_uri(char *uri, char *buf, size_t buflen) /* {{{ */
{
php_stream *stream;
char *dsn = NULL;
@@ -209,7 +209,7 @@ static PHP_METHOD(PDO, dbh_constructor)
char alt_dsn[512];
int call_factory = 1;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!a!", &data_source, &data_source_len,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!a!", &data_source, &data_source_len,
&username, &usernamelen, &password, &passwordlen, &options)) {
ZEND_CTOR_MAKE_NULL();
return;
@@ -224,7 +224,7 @@ static PHP_METHOD(PDO, dbh_constructor)
snprintf(alt_dsn, sizeof(alt_dsn), "pdo.dsn.%s", data_source);
if (FAILURE == cfg_get_string(alt_dsn, &ini_dsn)) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -233,7 +233,7 @@ static PHP_METHOD(PDO, dbh_constructor)
colon = strchr(data_source, ':');
if (!colon) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via INI: %s)", alt_dsn);
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name (via INI: %s)", alt_dsn);
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -241,15 +241,15 @@ static PHP_METHOD(PDO, dbh_constructor)
if (!strncmp(data_source, "uri:", sizeof("uri:")-1)) {
/* the specified URI holds connection details */
- data_source = dsn_from_uri(data_source + sizeof("uri:")-1, alt_dsn, sizeof(alt_dsn) TSRMLS_CC);
+ data_source = dsn_from_uri(data_source + sizeof("uri:")-1, alt_dsn, sizeof(alt_dsn));
if (!data_source) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source URI");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source URI");
ZEND_CTOR_MAKE_NULL();
return;
}
colon = strchr(data_source, ':');
if (!colon) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "invalid data source name (via URI)");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "invalid data source name (via URI)");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -260,7 +260,7 @@ static PHP_METHOD(PDO, dbh_constructor)
if (!driver) {
/* NB: don't want to include the data_source in the error message as
* it might contain a password */
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "could not find driver");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "could not find driver");
ZEND_CTOR_MAKE_NULL();
return;
}
@@ -300,7 +300,7 @@ static PHP_METHOD(PDO, dbh_constructor)
pdbh = (pdo_dbh_t*)le->ptr;
/* is the connection still alive ? */
- if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh TSRMLS_CC)) {
+ if (pdbh->methods->check_liveness && FAILURE == (pdbh->methods->check_liveness)(pdbh)) {
/* nope... need to kill it */
/*??? memory leak */
zend_list_close(le);
@@ -316,13 +316,13 @@ static PHP_METHOD(PDO, dbh_constructor)
pdbh = pecalloc(1, sizeof(*pdbh), 1);
if (!pdbh) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO handle");
/* NOTREACHED */
}
pdbh->is_persistent = 1;
if (!(pdbh->persistent_id = pemalloc(plen + 1, 1))) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO handle");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO handle");
}
memcpy((char *)pdbh->persistent_id, hashkey, plen+1);
pdbh->persistent_id_len = plen;
@@ -350,10 +350,10 @@ static PHP_METHOD(PDO, dbh_constructor)
dbh->default_fetch_type = PDO_FETCH_BOTH;
}
- dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1 TSRMLS_CC);
+ dbh->auto_commit = pdo_attr_lval(options, PDO_ATTR_AUTOCOMMIT, 1);
if (!dbh->data_source || (username && !dbh->username) || (password && !dbh->password)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory");
+ php_error_docref(NULL, E_ERROR, "out of memory");
}
if (!call_factory) {
@@ -361,7 +361,7 @@ static PHP_METHOD(PDO, dbh_constructor)
goto options;
}
- if (driver->db_handle_factory(dbh, options TSRMLS_CC)) {
+ if (driver->db_handle_factory(dbh, options)) {
/* all set */
if (is_persistent) {
@@ -377,7 +377,7 @@ static PHP_METHOD(PDO, dbh_constructor)
if ((zend_hash_str_update_mem(&EG(persistent_list),
(char*)dbh->persistent_id, dbh->persistent_id_len, &le, sizeof(le))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry");
+ php_error_docref(NULL, E_ERROR, "Failed to register persistent entry");
}
}
@@ -392,7 +392,7 @@ options:
if (str_key) {
continue;
}
- pdo_dbh_attribute_set(dbh, long_key, attr_value TSRMLS_CC);
+ pdo_dbh_attribute_set(dbh, long_key, attr_value);
} ZEND_HASH_FOREACH_END();
}
@@ -405,15 +405,15 @@ options:
}
/* }}} */
-static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args) /* {{{ */
{
if (!Z_ISUNDEF_P(ctor_args)) {
if (Z_TYPE_P(ctor_args) != IS_ARRAY) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "constructor arguments must be passed as an array");
return NULL;
}
if (!dbstmt_ce->constructor) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "user-supplied statement does not accept constructor arguments");
return NULL;
}
}
@@ -425,14 +425,14 @@ static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry
return object;
} /* }}} */
-static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args) /* {{{ */
{
zval query_string;
zval z_key;
ZVAL_STRINGL(&query_string, stmt->query_string, stmt->query_stringlen);
ZVAL_STRINGL(&z_key, "queryString", sizeof("queryString") - 1);
- std_object_handlers.write_property(object, &z_key, &query_string, NULL TSRMLS_CC);
+ std_object_handlers.write_property(object, &z_key, &query_string, NULL);
zval_ptr_dtor(&query_string);
zval_ptr_dtor(&z_key);
@@ -451,7 +451,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
fci.params = NULL;
fci.no_separation = 1;
- zend_fcall_info_args(&fci, ctor_args TSRMLS_CC);
+ zend_fcall_info_args(&fci, ctor_args);
fcc.initialized = 1;
fcc.function_handler = dbstmt_ce->constructor;
@@ -459,7 +459,7 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
fcc.called_scope = Z_OBJCE_P(object);
fcc.object = Z_OBJ_P(object);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
Z_OBJ_P(object) = NULL;
ZEND_CTOR_MAKE_NULL();
object = NULL; /* marks failure */
@@ -484,7 +484,7 @@ static PHP_METHOD(PDO, prepare)
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(getThis());
pdo_dbh_t *dbh = dbh_obj->inner;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &statement,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &statement,
&statement_len, &options)) {
RETURN_FALSE;
}
@@ -495,7 +495,7 @@ static PHP_METHOD(PDO, prepare)
if (ZEND_NUM_ARGS() > 1 && (opt = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_STATEMENT_CLASS)) != NULL) {
if (Z_TYPE_P(opt) != IS_ARRAY || (item = zend_hash_index_find(Z_ARRVAL_P(opt), 0)) == NULL
|| Z_TYPE_P(item) != IS_STRING
- || (pce = zend_lookup_class(Z_STR_P(item) TSRMLS_CC)) == NULL
+ || (pce = zend_lookup_class(Z_STR_P(item))) == NULL
) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
@@ -505,15 +505,15 @@ static PHP_METHOD(PDO, prepare)
RETURN_FALSE;
}
dbstmt_ce = pce;
- if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce TSRMLS_CC)) {
+ if (!instanceof_function(dbstmt_ce, pdo_dbstmt_ce)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ "user-supplied statement class must be derived from PDOStatement");
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
if (dbstmt_ce->constructor && !(dbstmt_ce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ "user-supplied statement class cannot have a public constructor");
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
}
@@ -535,7 +535,7 @@ static PHP_METHOD(PDO, prepare)
ZVAL_COPY_VALUE(&ctor_args, &dbh->def_stmt_ctor_args);
}
- if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, &ctor_args TSRMLS_CC)) {
+ if (!pdo_stmt_instantiate(dbh, return_value, dbstmt_ce, &ctor_args)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"failed to instantiate user-supplied statement class"
TSRMLS_CC);
@@ -555,8 +555,8 @@ static PHP_METHOD(PDO, prepare)
/* we haven't created a lazy object yet */
ZVAL_UNDEF(&stmt->lazy_object_ref);
- if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) {
- pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC);
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options)) {
+ pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args);
return;
}
@@ -581,18 +581,18 @@ static PHP_METHOD(PDO, beginTransaction)
PDO_CONSTRUCT_CHECK;
if (dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is already an active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is already an active transaction");
RETURN_FALSE;
}
if (!dbh->methods->begin) {
/* TODO: this should be an exception; see the auto-commit mode
* comments below */
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "This driver doesn't support transactions");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "This driver doesn't support transactions");
RETURN_FALSE;
}
- if (dbh->methods->begin(dbh TSRMLS_CC)) {
+ if (dbh->methods->begin(dbh)) {
dbh->in_txn = 1;
RETURN_TRUE;
}
@@ -614,11 +614,11 @@ static PHP_METHOD(PDO, commit)
PDO_CONSTRUCT_CHECK;
if (!dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is no active transaction");
RETURN_FALSE;
}
- if (dbh->methods->commit(dbh TSRMLS_CC)) {
+ if (dbh->methods->commit(dbh)) {
dbh->in_txn = 0;
RETURN_TRUE;
}
@@ -640,11 +640,11 @@ static PHP_METHOD(PDO, rollBack)
PDO_CONSTRUCT_CHECK;
if (!dbh->in_txn) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "There is no active transaction");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "There is no active transaction");
RETURN_FALSE;
}
- if (dbh->methods->rollback(dbh TSRMLS_CC)) {
+ if (dbh->methods->rollback(dbh)) {
dbh->in_txn = 0;
RETURN_TRUE;
}
@@ -669,16 +669,16 @@ static PHP_METHOD(PDO, inTransaction)
RETURN_BOOL(dbh->in_txn);
}
- RETURN_BOOL(dbh->methods->in_transaction(dbh TSRMLS_CC));
+ RETURN_BOOL(dbh->methods->in_transaction(dbh));
}
/* }}} */
-static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSRMLS_DC) /* {{{ */
+static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value) /* {{{ */
{
#define PDO_LONG_PARAM_CHECK \
if (Z_TYPE_P(value) != IS_LONG && Z_TYPE_P(value) != IS_STRING && Z_TYPE_P(value) != IS_FALSE && Z_TYPE_P(value) != IS_TRUE) { \
- pdo_raise_impl_error(dbh, NULL, "HY000", "attribute value must be an integer" TSRMLS_CC); \
+ pdo_raise_impl_error(dbh, NULL, "HY000", "attribute value must be an integer"); \
PDO_HANDLE_DBH_ERR(); \
return FAILURE; \
} \
@@ -694,7 +694,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
dbh->error_mode = Z_LVAL_P(value);
return SUCCESS;
default:
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid error mode");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -710,7 +710,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
dbh->desired_case = Z_LVAL_P(value);
return SUCCESS;
default:
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid case folding mode");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -727,7 +727,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
zval *tmp;
if ((tmp = zend_hash_index_find(Z_ARRVAL_P(value), 0)) != NULL && Z_TYPE_P(tmp) == IS_LONG) {
if (Z_LVAL_P(tmp) == PDO_FETCH_INTO || Z_LVAL_P(tmp) == PDO_FETCH_CLASS) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch modes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "FETCH_INTO and FETCH_CLASS are not yet supported as default fetch modes");
return FAILURE;
}
}
@@ -736,7 +736,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
}
convert_to_long(value);
if (Z_LVAL_P(value) == PDO_FETCH_USE_DEFAULT) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type");
return FAILURE;
}
dbh->default_fetch_type = Z_LVAL_P(value);
@@ -763,7 +763,7 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
if (Z_TYPE_P(value) != IS_ARRAY
|| (item = zend_hash_index_find(Z_ARRVAL_P(value), 0)) == NULL
|| Z_TYPE_P(item) != IS_STRING
- || (pce = zend_lookup_class(Z_STR_P(item) TSRMLS_CC)) == NULL
+ || (pce = zend_lookup_class(Z_STR_P(item))) == NULL
) {
pdo_raise_impl_error(dbh, NULL, "HY000",
"PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); "
@@ -772,15 +772,15 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
- if (!instanceof_function(pce, pdo_dbstmt_ce TSRMLS_CC)) {
+ if (!instanceof_function(pce, pdo_dbstmt_ce)) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class must be derived from PDOStatement" TSRMLS_CC);
+ "user-supplied statement class must be derived from PDOStatement");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
if (pce->constructor && !(pce->constructor->common.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED))) {
pdo_raise_impl_error(dbh, NULL, "HY000",
- "user-supplied statement class cannot have a public constructor" TSRMLS_CC);
+ "user-supplied statement class cannot have a public constructor");
PDO_HANDLE_DBH_ERR();
return FAILURE;
}
@@ -812,15 +812,15 @@ static int pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value TSR
}
PDO_DBH_CLEAR_ERR();
- if (dbh->methods->set_attribute(dbh, attr, value TSRMLS_CC)) {
+ if (dbh->methods->set_attribute(dbh, attr, value)) {
return SUCCESS;
}
fail:
if (attr == PDO_ATTR_AUTOCOMMIT) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "The auto-commit mode cannot be changed for this driver");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "The auto-commit mode cannot be changed for this driver");
} else if (!dbh->methods->set_attribute) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support setting attributes");
} else {
PDO_HANDLE_DBH_ERR();
}
@@ -836,14 +836,14 @@ static PHP_METHOD(PDO, setAttribute)
zend_long attr;
zval *value;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &attr, &value)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lz", &attr, &value)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- if (pdo_dbh_attribute_set(dbh, attr, value TSRMLS_CC) != FAILURE) {
+ if (pdo_dbh_attribute_set(dbh, attr, value) != FAILURE) {
RETURN_TRUE;
}
RETURN_FALSE;
@@ -857,7 +857,7 @@ static PHP_METHOD(PDO, getAttribute)
pdo_dbh_t *dbh = Z_PDO_DBH_P(getThis());
zend_long attr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr)) {
RETURN_FALSE;
}
@@ -896,17 +896,17 @@ static PHP_METHOD(PDO, getAttribute)
}
if (!dbh->methods->get_attribute) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support getting attributes");
RETURN_FALSE;
}
- switch (dbh->methods->get_attribute(dbh, attr, return_value TSRMLS_CC)) {
+ switch (dbh->methods->get_attribute(dbh, attr, return_value)) {
case -1:
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
case 0:
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support that attribute");
RETURN_FALSE;
default:
@@ -924,17 +924,17 @@ static PHP_METHOD(PDO, exec)
size_t statement_len;
zend_long ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &statement, &statement_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &statement, &statement_len)) {
RETURN_FALSE;
}
if (!statement_len) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "trying to execute an empty query" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "trying to execute an empty query");
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- ret = dbh->methods->doer(dbh, statement, statement_len TSRMLS_CC);
+ ret = dbh->methods->doer(dbh, statement, statement_len);
if(ret == -1) {
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
@@ -952,19 +952,19 @@ static PHP_METHOD(PDO, lastInsertId)
char *name = NULL;
size_t namelen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &namelen)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &name, &namelen)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
if (!dbh->methods->last_id) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support lastInsertId()");
RETURN_FALSE;
} else {
int id_len;
char *id;
- id = dbh->methods->last_id(dbh, name, (unsigned int *)&id_len TSRMLS_CC);
+ id = dbh->methods->last_id(dbh, name, (unsigned int *)&id_len);
if (!id) {
PDO_HANDLE_DBH_ERR();
RETURN_FALSE;
@@ -1029,7 +1029,7 @@ static PHP_METHOD(PDO, errorInfo)
}
if (dbh->methods->fetch_err) {
- dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value TSRMLS_CC);
+ dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value);
}
/**
@@ -1062,11 +1062,11 @@ static PHP_METHOD(PDO, query)
/* Return a meaningful error when no parameters were passed */
if (!ZEND_NUM_ARGS()) {
- zend_parse_parameters(0 TSRMLS_CC, "z|z", NULL, NULL);
+ zend_parse_parameters(0, "z|z", NULL, NULL);
RETURN_FALSE;
}
- if (FAILURE == zend_parse_parameters(1 TSRMLS_CC, "s", &statement,
+ if (FAILURE == zend_parse_parameters(1, "s", &statement,
&statement_len)) {
RETURN_FALSE;
}
@@ -1074,8 +1074,8 @@ static PHP_METHOD(PDO, query)
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
- if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC)) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class" TSRMLS_CC);
+ if (!pdo_stmt_instantiate(dbh, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "failed to instantiate user supplied statement class");
return;
}
stmt = Z_PDO_STMT_P(return_value);
@@ -1094,22 +1094,22 @@ static PHP_METHOD(PDO, query)
/* we haven't created a lazy object yet */
ZVAL_UNDEF(&stmt->lazy_object_ref);
- if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL TSRMLS_CC)) {
+ if (dbh->methods->preparer(dbh, statement, statement_len, stmt, NULL)) {
PDO_STMT_CLEAR_ERR();
if (ZEND_NUM_ARGS() == 1 || SUCCESS == pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, 1)) {
/* now execute the statement */
PDO_STMT_CLEAR_ERR();
- if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ if (stmt->methods->executer(stmt)) {
int ret = 1;
if (!stmt->executed) {
if (stmt->dbh->alloc_own_columns) {
- ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ ret = pdo_stmt_describe_columns(stmt);
}
stmt->executed = 1;
}
if (ret) {
- pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC);
+ pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args);
return;
}
}
@@ -1138,18 +1138,18 @@ static PHP_METHOD(PDO, quote)
char *qstr;
int qlen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &paramtype)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &paramtype)) {
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();
PDO_CONSTRUCT_CHECK;
if (!dbh->methods->quoter) {
- pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting" TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "IM001", "driver does not support quoting");
RETURN_FALSE;
}
- if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype TSRMLS_CC)) {
+ if (dbh->methods->quoter(dbh, str, str_len, &qstr, &qlen, paramtype)) {
RETVAL_STRINGL(qstr, qlen);
efree(qstr);
return;
@@ -1163,7 +1163,7 @@ static PHP_METHOD(PDO, quote)
Prevents use of a PDO instance that has been unserialized */
static PHP_METHOD(PDO, __wakeup)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances");
}
/* }}} */
@@ -1171,7 +1171,7 @@ static PHP_METHOD(PDO, __wakeup)
Prevents serialization of a PDO instance */
static PHP_METHOD(PDO, __sleep)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDO instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDO instances");
}
/* }}} */
@@ -1264,7 +1264,7 @@ static void cls_method_dtor(zval *el) /* {{{ */ {
/* }}} */
/* {{{ overloaded object handlers for PDO class */
-int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
+int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
{
const zend_function_entry *funcs;
zend_function func;
@@ -1276,13 +1276,13 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) {
return 0;
}
- funcs = dbh->methods->get_driver_methods(dbh, kind TSRMLS_CC);
+ funcs = dbh->methods->get_driver_methods(dbh, kind);
if (!funcs) {
return 0;
}
if (!(dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent))) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "out of memory while allocating PDO methods.");
+ php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO methods.");
}
zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, cls_method_dtor, dbh->is_persistent, 0);
@@ -1329,7 +1329,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind TSRMLS_DC)
return 1;
}
-static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key TSRMLS_DC)
+static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key)
{
zend_function *fbc = NULL;
pdo_dbh_object_t *dbh_obj = php_pdo_dbh_fetch_object(*object);
@@ -1338,12 +1338,12 @@ static union _zend_function *dbh_method_get(zend_object **object, zend_string *m
lc_method_name = zend_string_init(method_name->val, method_name->len, 0);
zend_str_tolower_copy(lc_method_name->val, method_name->val, method_name->len);
- if ((fbc = std_object_handlers.get_method(object, method_name, key TSRMLS_CC)) == NULL) {
+ if ((fbc = std_object_handlers.get_method(object, method_name, key)) == NULL) {
/* not a pre-defined method, nor a user-defined method; check
* the driver specific methods */
if (!dbh_obj->inner->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
if (!pdo_hash_methods(dbh_obj,
- PDO_DBH_DRIVER_METHOD_KIND_DBH TSRMLS_CC)
+ PDO_DBH_DRIVER_METHOD_KIND_DBH)
|| !dbh_obj->inner->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH]) {
goto out;
}
@@ -1357,20 +1357,20 @@ out:
return fbc;
}
-static int dbh_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int dbh_compare(zval *object1, zval *object2)
{
return -1;
}
static zend_object_handlers pdo_dbh_object_handlers;
-static void pdo_dbh_free_storage(zend_object *std TSRMLS_DC);
+static void pdo_dbh_free_storage(zend_object *std);
-void pdo_dbh_init(TSRMLS_D)
+void pdo_dbh_init(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
- pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbh_ce = zend_register_internal_class(&ce);
pdo_dbh_ce->create_object = pdo_dbh_new;
memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
@@ -1478,7 +1478,7 @@ void pdo_dbh_init(TSRMLS_D)
}
-static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
+static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent)
{
int i;
@@ -1492,7 +1492,7 @@ static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
}
if (dbh->methods) {
- dbh->methods->closer(dbh TSRMLS_CC);
+ dbh->methods->closer(dbh);
}
if (dbh->data_source) {
@@ -1523,27 +1523,27 @@ static void dbh_free(pdo_dbh_t *dbh, zend_bool free_persistent TSRMLS_DC)
pefree(dbh, dbh->is_persistent);
}
-static void pdo_dbh_free_storage(zend_object *std TSRMLS_DC)
+static void pdo_dbh_free_storage(zend_object *std)
{
pdo_dbh_t *dbh = php_pdo_dbh_fetch_inner(std);
if (dbh->in_txn && dbh->methods && dbh->methods->rollback) {
- dbh->methods->rollback(dbh TSRMLS_CC);
+ dbh->methods->rollback(dbh);
dbh->in_txn = 0;
}
if (dbh->is_persistent && dbh->methods && dbh->methods->persistent_shutdown) {
- dbh->methods->persistent_shutdown(dbh TSRMLS_CC);
+ dbh->methods->persistent_shutdown(dbh);
}
- zend_object_std_dtor(std TSRMLS_CC);
- dbh_free(dbh, 0 TSRMLS_CC);
+ zend_object_std_dtor(std);
+ dbh_free(dbh, 0);
}
-zend_object *pdo_dbh_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_dbh_new(zend_class_entry *ce)
{
pdo_dbh_object_t *dbh;
dbh = ecalloc(1, sizeof(pdo_dbh_object_t) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&dbh->std, ce TSRMLS_CC);
+ zend_object_std_init(&dbh->std, ce);
object_properties_init(&dbh->std, ce);
rebuild_object_properties(&dbh->std);
dbh->inner = ecalloc(1, sizeof(pdo_dbh_t));
@@ -1560,7 +1560,7 @@ ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor) /* {{{ */
{
if (res->ptr) {
pdo_dbh_t *dbh = (pdo_dbh_t*)res->ptr;
- dbh_free(dbh, 1 TSRMLS_CC);
+ dbh_free(dbh, 1);
res->ptr = NULL;
}
}
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 9dd7305723..be65a927dd 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -419,7 +419,7 @@ static void free_param_name(zval *el) {
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC)
+ char **outquery, int *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;
@@ -473,7 +473,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* did the query make sense to me? */
if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
/* they mixed both types; punt */
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters");
ret = -1;
goto clean_up;
}
@@ -497,7 +497,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* Do we have placeholders but no bound params */
if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound");
ret = -1;
goto clean_up;
}
@@ -516,7 +516,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
goto safe;
}
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens");
ret = -1;
goto clean_up;
}
@@ -537,7 +537,7 @@ safe:
if (param == NULL) {
/* parameter was not defined */
ret = -1;
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
goto clean_up;
}
if (stmt->dbh->methods->quoter) {
@@ -556,7 +556,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!stmt->dbh->methods->quoter(stmt->dbh, buf->val, buf->len, &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -569,7 +569,7 @@ safe:
zend_string_release(buf);
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
ret = -1;
goto clean_up;
}
@@ -600,7 +600,7 @@ safe:
convert_to_string(&tmp_param);
if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param),
Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -740,7 +740,7 @@ clean_up:
#if 0
int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
- int *outquery_len TSRMLS_DC)
+ int *outquery_len)
{
Scanner s;
char *ptr;
@@ -805,7 +805,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
@@ -841,7 +841,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index 79e167ba1d..847f69ac18 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -81,7 +81,7 @@ static void free_param_name(zval *el) {
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC)
+ char **outquery, int *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;
@@ -135,7 +135,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* did the query make sense to me? */
if (query_type == (PDO_PLACEHOLDER_NAMED|PDO_PLACEHOLDER_POSITIONAL)) {
/* they mixed both types; punt */
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "mixed named and positional parameters");
ret = -1;
goto clean_up;
}
@@ -159,7 +159,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* Do we have placeholders but no bound params */
if (bindno && !params && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound");
ret = -1;
goto clean_up;
}
@@ -178,7 +178,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
goto safe;
}
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens");
ret = -1;
goto clean_up;
}
@@ -199,7 +199,7 @@ safe:
if (param == NULL) {
/* parameter was not defined */
ret = -1;
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
goto clean_up;
}
if (stmt->dbh->methods->quoter) {
@@ -218,7 +218,7 @@ safe:
buf = php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0);
if (!stmt->dbh->methods->quoter(stmt->dbh, buf->val, buf->len, &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -231,7 +231,7 @@ safe:
zend_string_release(buf);
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
ret = -1;
goto clean_up;
}
@@ -262,7 +262,7 @@ safe:
convert_to_string(&tmp_param);
if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param),
Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen,
- param->param_type TSRMLS_CC)) {
+ param->param_type)) {
/* bork */
ret = -1;
strncpy(stmt->error_code, stmt->dbh->error_code, 6);
@@ -402,7 +402,7 @@ clean_up:
#if 0
int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char **outquery,
- int *outquery_len TSRMLS_DC)
+ int *outquery_len)
{
Scanner s;
char *ptr;
@@ -467,7 +467,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
@@ -503,7 +503,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
/* quote the bind value if necessary */
if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
- Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen TSRMLS_CC))
+ Z_STRLEN_P(param->parameter), &quotedstr, &quotedstrlen))
{
memcpy(ptr, quotedstr, quotedstrlen);
ptr += quotedstrlen;
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 1491c80cfd..397300050d 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -115,11 +115,11 @@ ZEND_END_ARG_INFO()
static PHP_FUNCTION(dbstmt_constructor) /* {{{ */
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a PDOStatement manually");
+ php_error_docref(NULL, E_ERROR, "You should not create a PDOStatement manually");
}
/* }}} */
-static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param TSRMLS_DC) /* {{{ */
+static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_param_data *param) /* {{{ */
{
if (stmt->bound_param_map) {
/* rewriting :name to ? style.
@@ -141,7 +141,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
param->name = zend_string_init(name, strlen(name), 0);
return 1;
}
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
return 0;
}
@@ -151,13 +151,13 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
continue;
}
if (param->paramno >= 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead");
return -1;
}
param->paramno = position;
return 1;
} ZEND_HASH_FOREACH_END();
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined");
return 0;
}
return 1;
@@ -165,7 +165,7 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
/* }}} */
/* trigger callback hook for parameters */
-static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_type) /* {{{ */
{
int ret = 1, is_param = 1;
struct pdo_bound_param_data *param;
@@ -180,7 +180,7 @@ static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_typ
iterate:
if (ht) {
ZEND_HASH_FOREACH_PTR(ht, param) {
- if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) {
+ if (!stmt->methods->param_hook(stmt, param, event_type)) {
ret = 0;
break;
}
@@ -196,14 +196,14 @@ iterate:
}
/* }}} */
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
{
int col;
stmt->columns = ecalloc(stmt->column_count, sizeof(struct pdo_column_data));
for (col = 0; col < stmt->column_count; col++) {
- if (!stmt->methods->describer(stmt, col TSRMLS_CC)) {
+ if (!stmt->methods->describer(stmt, col)) {
return 0;
}
@@ -254,12 +254,12 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value TSRMLS_DC) /* {{{ */
+static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
{
if (Z_ISUNDEF(stmt->lazy_object_ref)) {
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
row->stmt = stmt;
- zend_object_std_init(&row->std, pdo_row_ce TSRMLS_CC);
+ zend_object_std_init(&row->std, pdo_row_ce);
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
row->std.handlers = &pdo_row_object_handlers;
stmt->std.gc.refcount++;
@@ -274,8 +274,7 @@ static void param_dtor(zval *el) /* {{{ */
/* tell the driver that it is going away */
if (param->stmt->methods->param_hook) {
- TSRMLS_FETCH();
- param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE TSRMLS_CC);
+ param->stmt->methods->param_hook(param->stmt, param, PDO_PARAM_EVT_FREE);
}
if (param->name) {
@@ -293,7 +292,7 @@ static void param_dtor(zval *el) /* {{{ */
}
/* }}} */
-static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param TSRMLS_DC) /* {{{ */
+static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_stmt_t *stmt, int is_param) /* {{{ */
{
HashTable *hash;
zval *parameter;
@@ -356,7 +355,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
if (param->paramno == -1) {
char *tmp;
spprintf(&tmp, 0, "Did not find column name '%s' in the defined columns; it will not be bound", param->name->val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", tmp TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", tmp);
efree(tmp);
}
}
@@ -372,7 +371,7 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s
}
}
- if (is_param && !rewrite_name_to_position(stmt, param TSRMLS_CC)) {
+ if (is_param && !rewrite_name_to_position(stmt, param)) {
if (param->name) {
zend_string_release(param->name);
param->name = NULL;
@@ -437,7 +436,7 @@ static PHP_METHOD(PDOStatement, execute)
int ret = 1;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &input_params)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|a!", &input_params)) {
RETURN_FALSE;
}
@@ -466,7 +465,7 @@ static PHP_METHOD(PDOStatement, execute)
/* we're okay to be zero based here */
/* num_index is unsignend
if (num_index < 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", NULL);
RETURN_FALSE;
}
*/
@@ -476,7 +475,7 @@ static PHP_METHOD(PDOStatement, execute)
param.param_type = PDO_PARAM_STR;
ZVAL_COPY(&param.parameter, tmp);
- if (!really_register_bound_param(&param, stmt, 1 TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, 1)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&param.parameter);
}
@@ -492,7 +491,7 @@ static PHP_METHOD(PDOStatement, execute)
*/
ret = pdo_parse_params(stmt, stmt->query_string, stmt->query_stringlen,
- &stmt->active_query_string, &stmt->active_query_stringlen TSRMLS_CC);
+ &stmt->active_query_string, &stmt->active_query_stringlen);
if (ret == 0) {
/* no changes were made */
@@ -504,11 +503,11 @@ static PHP_METHOD(PDOStatement, execute)
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE TSRMLS_CC)) {
+ } else if (!dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_PRE)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- if (stmt->methods->executer(stmt TSRMLS_CC)) {
+ if (stmt->methods->executer(stmt)) {
if (stmt->active_query_string && stmt->active_query_string != stmt->query_string) {
efree(stmt->active_query_string);
}
@@ -519,13 +518,13 @@ static PHP_METHOD(PDOStatement, execute)
if (stmt->dbh->alloc_own_columns && !stmt->columns) {
/* for "big boy" drivers, we need to allocate memory to fetch
* the results into, so lets do that now */
- ret = pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ ret = pdo_stmt_describe_columns(stmt);
}
stmt->executed = 1;
}
- if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST TSRMLS_CC)) {
+ if (ret && !dispatch_param_event(stmt, PDO_PARAM_EVT_EXEC_POST)) {
RETURN_FALSE;
}
@@ -540,7 +539,7 @@ static PHP_METHOD(PDOStatement, execute)
}
/* }}} */
-static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *type_override TSRMLS_DC) /* {{{ */
+static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *type_override) /* {{{ */
{
struct pdo_column_data *col;
char *value = NULL;
@@ -555,7 +554,7 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
value = NULL;
value_len = 0;
- stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees TSRMLS_CC);
+ stmt->methods->get_col(stmt, colno, &value, &value_len, &caller_frees);
switch (type) {
case PDO_PARAM_ZVAL:
@@ -674,26 +673,26 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ
}
/* }}} */
-static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset, int do_bind TSRMLS_DC) /* {{{ */
+static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset, int do_bind) /* {{{ */
{
if (!stmt->executed) {
return 0;
}
- if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE TSRMLS_CC)) {
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_PRE)) {
return 0;
}
- if (!stmt->methods->fetcher(stmt, ori, offset TSRMLS_CC)) {
+ if (!stmt->methods->fetcher(stmt, ori, offset)) {
return 0;
}
/* some drivers might need to describe the columns now */
- if (!stmt->columns && !pdo_stmt_describe_columns(stmt TSRMLS_CC)) {
+ if (!stmt->columns && !pdo_stmt_describe_columns(stmt)) {
return 0;
}
- if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST TSRMLS_CC)) {
+ if (!dispatch_param_event(stmt, PDO_PARAM_EVT_FETCH_POST)) {
return 0;
}
@@ -712,7 +711,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen
zval_dtor(Z_REFVAL(param->parameter));
/* set new value */
- fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)&param->param_type TSRMLS_CC);
+ fetch_value(stmt, Z_REFVAL(param->parameter), param->paramno, (int *)&param->param_type);
/* TODO: some smart thing that avoids duplicating the value in the
* general loop below. For now, if you're binding output columns,
@@ -726,7 +725,7 @@ static int do_fetch_common(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zen
}
/* }}} */
-static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
{
zend_class_entry *ce = stmt->fetch.cls.ce;
zend_fcall_info *fci = &stmt->fetch.cls.fci;
@@ -748,7 +747,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
fci->params = NULL;
fci->no_separation = 1;
- zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args TSRMLS_CC);
+ zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args);
fcc->initialized = 1;
fcc->function_handler = ce->constructor;
@@ -756,7 +755,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
fcc->called_scope = ce;
return 1;
} else if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it");
return 0;
} else {
return 1; /* no ctor no args is also ok */
@@ -764,16 +763,16 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args TSRMLS_DC) /* {{{ */
+static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args) /* {{{ */
{
char *is_callable_error = NULL;
- if (zend_fcall_info_init(callable, 0, fci, fcc, NULL, &is_callable_error TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_init(callable, 0, fci, fcc, NULL, &is_callable_error) == FAILURE) {
if (is_callable_error) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", is_callable_error TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", is_callable_error);
efree(is_callable_error);
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback");
}
return 0;
}
@@ -789,12 +788,12 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
}
/* }}} */
-static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int do_fetch_func_prepare(pdo_stmt_t *stmt) /* {{{ */
{
zend_fcall_info *fci = &stmt->fetch.cls.fci;
zend_fcall_info_cache *fcc = &stmt->fetch.cls.fcc;
- if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count TSRMLS_CC)) {
+ if (!make_callable_ex(stmt, &stmt->fetch.func.function, fci, fcc, stmt->column_count)) {
return 0;
} else {
stmt->fetch.func.values = safe_emalloc(sizeof(zval), stmt->column_count, 0);
@@ -803,7 +802,7 @@ static int do_fetch_func_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /* {{{ */
+static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */
{
/* fci.size is used to check if it is valid */
if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) {
@@ -832,7 +831,7 @@ static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC) /
/* perform a fetch. If do_bind is true, update any bound columns.
* If return_value is not null, store values into it according to HOW. */
-static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all TSRMLS_DC) /* {{{ */
+static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all) /* {{{ */
{
int flags, idx, old_arg_count = 0;
zend_class_entry *ce = NULL, *old_ce = NULL;
@@ -845,7 +844,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
flags = how & PDO_FETCH_FLAGS;
how = how & ~PDO_FETCH_FLAGS;
- if (!do_fetch_common(stmt, ori, offset, do_bind TSRMLS_CC)) {
+ if (!do_fetch_common(stmt, ori, offset, do_bind)) {
return 0;
}
@@ -864,7 +863,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
int i = 0;
if (how == PDO_FETCH_LAZY) {
- get_lazy_object(stmt, return_value TSRMLS_CC);
+ get_lazy_object(stmt, return_value);
return 1;
}
@@ -886,7 +885,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_KEY_PAIR:
if (stmt->column_count != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain extactly 2 columns." TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain extactly 2 columns.");
return 0;
}
if (!return_all) {
@@ -897,11 +896,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_COLUMN:
if (colno >= 0 && colno < stmt->column_count) {
if (flags == PDO_FETCH_GROUP && stmt->fetch.column == -1) {
- fetch_value(stmt, return_value, 1, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, 1, NULL);
} else if (flags == PDO_FETCH_GROUP && colno) {
- fetch_value(stmt, return_value, 0, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, 0, NULL);
} else {
- fetch_value(stmt, return_value, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, colno, NULL);
}
if (!return_all) {
return 1;
@@ -909,7 +908,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
break;
}
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid column index");
}
return 0;
@@ -925,30 +924,30 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
old_ce = stmt->fetch.cls.ce;
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
- fetch_value(stmt, &val, i++, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i++, NULL);
if (Z_TYPE(val) != IS_NULL) {
convert_to_string(&val);
- if ((cep = zend_lookup_class(Z_STR(val) TSRMLS_CC)) == NULL) {
+ if ((cep = zend_lookup_class(Z_STR(val))) == NULL) {
stmt->fetch.cls.ce = ZEND_STANDARD_CLASS_DEF_PTR;
} else {
stmt->fetch.cls.ce = cep;
}
}
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
zval_dtor(&val);
}
ce = stmt->fetch.cls.ce;
if (!ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch class specified");
return 0;
}
if ((flags & PDO_FETCH_SERIALIZE) == 0) {
object_init_ex(return_value, ce);
if (!stmt->fetch.cls.fci.size) {
- if (!do_fetch_class_prepare(stmt TSRMLS_CC))
+ if (!do_fetch_class_prepare(stmt))
{
return 0;
}
@@ -956,8 +955,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if (ce->constructor && (flags & PDO_FETCH_PROPS_LATE)) {
stmt->fetch.cls.fci.object = Z_OBJ_P(return_value);
stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor");
return 0;
} else {
if (!Z_ISUNDEF(stmt->fetch.cls.retval)) {
@@ -971,7 +970,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_INTO:
if (Z_ISUNDEF(stmt->fetch.into)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified." TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch-into object specified.");
return 0;
break;
}
@@ -985,11 +984,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_FUNC:
if (Z_ISUNDEF(stmt->fetch.func.function)) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "No fetch function specified");
return 0;
}
if (!stmt->fetch.func.fci.size) {
- if (!do_fetch_func_prepare(stmt TSRMLS_CC))
+ if (!do_fetch_func_prepare(stmt))
{
return 0;
}
@@ -1006,9 +1005,9 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
//???
//ZVAL_NULL(&grp_val);
if (flags == PDO_FETCH_GROUP && how == PDO_FETCH_COLUMN && stmt->fetch.column > 0) {
- fetch_value(stmt, &grp_val, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, &grp_val, colno, NULL);
} else {
- fetch_value(stmt, &grp_val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &grp_val, i, NULL);
}
convert_to_string(&grp_val);
if (how == PDO_FETCH_COLUMN) {
@@ -1020,7 +1019,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
for (idx = 0; i < stmt->column_count; i++, idx++) {
zval val;
- fetch_value(stmt, &val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i, NULL);
switch (how) {
case PDO_FETCH_ASSOC:
@@ -1030,7 +1029,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_KEY_PAIR:
{
zval tmp;
- fetch_value(stmt, &tmp, ++i, NULL TSRMLS_CC);
+ fetch_value(stmt, &tmp, ++i, NULL);
if (Z_TYPE(val) == IS_LONG) {
zend_hash_index_update((return_all ? Z_ARRVAL_P(return_all) : Z_ARRVAL_P(return_value)), Z_LVAL(val), &tmp);
@@ -1095,7 +1094,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_INTO:
zend_update_property(NULL, return_value,
stmt->columns[i].name, stmt->columns[i].namelen,
- &val TSRMLS_CC);
+ &val);
zval_ptr_dtor(&val);
break;
@@ -1103,15 +1102,15 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if ((flags & PDO_FETCH_SERIALIZE) == 0 || idx) {
zend_update_property(ce, return_value,
stmt->columns[i].name, stmt->columns[i].namelen,
- &val TSRMLS_CC);
+ &val);
zval_ptr_dtor(&val);
} else {
#ifdef MBO_0
php_unserialize_data_t var_hash;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (php_var_unserialize(return_value, (const unsigned char**)&Z_STRVAL(val), Z_STRVAL(val)+Z_STRLEN(val), NULL TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data" TSRMLS_CC);
+ if (php_var_unserialize(return_value, (const unsigned char**)&Z_STRVAL(val), Z_STRVAL(val)+Z_STRLEN(val), NULL) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize data");
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
return 0;
}
@@ -1119,11 +1118,11 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
#endif
if (!ce->unserialize) {
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class");
return 0;
- } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL TSRMLS_CC) == FAILURE) {
+ } else if (ce->unserialize(return_value, ce, (unsigned char *)(Z_TYPE(val) == IS_STRING ? Z_STRVAL(val) : ""), Z_TYPE(val) == IS_STRING ? Z_STRLEN(val) : 0, NULL) == FAILURE) {
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class");
zval_dtor(return_value);
ZVAL_NULL(return_value);
return 0;
@@ -1140,7 +1139,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
default:
zval_ptr_dtor(&val);
- pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "mode is out of range");
return 0;
break;
}
@@ -1151,8 +1150,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
if (ce->constructor && !(flags & (PDO_FETCH_PROPS_LATE | PDO_FETCH_SERIALIZE))) {
stmt->fetch.cls.fci.object = Z_OBJ_P(return_value);
stmt->fetch.cls.fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.cls.fci, &stmt->fetch.cls.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call class constructor");
return 0;
} else {
if (!Z_ISUNDEF(stmt->fetch.cls.retval)) {
@@ -1161,7 +1160,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
}
}
if (flags & PDO_FETCH_CLASSTYPE) {
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
stmt->fetch.cls.fci.param_count = old_arg_count;
@@ -1171,8 +1170,8 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_FUNC:
stmt->fetch.func.fci.param_count = idx;
stmt->fetch.func.fci.retval = &retval;
- if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc TSRMLS_CC) == FAILURE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function" TSRMLS_CC);
+ if (zend_call_function(&stmt->fetch.func.fci, &stmt->fetch.func.fcc) == FAILURE) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not call user-supplied function");
return 0;
} else {
if (return_all) {
@@ -1213,14 +1212,14 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
}
/* }}} */
-static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all TSRMLS_DC) /* {{{ */
+static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all) /* {{{ */
{
int flags = mode & PDO_FETCH_FLAGS;
mode = mode & ~PDO_FETCH_FLAGS;
if (mode < 0 || mode > PDO_FETCH__MAX) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode");
return 0;
}
@@ -1232,29 +1231,29 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, int fetch_all
switch(mode) {
case PDO_FETCH_FUNC:
if (!fetch_all) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_FUNC is only allowed in PDOStatement::fetchAll()");
return 0;
}
return 1;
case PDO_FETCH_LAZY:
if (fetch_all) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_LAZY can't be used with PDOStatement::fetchAll()");
return 0;
}
/* fall through */
default:
if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS");
return 0;
}
if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO::FETCH_CLASSTYPE can only be used together with PDO::FETCH_CLASS");
return 0;
}
if (mode >= PDO_FETCH__MAX) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "invalid fetch mode");
return 0;
}
/* no break; */
@@ -1274,18 +1273,18 @@ static PHP_METHOD(PDOStatement, fetch)
zend_long off = 0;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lll", &how,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|lll", &how,
&ori, &off)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 0)) {
RETURN_FALSE;
}
- if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ if (!do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -1306,13 +1305,13 @@ static PHP_METHOD(PDOStatement, fetchObject)
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S!a", &class_name, &ctor_args)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!a", &class_name, &ctor_args)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_verify_mode(stmt, how, 0 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 0)) {
RETURN_FALSE;
}
@@ -1320,7 +1319,7 @@ static PHP_METHOD(PDOStatement, fetchObject)
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
if (ctor_args) {
if (Z_TYPE_P(ctor_args) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(ctor_args))) {
@@ -1330,23 +1329,23 @@ static PHP_METHOD(PDOStatement, fetchObject)
}
}
if (class_name && !error) {
- stmt->fetch.cls.ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ stmt->fetch.cls.ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
if (!stmt->fetch.cls.ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Could not find user-supplied class");
error = 1;
}
} else if (!error) {
stmt->fetch.cls.ce = zend_standard_class_def;
}
- if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0 TSRMLS_CC)) {
+ if (!error && !do_fetch(stmt, TRUE, return_value, how, ori, off, 0)) {
error = 1;
}
if (error) {
PDO_HANDLE_STMT_ERR();
}
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
@@ -1364,18 +1363,18 @@ static PHP_METHOD(PDOStatement, fetchColumn)
zend_long col_n = 0;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &col_n)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &col_n)) {
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE TSRMLS_CC)) {
+ if (!do_fetch_common(stmt, PDO_FETCH_ORI_NEXT, 0, TRUE)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
- fetch_value(stmt, return_value, col_n, NULL TSRMLS_CC);
+ fetch_value(stmt, return_value, col_n, NULL);
}
/* }}} */
@@ -1391,11 +1390,11 @@ static PHP_METHOD(PDOStatement, fetchAll)
int error = 0, flags, old_arg_count;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lzz", &how, &arg2, &ctor_args)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|lzz", &how, &arg2, &ctor_args)) {
RETURN_FALSE;
}
- if (!pdo_stmt_verify_mode(stmt, how, 1 TSRMLS_CC)) {
+ if (!pdo_stmt_verify_mode(stmt, how, 1)) {
RETURN_FALSE;
}
@@ -1403,7 +1402,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
ZVAL_COPY_VALUE(&old_ctor_args, &stmt->fetch.cls.ctor_args);
old_arg_count = stmt->fetch.cls.fci.param_count;
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
switch(how & ~PDO_FETCH_FLAGS) {
case PDO_FETCH_CLASS:
@@ -1414,7 +1413,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
break;
case 3:
if (Z_TYPE_P(ctor_args) != IS_NULL && Z_TYPE_P(ctor_args) != IS_ARRAY) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array");
error = 1;
break;
}
@@ -1429,20 +1428,20 @@ static PHP_METHOD(PDOStatement, fetchAll)
ZVAL_UNDEF(&stmt->fetch.cls.ctor_args);
}
if (Z_TYPE_P(arg2) != IS_STRING) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Invalid class name (should be a string)");
error = 1;
break;
} else {
- stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ stmt->fetch.cls.ce = zend_fetch_class(Z_STR_P(arg2), ZEND_FETCH_CLASS_AUTO);
if (!stmt->fetch.cls.ce) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "could not find user-specified class");
error = 1;
break;
}
}
}
if (!error) {
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
}
break;
@@ -1450,13 +1449,13 @@ static PHP_METHOD(PDOStatement, fetchAll)
switch (ZEND_NUM_ARGS()) {
case 0:
case 1:
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "no fetch function specified");
error = 1;
break;
case 3:
case 2:
ZVAL_COPY_VALUE(&stmt->fetch.func.function, arg2);
- if (do_fetch_func_prepare(stmt TSRMLS_CC) == 0) {
+ if (do_fetch_func_prepare(stmt) == 0) {
error = 1;
}
break;
@@ -1474,14 +1473,14 @@ static PHP_METHOD(PDOStatement, fetchAll)
stmt->fetch.column = Z_LVAL_P(arg2);
break;
case 3:
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Third parameter not allowed for PDO::FETCH_COLUMN");
error = 1;
}
break;
default:
if (ZEND_NUM_ARGS() > 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "Extraneous additional parameters");
error = 1;
}
}
@@ -1503,7 +1502,7 @@ static PHP_METHOD(PDOStatement, fetchAll)
} else {
return_all = 0;
}
- if (!do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC)) {
+ if (!do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all)) {
error = 2;
}
}
@@ -1511,18 +1510,18 @@ static PHP_METHOD(PDOStatement, fetchAll)
if ((how & PDO_FETCH_GROUP)) {
do {
//??? MAKE_STD_ZVAL(data);
- } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
+ } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all));
} else if (how == PDO_FETCH_KEY_PAIR || (how == PDO_FETCH_USE_DEFAULT && stmt->default_fetch_type == PDO_FETCH_KEY_PAIR)) {
- while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all TSRMLS_CC));
+ while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, return_all));
} else {
array_init(return_value);
do {
add_next_index_zval(return_value, &data);
- } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC));
+ } while (do_fetch(stmt, 1, &data, how | flags, PDO_FETCH_ORI_NEXT, 0, 0));
}
}
- do_fetch_opt_finish(stmt, 0 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 0);
stmt->fetch.cls.ce = old_ce;
ZVAL_COPY_VALUE(&stmt->fetch.cls.ctor_args, &old_ctor_args);
@@ -1550,10 +1549,10 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
param.paramno = -1;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len,
&param.driver_params)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|llz!", &param.name,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name,
&parameter, &param_type, &param.max_value_len,
&param.driver_params)) {
return 0;
@@ -1565,12 +1564,12 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
} else if (!param.name) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
return 0;
}
ZVAL_COPY(&param.parameter, parameter);
- if (!really_register_bound_param(&param, stmt, is_param TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, is_param)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
}
@@ -1590,9 +1589,9 @@ static PHP_METHOD(PDOStatement, bindValue)
param.paramno = -1;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lz/|l", &param.paramno, &parameter, &param_type)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz/|l", &param.name,
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name,
&parameter, &param_type)) {
RETURN_FALSE;
}
@@ -1603,12 +1602,12 @@ static PHP_METHOD(PDOStatement, bindValue)
if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
} else if (!param.name) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
RETURN_FALSE;
}
ZVAL_COPY(&param.parameter, parameter);
- if (!really_register_bound_param(&param, stmt, TRUE TSRMLS_CC)) {
+ if (!really_register_bound_param(&param, stmt, TRUE)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1683,7 +1682,7 @@ static PHP_METHOD(PDOStatement, errorInfo)
add_next_index_string(return_value, stmt->error_code);
if (stmt->dbh->methods->fetch_err) {
- stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value TSRMLS_CC);
+ stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value);
}
error_count = zend_hash_num_elements(Z_ARRVAL_P(return_value));
@@ -1707,7 +1706,7 @@ static PHP_METHOD(PDOStatement, setAttribute)
zval *value = NULL;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz!", &attr, &value)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lz!", &attr, &value)) {
RETURN_FALSE;
}
@@ -1716,13 +1715,13 @@ static PHP_METHOD(PDOStatement, setAttribute)
}
PDO_STMT_CLEAR_ERR();
- if (stmt->methods->set_attribute(stmt, attr, value TSRMLS_CC)) {
+ if (stmt->methods->set_attribute(stmt, attr, value)) {
RETURN_TRUE;
}
fail:
if (!stmt->methods->set_attribute) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "This driver doesn't support setting attributes");
} else {
PDO_HANDLE_STMT_ERR();
}
@@ -1748,21 +1747,21 @@ static PHP_METHOD(PDOStatement, getAttribute)
zend_long attr;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr)) {
RETURN_FALSE;
}
if (!stmt->methods->get_attribute) {
if (!generic_stmt_attr_get(stmt, return_value, attr)) {
pdo_raise_impl_error(stmt->dbh, stmt, "IM001",
- "This driver doesn't support getting attributes" TSRMLS_CC);
+ "This driver doesn't support getting attributes");
RETURN_FALSE;
}
return;
}
PDO_STMT_CLEAR_ERR();
- switch (stmt->methods->get_attribute(stmt, attr, return_value TSRMLS_CC)) {
+ switch (stmt->methods->get_attribute(stmt, attr, return_value)) {
case -1:
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
@@ -1771,7 +1770,7 @@ static PHP_METHOD(PDOStatement, getAttribute)
if (!generic_stmt_attr_get(stmt, return_value, attr)) {
/* XXX: should do something better here */
pdo_raise_impl_error(stmt->dbh, stmt, "IM001",
- "driver doesn't support getting that attribute" TSRMLS_CC);
+ "driver doesn't support getting that attribute");
RETURN_FALSE;
}
return;
@@ -1802,21 +1801,21 @@ static PHP_METHOD(PDOStatement, getColumnMeta)
struct pdo_column_data *col;
PHP_STMT_GET_OBJ;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colno)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &colno)) {
RETURN_FALSE;
}
if(colno < 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative");
RETURN_FALSE;
}
if (!stmt->methods->get_column_meta) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data");
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value TSRMLS_CC)) {
+ if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -1844,7 +1843,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
zend_class_entry *cep;
int retval;
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
switch (stmt->default_fetch_type) {
case PDO_FETCH_INTO:
@@ -1869,13 +1868,13 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
if (SUCCESS == retval) {
if (Z_TYPE(args[skip]) != IS_LONG) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "mode must be an integer" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "mode must be an integer");
retval = FAILURE;
} else {
mode = Z_LVAL(args[skip]);
flags = mode & PDO_FETCH_FLAGS;
- retval = pdo_stmt_verify_mode(stmt, mode, 0 TSRMLS_CC);
+ retval = pdo_stmt_verify_mode(stmt, mode, 0);
}
}
@@ -1897,7 +1896,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_NAMED:
case PDO_FETCH_KEY_PAIR:
if (argc != 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments");
} else {
retval = SUCCESS;
}
@@ -1905,9 +1904,9 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_COLUMN:
if (argc != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the colno argument" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the colno argument");
} else if (Z_TYPE(args[skip+1]) != IS_LONG) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "colno must be an integer" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "colno must be an integer");
} else {
stmt->fetch.column = Z_LVAL(args[skip+1]);
retval = SUCCESS;
@@ -1918,20 +1917,20 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
/* Gets its class name from 1st column */
if ((flags & PDO_FETCH_CLASSTYPE) == PDO_FETCH_CLASSTYPE) {
if (argc != 1) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode doesn't allow any extra arguments");
} else {
stmt->fetch.cls.ce = NULL;
retval = SUCCESS;
}
} else {
if (argc < 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the classname argument" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the classname argument");
} else if (argc > 3) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "too many arguments" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "too many arguments");
} else if (Z_TYPE(args[skip+1]) != IS_STRING) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "classname must be a string" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "classname must be a string");
} else {
- cep = zend_lookup_class(Z_STR(args[skip+1]) TSRMLS_CC);
+ cep = zend_lookup_class(Z_STR(args[skip+1]));
if (cep) {
retval = SUCCESS;
stmt->fetch.cls.ce = cep;
@@ -1943,12 +1942,12 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
ZVAL_UNDEF(&stmt->fetch.cls.ctor_args);
#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */
if (stmt->dbh->is_persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
}
#endif
if (argc == 3) {
if (Z_TYPE(args[skip+2]) != IS_NULL && Z_TYPE(args[skip+2]) != IS_ARRAY) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "ctor_args must be either NULL or an array");
retval = FAILURE;
} else if (Z_TYPE(args[skip+2]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL(args[skip+2]))) {
ZVAL_DUP(&stmt->fetch.cls.ctor_args, &args[skip+2]);
@@ -1956,7 +1955,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
}
if (SUCCESS == retval) {
- do_fetch_class_prepare(stmt TSRMLS_CC);
+ do_fetch_class_prepare(stmt);
}
}
@@ -1964,9 +1963,9 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
case PDO_FETCH_INTO:
if (argc != 2) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the object parameter" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "fetch mode requires the object parameter");
} else if (Z_TYPE(args[skip+1]) != IS_OBJECT) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "object must be an object" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "object must be an object");
} else {
retval = SUCCESS;
}
@@ -1974,7 +1973,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
if (SUCCESS == retval) {
#ifdef ilia_0 /* we'll only need this when we have persistent statements, if ever */
if (stmt->dbh->is_persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
+ php_error_docref(NULL, E_WARNING, "PHP might crash if you don't call $stmt->setFetchMode() to reset to defaults on this persistent statement. This will be fixed in a later release");
}
#endif
ZVAL_COPY(&stmt->fetch.into, &args[skip+1]);
@@ -1983,7 +1982,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in
break;
default:
- pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "22003", "Invalid fetch mode specified");
}
if (SUCCESS == retval) {
@@ -2018,7 +2017,7 @@ static PHP_METHOD(PDOStatement, setFetchMode)
/* {{{ proto bool PDOStatement::nextRowset()
Advances to the next rowset in a multi-rowset statement handle. Returns true if it succeeded, false otherwise */
-static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt)
{
/* un-describe */
if (stmt->columns) {
@@ -2033,13 +2032,13 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
stmt->column_count = 0;
}
- if (!stmt->methods->next_rowset(stmt TSRMLS_CC)) {
+ if (!stmt->methods->next_rowset(stmt)) {
/* Set the executed flag to 0 to reallocate columns on next execute */
stmt->executed = 0;
return 0;
}
- pdo_stmt_describe_columns(stmt TSRMLS_CC);
+ pdo_stmt_describe_columns(stmt);
return 1;
}
@@ -2049,13 +2048,13 @@ static PHP_METHOD(PDOStatement, nextRowset)
PHP_STMT_GET_OBJ;
if (!stmt->methods->next_rowset) {
- pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver does not support multiple rowsets");
RETURN_FALSE;
}
PDO_STMT_CLEAR_ERR();
- if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ if (!pdo_stmt_do_next_rowset(stmt)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -2073,13 +2072,13 @@ static PHP_METHOD(PDOStatement, closeCursor)
if (!stmt->methods->cursor_closer) {
/* emulate it by fetching and discarding rows */
do {
- while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0 TSRMLS_CC))
+ while (stmt->methods->fetcher(stmt, PDO_FETCH_ORI_NEXT, 0))
;
if (!stmt->methods->next_rowset) {
break;
}
- if (!pdo_stmt_do_next_rowset(stmt TSRMLS_CC)) {
+ if (!pdo_stmt_do_next_rowset(stmt)) {
break;
}
@@ -2090,7 +2089,7 @@ static PHP_METHOD(PDOStatement, closeCursor)
PDO_STMT_CLEAR_ERR();
- if (!stmt->methods->cursor_closer(stmt TSRMLS_CC)) {
+ if (!stmt->methods->cursor_closer(stmt)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
@@ -2111,11 +2110,11 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
RETURN_FALSE;
}
- php_stream_printf(out TSRMLS_CC, "SQL: [%d] %.*s\n",
+ php_stream_printf(out, "SQL: [%d] %.*s\n",
stmt->query_stringlen,
stmt->query_stringlen, stmt->query_string);
- php_stream_printf(out TSRMLS_CC, "Params: %d\n",
+ php_stream_printf(out, "Params: %d\n",
stmt->bound_params ? zend_hash_num_elements(stmt->bound_params) : 0);
if (stmt->bound_params) {
@@ -2123,12 +2122,12 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
zend_string *key = NULL;
ZEND_HASH_FOREACH_KEY_PTR(stmt->bound_params, num, key, param) {
if (key) {
- php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", key->len, key->len, key->val);
+ php_stream_printf(out, "Key: Name: [%d] %.*s\n", key->len, key->len, key->val);
} else {
- php_stream_printf(out TSRMLS_CC, "Key: Position #%pd:\n", num);
+ php_stream_printf(out, "Key: Position #%pd:\n", num);
}
- php_stream_printf(out TSRMLS_CC, "paramno=%pd\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
+ php_stream_printf(out, "paramno=%pd\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",
param->paramno, param->name? param->name->len : 0, param->name? param->name->len : 0,
param->name ? param->name->val : "",
param->is_param,
@@ -2145,7 +2144,7 @@ static PHP_METHOD(PDOStatement, debugDumpParams)
Prevents use of a PDOStatement instance that has been unserialized */
static PHP_METHOD(PDOStatement, __wakeup)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances");
}
/* }}} */
@@ -2153,7 +2152,7 @@ static PHP_METHOD(PDOStatement, __wakeup)
Prevents serialization of a PDOStatement instance */
static PHP_METHOD(PDOStatement, __sleep)
{
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC, "You cannot serialize or unserialize PDOStatement instances");
+ zend_throw_exception_ex(php_pdo_get_exception(), 0, "You cannot serialize or unserialize PDOStatement instances");
}
/* }}} */
@@ -2183,33 +2182,33 @@ const zend_function_entry pdo_dbstmt_functions[] = {
};
/* {{{ overloaded handlers for PDOStatement class */
-static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void dbstmt_prop_write(zval *object, zval *member, zval *value, void **cache_slot)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
convert_to_string(member);
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only");
} else {
- std_object_handlers.write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_object_handlers.write_property(object, member, value, cache_slot);
}
}
-static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
convert_to_string(member);
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "property queryString is read only");
} else {
- std_object_handlers.unset_property(object, member, cache_slot TSRMLS_CC);
+ std_object_handlers.unset_property(object, member, cache_slot);
}
}
-static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key TSRMLS_DC)
+static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key)
{
zend_function *fbc = NULL;
zend_string *lc_method_name;
@@ -2228,7 +2227,7 @@ static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_str
* the driver specific methods */
if (!stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
if (!pdo_hash_methods(Z_PDO_OBJECT_P(&stmt->database_object_handle),
- PDO_DBH_DRIVER_METHOD_KIND_STMT TSRMLS_CC)
+ PDO_DBH_DRIVER_METHOD_KIND_STMT)
|| !stmt->dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_STMT]) {
goto out;
}
@@ -2245,40 +2244,40 @@ out:
return fbc;
}
-static int dbstmt_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int dbstmt_compare(zval *object1, zval *object2)
{
return -1;
}
-static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC)
+static zend_object *dbstmt_clone_obj(zval *zobject)
{
pdo_stmt_t *stmt;
pdo_stmt_t *old_stmt;
stmt = ecalloc(1, sizeof(pdo_stmt_t) + sizeof(zval) * (Z_OBJCE_P(zobject)->default_properties_count - 1));
- zend_object_std_init(&stmt->std, Z_OBJCE_P(zobject) TSRMLS_CC);
+ zend_object_std_init(&stmt->std, Z_OBJCE_P(zobject));
object_properties_init(&stmt->std, Z_OBJCE_P(zobject));
old_stmt = Z_PDO_STMT_P(zobject);
- zend_objects_clone_members(&stmt->std, &old_stmt->std TSRMLS_CC);
+ zend_objects_clone_members(&stmt->std, &old_stmt->std);
return &stmt->std;
}
zend_object_handlers pdo_dbstmt_object_handlers;
-static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC);
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
-void pdo_stmt_init(TSRMLS_D)
+void pdo_stmt_init(void)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions);
- pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_dbstmt_ce = zend_register_internal_class(&ce);
pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get;
pdo_dbstmt_ce->create_object = pdo_dbstmt_new;
- zend_class_implements(pdo_dbstmt_ce TSRMLS_CC, 1, zend_ce_traversable);
- zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_class_implements(pdo_dbstmt_ce, 1, zend_ce_traversable);
+ zend_declare_property_null(pdo_dbstmt_ce, "queryString", sizeof("queryString")-1, ZEND_ACC_PUBLIC);
memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
pdo_dbstmt_object_handlers.offset = XtOffsetOf(pdo_stmt_t, std);
@@ -2291,13 +2290,13 @@ void pdo_stmt_init(TSRMLS_D)
pdo_dbstmt_object_handlers.clone_obj = dbstmt_clone_obj;
INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions);
- pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ pdo_row_ce = zend_register_internal_class(&ce);
pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */
pdo_row_ce->create_object = pdo_row_new;
pdo_row_ce->serialize = pdo_row_serialize;
}
-static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
+static void free_statement(pdo_stmt_t *stmt)
{
if (stmt->bound_params) {
zend_hash_destroy(stmt->bound_params);
@@ -2316,7 +2315,7 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
}
if (stmt->methods && stmt->methods->dtor) {
- stmt->methods->dtor(stmt TSRMLS_CC);
+ stmt->methods->dtor(stmt);
}
if (stmt->query_string) {
efree(stmt->query_string);
@@ -2340,26 +2339,26 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
ZVAL_UNDEF(&stmt->fetch.into);
}
- do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
+ do_fetch_opt_finish(stmt, 1);
if (!Z_ISUNDEF(stmt->database_object_handle)) {
zval_ptr_dtor(&stmt->database_object_handle);
}
- zend_object_std_dtor(&stmt->std TSRMLS_CC);
+ zend_object_std_dtor(&stmt->std);
}
-void pdo_dbstmt_free_storage(zend_object *std TSRMLS_DC)
+void pdo_dbstmt_free_storage(zend_object *std)
{
pdo_stmt_t *stmt = php_pdo_stmt_fetch_object(std);
- free_statement(stmt TSRMLS_CC);
+ free_statement(stmt);
}
-zend_object *pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_dbstmt_new(zend_class_entry *ce)
{
pdo_stmt_t *stmt;
stmt = ecalloc(1, sizeof(pdo_stmt_t) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(&stmt->std, ce TSRMLS_CC);
+ zend_object_std_init(&stmt->std, ce);
object_properties_init(&stmt->std, ce);
stmt->std.handlers = &pdo_dbstmt_object_handlers;
@@ -2376,7 +2375,7 @@ struct php_pdo_iterator {
zval fetch_ahead;
};
-static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void pdo_stmt_iter_dtor(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2387,14 +2386,14 @@ static void pdo_stmt_iter_dtor(zend_object_iterator *iter TSRMLS_DC)
}
}
-static int pdo_stmt_iter_valid(zend_object_iterator *iter TSRMLS_DC)
+static int pdo_stmt_iter_valid(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
return Z_ISUNDEF(I->fetch_ahead) ? FAILURE : SUCCESS;
}
-static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2406,7 +2405,7 @@ static zval *pdo_stmt_iter_get_data(zend_object_iterator *iter TSRMLS_DC)
return &I->fetch_ahead;
}
-static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
@@ -2417,7 +2416,7 @@ static void pdo_stmt_iter_get_key(zend_object_iterator *iter, zval *key TSRMLS_D
}
}
-static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
+static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter)
{
struct php_pdo_iterator *I = (struct php_pdo_iterator*)iter;
pdo_stmt_t *stmt = Z_PDO_STMT_P(&I->iter.data); /* for PDO_HANDLE_STMT_ERR() */
@@ -2427,7 +2426,7 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter TSRMLS_DC)
}
if (!do_fetch(stmt, TRUE, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
- PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ PDO_FETCH_ORI_NEXT, 0, 0)) {
PDO_HANDLE_STMT_ERR();
I->key = (ulong)-1;
@@ -2448,7 +2447,7 @@ static zend_object_iterator_funcs pdo_stmt_iter_funcs = {
NULL
};
-zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref)
{
pdo_stmt_t *stmt = Z_PDO_STMT_P(object);
struct php_pdo_iterator *I;
@@ -2458,12 +2457,12 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int
}
I = ecalloc(1, sizeof(struct php_pdo_iterator));
- zend_iterator_init(&I->iter TSRMLS_CC);
+ zend_iterator_init(&I->iter);
I->iter.funcs = &pdo_stmt_iter_funcs;
ZVAL_COPY(&I->iter.data, object);
if (!do_fetch(stmt, 1, &I->fetch_ahead, PDO_FETCH_USE_DEFAULT,
- PDO_FETCH_ORI_NEXT, 0, 0 TSRMLS_CC)) {
+ PDO_FETCH_ORI_NEXT, 0, 0)) {
PDO_HANDLE_STMT_ERR();
I->key = (ulong)-1;
ZVAL_UNDEF(&I->fetch_ahead);
@@ -2480,7 +2479,7 @@ const zend_function_entry pdo_row_functions[] = {
{NULL, NULL, NULL}
};
-static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2492,12 +2491,12 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (stmt) {
if (Z_TYPE_P(member) == IS_LONG) {
if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) {
- fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC);
+ fetch_value(stmt, rv, Z_LVAL_P(member), NULL);
}
} else if (Z_TYPE_P(member) == IS_STRING
&& is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
if (lval >= 0 && lval < stmt->column_count) {
- fetch_value(stmt, rv, lval, NULL TSRMLS_CC);
+ fetch_value(stmt, rv, lval, NULL);
}
} else {
convert_to_string(member);
@@ -2505,7 +2504,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
* numbers */
for (colno = 0; colno < stmt->column_count; colno++) {
if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
- fetch_value(stmt, rv, colno, NULL TSRMLS_CC);
+ fetch_value(stmt, rv, colno, NULL);
//???
//Z_SET_REFCOUNT_P(rv, 0);
//Z_UNSET_ISREF_P(rv);
@@ -2515,7 +2514,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (strcmp(Z_STRVAL_P(member), "queryString") == 0) {
ZVAL_OBJ(&zobj, &stmt->std);
//zval_ptr_dtor(rv);
- return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC);
+ return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv);
}
}
}
@@ -2527,22 +2526,22 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
return rv;
}
-static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC)
+static zval *row_dim_read(zval *object, zval *member, int type, zval *rv)
{
- return row_prop_read(object, member, type, NULL, rv TSRMLS_CC);
+ return row_prop_read(object, member, type, NULL, rv);
}
-static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set");
+ php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set");
}
-static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC)
+static void row_dim_write(zval *object, zval *member, zval *value)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set");
+ php_error_docref(NULL, E_WARNING, "This PDORow is not from a writable result set");
}
-static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2572,22 +2571,22 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c
return 0;
}
-static int row_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int row_dim_exists(zval *object, zval *member, int check_empty)
{
- return row_prop_exists(object, member, check_empty, NULL TSRMLS_CC);
+ return row_prop_exists(object, member, check_empty, NULL);
}
-static void row_prop_delete(zval *object, zval *offset, void **cache_slot TSRMLS_DC)
+static void row_prop_delete(zval *object, zval *offset, void **cache_slot)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow");
}
-static void row_dim_delete(zval *object, zval *offset TSRMLS_DC)
+static void row_dim_delete(zval *object, zval *offset)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot delete properties from a PDORow");
+ php_error_docref(NULL, E_WARNING, "Cannot delete properties from a PDORow");
}
-static HashTable *row_get_properties(zval *object TSRMLS_DC)
+static HashTable *row_get_properties(zval *object)
{
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
@@ -2602,7 +2601,7 @@ static HashTable *row_get_properties(zval *object TSRMLS_DC)
}
for (i = 0; i < stmt->column_count; i++) {
zval val;
- fetch_value(stmt, &val, i, NULL TSRMLS_CC);
+ fetch_value(stmt, &val, i, NULL);
zend_hash_str_update(stmt->std.properties, stmt->columns[i].name, stmt->columns[i].namelen, &val);
}
@@ -2612,7 +2611,7 @@ static HashTable *row_get_properties(zval *object TSRMLS_DC)
static union _zend_function *row_method_get(
zend_object **object_pp,
- zend_string *method_name, const zval *key TSRMLS_DC)
+ zend_string *method_name, const zval *key)
{
zend_function *fbc;
zend_string *lc_method_name;
@@ -2634,7 +2633,7 @@ static int row_call_method(zend_string *method, zend_object *object, INTERNAL_FU
return FAILURE;
}
-static union _zend_function *row_get_ctor(zend_object *object TSRMLS_DC)
+static union _zend_function *row_get_ctor(zend_object *object)
{
static zend_internal_function ctor = {0};
@@ -2647,12 +2646,12 @@ static union _zend_function *row_get_ctor(zend_object *object TSRMLS_DC)
return (union _zend_function*)&ctor;
}
-static zend_string *row_get_classname(const zend_object *object TSRMLS_DC)
+static zend_string *row_get_classname(const zend_object *object)
{
return zend_string_init("PDORow", sizeof("PDORow") - 1, 0);
}
-static int row_compare(zval *object1, zval *object2 TSRMLS_DC)
+static int row_compare(zval *object1, zval *object2)
{
return -1;
}
@@ -2683,7 +2682,7 @@ zend_object_handlers pdo_row_object_handlers = {
NULL
};
-void pdo_row_free_storage(zend_object *std TSRMLS_DC)
+void pdo_row_free_storage(zend_object *std)
{
pdo_row_t *row = (pdo_row_t *)std;
if (row->stmt) {
@@ -2692,18 +2691,18 @@ void pdo_row_free_storage(zend_object *std TSRMLS_DC)
}
}
-zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC)
+zend_object *pdo_row_new(zend_class_entry *ce)
{
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
- zend_object_std_init(&row->std, ce TSRMLS_CC);
+ zend_object_std_init(&row->std, ce);
row->std.handlers = &pdo_row_object_handlers;
return &row->std;
}
-static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data TSRMLS_DC)
+static int pdo_row_serialize(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized");
+ php_error_docref(NULL, E_WARNING, "PDORow instances may not be serialized");
return FAILURE;
}
/* }}} */
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index ce5b3a229d..956f7544e2 100644
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -59,20 +59,20 @@ ZEND_END_MODULE_GLOBALS(pdo)
#endif
#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, (zend_long)value);
#define REGISTER_PDO_CONST_LONG(const_name, value) { \
zend_class_entry **pce; \
if (zend_hash_find(CG(class_table), "pdo", sizeof("pdo"), (void **) &pce) != FAILURE) \
- zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC); \
+ zend_declare_class_constant_long(*pce, const_name, sizeof(const_name)-1, (zend_long)value); \
} \
#define REGISTER_PDO_CLASS_CONST_STRING(const_name, value) \
- zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
+ zend_declare_class_constant_stringl(php_pdo_get_dbh_ce(), const_name, sizeof(const_name)-1, value, sizeof(value)-1);
#define PDO_CONSTRUCT_CHECK \
if (!dbh->driver) { \
- pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC); \
+ pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called"); \
return; \
} \
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index de9780e226..6f2a01aa30 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -37,7 +37,7 @@ typedef unsigned __int64 pdo_uint64_t;
typedef long long int pdo_int64_t;
typedef unsigned long long int pdo_uint64_t;
#endif
-PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC);
+PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64);
#ifndef TRUE
# define TRUE 1
@@ -194,7 +194,7 @@ enum pdo_null_handling {
};
/* {{{ utils for reading attributes set as driver_options */
-static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, zend_long defval TSRMLS_DC)
+static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type option_name, zend_long defval)
{
zval *v;
@@ -204,7 +204,7 @@ static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type opt
}
return defval;
}
-static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval TSRMLS_DC)
+static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval)
{
zval *v;
@@ -234,33 +234,33 @@ typedef struct {
* data in the db, otherwise you will crash PHP when persistent connections
* are used.
*/
- int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC);
+ int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options);
} pdo_driver_t;
/* {{{ methods for a database handle */
/* close or otherwise disconnect the database */
-typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh);
/* prepare a statement and stash driver specific portion into stmt */
-typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC);
+typedef int (*pdo_dbh_prepare_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options);
/* execute a statement (that does not return a result set) */
-typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC);
+typedef zend_long (*pdo_dbh_do_func)(pdo_dbh_t *dbh, const char *sql, zend_long sql_len);
/* quote a string */
-typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC);
+typedef int (*pdo_dbh_quote_func)(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype);
/* transaction related */
-typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh);
/* setting of attributes */
-typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val);
/* return last insert id. NULL indicates error condition, otherwise, the return value
* MUST be an emalloc'd NULL terminated string. */
-typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC);
+typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned int *len);
/* fetch error information. if stmt is not null, fetch information pertaining
* to the statement, otherwise fetch global error information. The driver
@@ -268,20 +268,20 @@ typedef char *(*pdo_dbh_last_id_func)(pdo_dbh_t *dbh, const char *name, unsigned
* - native error code
* - string representation of the error code ... any other optional driver
* specific data ... */
-typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC);
+typedef int (*pdo_dbh_fetch_error_func)(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info);
/* fetching of attributes */
-typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, zend_long attr, zval *val);
/* checking/pinging persistent connections; return SUCCESS if the connection
* is still alive and ready to be used, FAILURE otherwise.
* You may set this handler to NULL, which is equivalent to returning SUCCESS. */
-typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh);
/* called at request end for each persistent dbh; this gives the driver
* the opportunity to safely release resources that only have per-request
* scope */
-typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC);
+typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh);
/* for adding methods to the dbh or stmt objects
pointer to a list of driver specific functions. The convention is
@@ -295,7 +295,7 @@ enum {
PDO_DBH_DRIVER_METHOD_KIND__MAX
};
-typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+typedef const zend_function_entry *(*pdo_dbh_get_driver_methods_func)(pdo_dbh_t *dbh, int kind);
struct pdo_dbh_methods {
pdo_dbh_close_func closer;
@@ -320,20 +320,20 @@ struct pdo_dbh_methods {
/* {{{ methods for a statement handle */
/* free the statement handle */
-typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_dtor_func)(pdo_stmt_t *stmt);
/* start the query */
-typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_execute_func)(pdo_stmt_t *stmt);
/* causes the next row in the set to be fetched; indicates if there are no
* more rows. The ori and offset params modify which row should be returned,
* if the stmt represents a scrollable cursor */
typedef int (*pdo_stmt_fetch_func)(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC);
+ enum pdo_fetch_orientation ori, zend_long offset);
/* queries information about the type of a column, by index (0 based).
* Driver should populate stmt->columns[colno] with appropriate info */
-typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC);
+typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno);
/* retrieves pointer and size of the value for a column.
* Note that PDO expects the driver to manage the lifetime of this data;
@@ -341,7 +341,7 @@ typedef int (*pdo_stmt_describe_col_func)(pdo_stmt_t *stmt, int colno TSRMLS_DC)
* If the driver sets caller_frees, ptr should point to emalloc'd memory
* and PDO will free it as soon as it is done using it.
*/
-typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC);
+typedef int (*pdo_stmt_get_col_data_func)(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees);
/* hook for bound params */
enum pdo_param_event {
@@ -354,13 +354,13 @@ enum pdo_param_event {
PDO_PARAM_EVT_NORMALIZE
};
-typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC);
+typedef int (*pdo_stmt_param_hook_func)(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type);
/* setting of attributes */
-typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_stmt_set_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val);
/* fetching of attributes */
-typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC);
+typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *val);
/* retrieves meta data for a numbered column.
* Returns SUCCESS/FAILURE.
@@ -390,19 +390,19 @@ typedef int (*pdo_stmt_get_attr_func)(pdo_stmt_t *stmt, zend_long attr, zval *va
* or
* 'flags' => array('not_null', 'mysql:some_flag'); // to add data to an existing key
*/
-typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC);
+typedef int (*pdo_stmt_get_column_meta_func)(pdo_stmt_t *stmt, zend_long colno, zval *return_value);
/* advances the statement to the next rowset of the batch.
* If it returns 1, PDO will tear down its idea of columns
* and meta data. If it returns 0, PDO will indicate an error
* to the caller. */
-typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_next_rowset_func)(pdo_stmt_t *stmt);
/* closes the active cursor on a statement, leaving the prepared
* statement ready for re-execution. Useful to explicitly state
* that you are done with a given rowset, without having to explicitly
* fetch all the rows. */
-typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt TSRMLS_DC);
+typedef int (*pdo_stmt_cursor_closer_func)(pdo_stmt_t *stmt);
struct pdo_stmt_methods {
pdo_stmt_dtor_func dtor;
@@ -679,16 +679,16 @@ PDO_API zend_class_entry *php_pdo_get_dbh_ce(void);
PDO_API zend_class_entry *php_pdo_get_exception(void);
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
- char **outquery, int *outquery_len TSRMLS_DC);
+ char **outquery, int *outquery_len);
PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
- const char *sqlstate, const char *supp TSRMLS_DC);
+ const char *sqlstate, const char *supp);
-PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC);
-PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC);
+PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh);
+PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh);
-PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC);
-PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC);
+PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt);
+PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt);
#endif /* PHP_PDO_DRIVER_H */
diff --git a/ext/pdo/php_pdo_error.h b/ext/pdo/php_pdo_error.h
index e89a2b8811..5320f54e2d 100644
--- a/ext/pdo/php_pdo_error.h
+++ b/ext/pdo/php_pdo_error.h
@@ -23,7 +23,7 @@
#include "php_pdo_driver.h"
-PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
+PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt);
#define PDO_DBH_CLEAR_ERR() do { \
strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
@@ -33,8 +33,8 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
} \
} while (0)
#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE)
-#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL TSRMLS_CC); }
-#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); }
+#define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL); }
+#define PDO_HANDLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); }
#endif /* PHP_PDO_ERROR_H */
/*
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index 23de705ec1..faade8d248 100644
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -27,40 +27,40 @@
extern HashTable pdo_driver_hash;
extern zend_class_entry *pdo_exception_ce;
-PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC);
+PDO_API zend_class_entry *php_pdo_get_exception_base(int root);
int php_pdo_list_entry(void);
-void pdo_dbh_init(TSRMLS_D);
-void pdo_stmt_init(TSRMLS_D);
+void pdo_dbh_init(void);
+void pdo_stmt_init(void);
-extern zend_object *pdo_dbh_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_dbh_new(zend_class_entry *ce);
extern const zend_function_entry pdo_dbh_functions[];
extern zend_class_entry *pdo_dbh_ce;
extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor);
-extern zend_object *pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_dbstmt_new(zend_class_entry *ce);
extern const zend_function_entry pdo_dbstmt_functions[];
extern zend_class_entry *pdo_dbstmt_ce;
-void pdo_dbstmt_free_storage(zend_object *std TSRMLS_DC);
-zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+void pdo_dbstmt_free_storage(zend_object *std);
+zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref);
extern zend_object_handlers pdo_dbstmt_object_handlers;
-int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC);
+int pdo_stmt_describe_columns(pdo_stmt_t *stmt);
int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int skip_first_arg);
-extern zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC);
+extern zend_object *pdo_row_new(zend_class_entry *ce);
extern const zend_function_entry pdo_row_functions[];
extern zend_class_entry *pdo_row_ce;
-void pdo_row_free_storage(zend_object *std TSRMLS_DC);
+void pdo_row_free_storage(zend_object *std);
extern zend_object_handlers pdo_row_object_handlers;
-zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object);
extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
int pdo_sqlstate_init_error_table(void);
void pdo_sqlstate_fini_error_table(void);
const char *pdo_sqlstate_state_to_description(char *state);
-int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind TSRMLS_DC);
+int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind);
/*
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index a433e8652c..c664ce8c40 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -35,7 +35,7 @@
/* Cache of the server supported datatypes, initialized in handle_factory */
zval* pdo_dblib_datatypes;
-static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
pdo_dblib_err *einfo = &H->err;
@@ -73,7 +73,7 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS
}
-static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_closer(pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -92,7 +92,7 @@ static int dblib_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
return 0;
}
-static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
pdo_dblib_stmt *S = ecalloc(1, sizeof(*S));
@@ -106,7 +106,7 @@ static int dblib_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
return 1;
}
-static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
RETCODE ret, resret;
@@ -142,7 +142,7 @@ static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
return DBCOUNT(H->link);
}
-static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
int useBinaryEncoding = 0;
@@ -200,7 +200,7 @@ static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
return 1;
}
-static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -215,22 +215,22 @@ static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int dblib_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_begin(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("BEGIN TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("BEGIN TRANSACTION", dbh);
}
-static int dblib_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_commit(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("COMMIT TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("COMMIT TRANSACTION", dbh);
}
-static int dblib_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int dblib_handle_rollback(pdo_dbh_t *dbh)
{
- return pdo_dblib_transaction_cmd("ROLLBACK TRANSACTION", dbh TSRMLS_CC);
+ return pdo_dblib_transaction_cmd("ROLLBACK TRANSACTION", dbh);
}
-char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -274,7 +274,7 @@ char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len T
return id;
}
-static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
switch(attr) {
case PDO_ATTR_TIMEOUT:
@@ -285,7 +285,7 @@ static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
}
-static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
/* dblib_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */
return 0;
@@ -309,7 +309,7 @@ static struct pdo_dbh_methods dblib_methods = {
NULL /* in transaction */
};
-static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
+static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
{
pdo_dblib_db_handle *H;
int i, nvars, nvers, ret = 0;
@@ -348,7 +348,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars);
if (driver_options) {
- int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
+ int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
dbsetlogintime(timeout); /* Connection/Login Timeout */
dbsettime(timeout); /* Statement Timeout */
}
@@ -368,7 +368,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
for(i=0;i<nvers;i++) {
if(strcmp(vars[5].optval,tdsver[i].key) == 0) {
if(FAIL==dbsetlversion(H->login, tdsver[i].value)) {
- pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string." TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string.");
goto cleanup;
}
break;
@@ -377,7 +377,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
if (i==nvers) {
printf("Invalid version '%s'\n", vars[5].optval);
- pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string." TSRMLS_CC);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string.");
goto cleanup; /* unknown version specified */
}
}
@@ -451,7 +451,7 @@ cleanup:
dbh->driver_data = H;
if (!ret) {
- zend_throw_exception_ex(php_pdo_get_exception(), DBLIB_G(err).dberr TSRMLS_CC,
+ zend_throw_exception_ex(php_pdo_get_exception(), DBLIB_G(err).dberr,
"SQLSTATE[%s] %s (severity %d)",
DBLIB_G(err).sqlstate,
DBLIB_G(err).dberrstr,
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index bd79be3e9c..a4552d4f57 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -95,7 +95,7 @@ static char *pdo_dblib_get_field_name(int type)
}
/* }}} */
-static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -106,7 +106,7 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
@@ -115,7 +115,7 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -124,7 +124,7 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
ret = dbresults(H->link);
if (FAIL == ret) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL");
return 0;
}
@@ -138,7 +138,7 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -146,7 +146,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
dbsetuserdata(H->link, (BYTE*) &S->err);
- pdo_dblib_stmt_cursor_closer(stmt TSRMLS_CC);
+ pdo_dblib_stmt_cursor_closer(stmt);
if (FAIL == dbcmd(H->link, stmt->active_query_string)) {
return 0;
@@ -156,7 +156,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
return 0;
}
- ret = pdo_dblib_stmt_next_rowset(stmt TSRMLS_CC);
+ ret = pdo_dblib_stmt_next_rowset(stmt);
stmt->row_count = DBCOUNT(H->link);
stmt->column_count = dbnumcols(H->link);
@@ -165,7 +165,7 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
RETCODE ret;
@@ -176,7 +176,7 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
ret = dbnextrow(H->link);
if (FAIL == ret) {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL");
return 0;
}
@@ -187,7 +187,7 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
return 1;
}
-static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
@@ -207,7 +207,7 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
}
static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
- zend_ulong *len, int *caller_frees TSRMLS_DC)
+ zend_ulong *len, int *caller_frees)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
@@ -275,12 +275,12 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
}
static int pdo_dblib_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
return 1;
}
-static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index 4cd0749cf8..7f38396e17 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -91,7 +91,6 @@ int pdo_dblib_error_handler(DBPROCESS *dbproc, int severity, int dberr,
{
pdo_dblib_err *einfo;
char *state = "HY000";
- TSRMLS_FETCH();
if(dbproc) {
einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
@@ -136,7 +135,6 @@ int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line)
{
pdo_dblib_err *einfo;
- TSRMLS_FETCH();
if (severity) {
einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index c80f61aa43..31432e2707 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -32,10 +32,10 @@
#include "php_pdo_firebird_int.h"
static int firebird_alloc_prepare_stmt(pdo_dbh_t*, const char*, zend_long, XSQLDA*, isc_stmt_handle*,
- HashTable* TSRMLS_DC);
+ HashTable*);
/* map driver specific error message to PDO error */
-void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line TSRMLS_DC) /* {{{ */
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line) /* {{{ */
{
#if 0
pdo_firebird_db_handle *H = stmt ? ((pdo_firebird_stmt *)stmt->driver_data)->H
@@ -90,10 +90,10 @@ void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_lo
}
/* }}} */
-#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__ TSRMLS_CC)
+#define RECORD_ERROR(dbh) _firebird_error(dbh, NULL, __FILE__, __LINE__)
/* called by PDO to close a db handle */
-static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -131,7 +131,7 @@ static int firebird_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* called by PDO to prepare an SQL query */
static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, /* {{{ */
- pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+ pdo_stmt_t *stmt, zval *driver_options)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
pdo_firebird_stmt *S = NULL;
@@ -150,7 +150,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long s
zend_hash_init(np, 8, NULL, NULL, 0);
/* allocate and prepare statement */
- if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np TSRMLS_CC)) {
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &num_sqlda, &s, np)) {
break;
}
@@ -216,7 +216,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long s
/* }}} */
/* called by PDO to execute a statement that doesn't produce a result set */
-static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC) /* {{{ */
+static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
isc_stmt_handle stmt = NULL;
@@ -231,7 +231,7 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long
out_sqlda.sqln = 1;
/* allocate and prepare statement */
- if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0 TSRMLS_CC)) {
+ if (!firebird_alloc_prepare_stmt(dbh, sql, sql_len, &out_sqlda, &stmt, 0)) {
return -1;
}
@@ -271,7 +271,7 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long
/* called by the PDO SQL parser to add quotes to values that are copied into SQL */
static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, /* {{{ */
- char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+ char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
int qcount = 0;
char const *co, *l, *r;
@@ -310,7 +310,7 @@ static int firebird_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unqu
/* }}} */
/* called by PDO to start a transaction */
-static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_begin(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
char tpb[8] = { isc_tpb_version3 }, *ptpb = tpb+1;
@@ -363,7 +363,7 @@ static int firebird_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to commit a transaction */
-static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_commit(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -376,7 +376,7 @@ static int firebird_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to rollback a transaction */
-static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int firebird_handle_rollback(pdo_dbh_t *dbh) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -390,7 +390,7 @@ static int firebird_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
/* used by prepare and exec to allocate a statement handle and prepare the SQL */
static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, /* {{{ */
- XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params TSRMLS_DC)
+ XSQLDA *out_sqlda, isc_stmt_handle *s, HashTable *named_params)
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
char *c, *new_sql, in_quote, in_param, pname[64], *ppname;
@@ -406,7 +406,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_lon
if (dbh->auto_commit && !dbh->in_txn) {
/* dbh->transaction_flags = PDO_TRANS_READ_UNCOMMITTED; */
- if (!firebird_handle_begin(dbh TSRMLS_CC)) {
+ if (!firebird_handle_begin(dbh)) {
return 0;
}
dbh->in_txn = 1;
@@ -468,7 +468,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, zend_lon
/* }}} */
/* called by PDO to set a driver-specific dbh attribute */
-static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -487,7 +487,7 @@ static int firebird_handle_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v
return 0;
} else {
/* close the transaction */
- if (!firebird_handle_commit(dbh TSRMLS_CC)) {
+ if (!firebird_handle_commit(dbh)) {
break;
}
dbh->in_txn = 0;
@@ -543,7 +543,7 @@ static void firebird_info_cb(void *arg, char const *s) /* {{{ */
/* }}} */
/* called by PDO to get a driver-specific dbh attribute */
-static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
@@ -599,7 +599,7 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v
/* }}} */
/* called by PDO to retrieve driver-specific information about an error that has occurred */
-static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
const ISC_STATUS *s = H->isc_status;
@@ -639,7 +639,7 @@ static struct pdo_dbh_methods firebird_methods = { /* {{{ */
/* }}} */
/* the driver-specific PDO handle constructor */
-static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
struct pdo_data_src_parser vars[] = {
{ "dbname", NULL, 0 },
@@ -694,12 +694,12 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM
char errmsg[512];
const ISC_STATUS *s = H->isc_status;
fb_interpret(errmsg, sizeof(errmsg),&s);
- zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1] TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%d] %s",
"HY000", H->isc_status[1], errmsg);
}
if (!ret) {
- firebird_handle_closer(dbh TSRMLS_CC);
+ firebird_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index d46a67d504..fd91a9672e 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -30,7 +30,7 @@
#include <time.h>
-#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__ TSRMLS_CC)
+#define RECORD_ERROR(stmt) _firebird_error(NULL, stmt, __FILE__, __LINE__)
/* free the allocated space for passing field values to the db and back */
static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
@@ -48,7 +48,7 @@ static void free_sqlda(XSQLDA const *sqlda) /* {{{ */
/* }}} */
/* called by PDO to clean up a statement handle */
-static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
int result = 1, i;
@@ -84,7 +84,7 @@ static int firebird_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* }}} */
/* called by PDO to execute a prepared query */
-static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -153,7 +153,7 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* called by PDO to fetch the next row from a statement */
static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -180,7 +180,7 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
/* }}} */
/* called by PDO to retrieve information about the fields being returned */
-static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
struct pdo_column_data *col = &stmt->columns[colno];
@@ -219,7 +219,7 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
/* fetch a blob into a fetch buffer */
static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
- zend_ulong *len, ISC_QUAD *blob_id TSRMLS_DC)
+ zend_ulong *len, ISC_QUAD *blob_id)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -296,7 +296,7 @@ fetch_blob_end:
/* }}} */
static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ */
- zend_ulong *len, int *caller_frees TSRMLS_DC)
+ zend_ulong *len, int *caller_frees)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
XSQLVAR const *var = &S->out_sqlda.sqlvar[colno];
@@ -400,7 +400,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
break;
case SQL_BLOB:
return firebird_fetch_blob(stmt,colno,ptr,len,
- (ISC_QUAD*)var->sqldata TSRMLS_CC);
+ (ISC_QUAD*)var->sqldata);
}
}
}
@@ -408,7 +408,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
}
/* }}} */
-static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param TSRMLS_DC)
+static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
pdo_firebird_db_handle *H = S->H;
@@ -447,7 +447,7 @@ static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param T
}
static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, /* {{{ */
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
XSQLDA *sqlda = param->is_param ? S->in_sqlda : &S->out_sqlda;
@@ -530,7 +530,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
zval_ptr_dtor(parameter);
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
}
@@ -542,7 +542,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
return 0;
case SQL_BLOB:
- return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter TSRMLS_CC);
+ return firebird_bind_blob(stmt, (ISC_QUAD*)var->sqldata, parameter);
}
/* check if a NULL should be inserted */
@@ -617,7 +617,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
zval_ptr_dtor(parameter);
ZVAL_NULL(parameter);
- if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees TSRMLS_CC)) {
+ if (firebird_stmt_get_col(stmt, param->paramno, &value, &value_len, &caller_frees)) {
switch (PDO_PARAM_TYPE(param->param_type)) {
case PDO_PARAM_STR:
if (value) {
@@ -654,7 +654,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
}
/* }}} */
-static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
@@ -675,7 +675,7 @@ static int firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval *v
}
/* }}} */
-static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC) /* {{{ */
+static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *val) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
@@ -694,7 +694,7 @@ static int firebird_stmt_get_attribute(pdo_stmt_t *stmt, zend_long attr, zval *v
}
/* }}} */
-static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
{
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h
index 18670fee18..59e053136c 100644
--- a/ext/pdo_firebird/php_pdo_firebird_int.h
+++ b/ext/pdo_firebird/php_pdo_firebird_int.h
@@ -128,7 +128,7 @@ extern pdo_driver_t pdo_firebird_driver;
extern struct pdo_stmt_methods firebird_stmt_methods;
-void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line TSRMLS_DC);
+void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, zend_long line);
enum {
PDO_FB_ATTR_DATE_FORMAT = PDO_ATTR_DRIVER_SPECIFIC,
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index 73889af5ea..66b70949cb 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -43,7 +43,7 @@
#endif
/* {{{ _pdo_mysql_error */
-int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC)
+int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err;
@@ -105,7 +105,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin
if (!dbh->methods) {
PDO_DBG_INF("Throwing exception");
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -114,7 +114,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int lin
/* }}} */
/* {{{ pdo_mysql_fetch_error_func */
-static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_mysql_error_info *einfo = &H->einfo;
@@ -138,7 +138,7 @@ static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
/* }}} */
/* {{{ mysql_handle_closer */
-static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_closer(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
@@ -161,7 +161,7 @@ static int mysql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
/* }}} */
/* {{{ mysql_handle_preparer */
-static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
pdo_mysql_stmt *S = ecalloc(1, sizeof(pdo_mysql_stmt));
@@ -187,7 +187,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
goto fallback;
}
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was rewritten */
@@ -240,7 +240,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
}
dbh->alloc_own_columns = 1;
- S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0 TSRMLS_CC);
+ S->max_length = pdo_attr_lval(driver_options, PDO_ATTR_MAX_COLUMN_LEN, 0);
PDO_DBG_RETURN(1);
@@ -253,7 +253,7 @@ end:
/* }}} */
/* {{{ mysql_handle_doer */
-static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
PDO_DBG_ENTER("mysql_handle_doer");
@@ -288,10 +288,10 @@ static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
/* }}} */
/* {{{ pdo_mysql_last_insert_id */
-static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
- char *id = php_pdo_int64_to_str(mysql_insert_id(H->server) TSRMLS_CC);
+ char *id = php_pdo_int64_to_str(mysql_insert_id(H->server));
PDO_DBG_ENTER("pdo_mysql_last_insert_id");
*len = strlen(id);
PDO_DBG_RETURN(id);
@@ -299,7 +299,7 @@ static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
/* }}} */
/* {{{ mysql_handle_quoter */
-static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype )
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
PDO_DBG_ENTER("mysql_handle_quoter");
@@ -315,42 +315,42 @@ static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
/* }}} */
/* {{{ mysql_handle_begin */
-static int mysql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_begin(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_quoter");
PDO_DBG_INF_FMT("dbh=%p", dbh);
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("START TRANSACTION")));
}
/* }}} */
/* {{{ mysql_handle_commit */
-static int mysql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_commit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_commit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
#endif
}
/* }}} */
/* {{{ mysql_handle_rollback */
-static int mysql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int mysql_handle_rollback(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_rollback");
PDO_DBG_INF_FMT("dbh=%p", dbh);
#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server));
#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK")));
#endif
}
/* }}} */
/* {{{ mysql_handle_autocommit */
-static inline int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
+static inline int mysql_handle_autocommit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_autocommit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
@@ -359,16 +359,16 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh TSRMLS_DC)
PDO_DBG_RETURN(0 <= mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit));
#else
if (dbh->auto_commit) {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1")));
} else {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0") TSRMLS_CC));
+ PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0")));
}
#endif
}
/* }}} */
/* {{{ pdo_mysql_set_attribute */
-static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
PDO_DBG_ENTER("pdo_mysql_set_attribute");
PDO_DBG_INF_FMT("dbh=%p", dbh);
@@ -379,7 +379,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSR
/* ignore if the new value equals the old one */
if (dbh->auto_commit ^ (Z_TYPE_P(val) == IS_TRUE)) {
dbh->auto_commit = (Z_TYPE_P(val) == IS_TRUE);
- mysql_handle_autocommit(dbh TSRMLS_CC);
+ mysql_handle_autocommit(dbh);
}
PDO_DBG_RETURN(1);
@@ -419,7 +419,7 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val TSR
/* }}} */
/* {{{ pdo_mysql_get_attribute */
-static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
@@ -482,7 +482,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
/* }}} */
/* {{{ pdo_mysql_check_liveness */
-static int pdo_mysql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_mysql_check_liveness(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
#if MYSQL_VERSION_ID <= 32230
@@ -538,7 +538,7 @@ static struct pdo_dbh_methods mysql_methods = {
#endif
/* {{{ pdo_mysql_handle_factory */
-static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
+static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
{
pdo_mysql_db_handle *H;
int i, ret = 0;
@@ -565,7 +565,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
#ifdef CLIENT_MULTI_STATEMENTS
if (!driver_options) {
connect_opts |= CLIENT_MULTI_STATEMENTS;
- } else if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MULTI_STATEMENTS, 1 TSRMLS_CC)) {
+ } else if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MULTI_STATEMENTS, 1)) {
connect_opts |= CLIENT_MULTI_STATEMENTS;
}
#endif
@@ -601,30 +601,30 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
/* handle MySQL options */
if (driver_options) {
- zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
- zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0 TSRMLS_CC);
+ zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
+ zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0);
char *init_cmd = NULL;
#ifndef PDO_USE_MYSQLND
char *default_file = NULL, *default_group = NULL;
#endif
zend_long compress = 0;
char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
- H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1 TSRMLS_CC);
+ H->buffered = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare TSRMLS_CC);
+ PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare);
H->emulate_prepare = pdo_attr_lval(driver_options,
- PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare TSRMLS_CC);
+ PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare);
#ifndef PDO_USE_MYSQLND
- H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size TSRMLS_CC);
+ H->max_buffer_size = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_MAX_BUFFER_SIZE, H->max_buffer_size);
#endif
- if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0 TSRMLS_CC)) {
+ if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_FOUND_ROWS, 0)) {
connect_opts |= CLIENT_FOUND_ROWS;
}
- if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_IGNORE_SPACE, 0 TSRMLS_CC)) {
+ if (pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_IGNORE_SPACE, 0)) {
connect_opts |= CLIENT_IGNORE_SPACE;
}
@@ -657,7 +657,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
mysql_options(H->server, MYSQL_OPT_RECONNECT, (const char*)&reconnect);
}
#endif
- init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL TSRMLS_CC);
+ init_cmd = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_INIT_COMMAND, NULL);
if (init_cmd) {
if (mysql_options(H->server, MYSQL_INIT_COMMAND, (const char *)init_cmd)) {
efree(init_cmd);
@@ -667,7 +667,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(init_cmd);
}
#ifndef PDO_USE_MYSQLND
- default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL TSRMLS_CC);
+ default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL);
if (default_file) {
if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) {
efree(default_file);
@@ -677,7 +677,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(default_file);
}
- default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL TSRMLS_CC);
+ default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL);
if (default_group) {
if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) {
efree(default_group);
@@ -687,7 +687,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
efree(default_group);
}
#endif
- compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
+ compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0);
if (compress) {
if (mysql_options(H->server, MYSQL_OPT_COMPRESS, 0)) {
pdo_mysql_error(dbh);
@@ -695,11 +695,11 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
}
- ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC);
- ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC);
- ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL TSRMLS_CC);
- ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL TSRMLS_CC);
- ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL TSRMLS_CC);
+ ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL);
+ ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL);
+ ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL);
+ ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL);
+ ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL);
if (ssl_key || ssl_cert || ssl_ca || ssl_capath || ssl_cipher) {
mysql_ssl_set(H->server, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher);
@@ -722,7 +722,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND)
{
- char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL TSRMLS_CC);
+ char *public_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY, NULL);
if (public_key) {
if (mysql_options(H->server, MYSQL_SERVER_PUBLIC_KEY, public_key)) {
pdo_mysql_error(dbh);
@@ -762,7 +762,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_len,
- port, unix_socket, connect_opts, MYSQLND_CLIENT_NO_FLAG TSRMLS_CC) == NULL) {
+ port, unix_socket, connect_opts, MYSQLND_CLIENT_NO_FLAG) == NULL) {
#else
if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, connect_opts) == NULL) {
#endif
@@ -771,7 +771,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (!dbh->auto_commit) {
- mysql_handle_autocommit(dbh TSRMLS_CC);
+ mysql_handle_autocommit(dbh);
}
H->attached = 1;
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index 20d3ede0f6..500ca20513 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -33,18 +33,18 @@
#include "php_pdo_mysql_int.h"
#ifdef PDO_USE_MYSQLND
-# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_mysqlnd(stmt TSRMLS_CC)
+# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_mysqlnd(stmt)
# define pdo_free_bound_result(res) zval_dtor(res.zv)
# define pdo_mysql_stmt_close(stmt) mysqlnd_stmt_close(stmt, 0)
#else
-# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_libmysql(stmt TSRMLS_CC)
+# define pdo_mysql_stmt_execute_prepared(stmt) pdo_mysql_stmt_execute_prepared_libmysql(stmt)
# define pdo_free_bound_result(res) efree(res.buffer)
# define pdo_mysql_stmt_close(stmt) mysql_stmt_close(stmt)
#endif
-static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
@@ -114,7 +114,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
{
zend_long row_count;
pdo_mysql_stmt *S = stmt->driver_data;
@@ -125,7 +125,7 @@ static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -159,7 +159,7 @@ static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* }}} */
#ifndef PDO_USE_MYSQLND
-static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -263,14 +263,14 @@ static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC)
}
}
- pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
+ pdo_mysql_stmt_set_row_count(stmt);
PDO_DBG_RETURN(1);
}
/* }}} */
#endif
#ifdef PDO_USE_MYSQLND
-static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -306,13 +306,13 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /
}
}
- pdo_mysql_stmt_set_row_count(stmt TSRMLS_CC);
+ pdo_mysql_stmt_set_row_count(stmt);
PDO_DBG_RETURN(1);
}
/* }}} */
#endif
-static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -334,11 +334,11 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
PDO_DBG_RETURN(0);
}
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
/* }}} */
-static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
@@ -424,14 +424,14 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#else
if (mysql_next_result(H->server) > 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#endif
}
@@ -450,7 +450,7 @@ static const char * const pdo_param_event_names[] =
};
-static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */
{
zval *parameter;
#ifndef PDO_USE_MYSQLND
@@ -528,7 +528,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
if (stm) {
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
}
@@ -608,7 +608,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
}
/* }}} */
-static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, zend_long offset) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
#if PDO_USE_MYSQLND
@@ -672,7 +672,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori
}
/* }}} */
-static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -722,7 +722,7 @@ static int pdo_mysql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{
}
/* }}} */
-static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
@@ -823,7 +823,7 @@ static char *type_to_name_native(int type) /* {{{ */
#undef PDO_MYSQL_NATIVE_TYPE_NAME
} /* }}} */
-static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
const MYSQL_FIELD *F;
@@ -893,7 +893,7 @@ static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *retu
PDO_DBG_RETURN(SUCCESS);
} /* }}} */
-static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 0e997b1dc7..1c94058535 100644
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -62,18 +62,18 @@ ZEND_DECLARE_MODULE_GLOBALS(pdo_mysql)
#ifdef PDO_USE_MYSQLND
#include "ext/mysqlnd/mysqlnd_reverse_api.h"
-static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC)
+static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv)
{
- if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) {
+ if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce())) {
pdo_dbh_t * dbh = Z_PDO_DBH_P(zv);
if (!dbh) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to retrieve handle from object store");
+ php_error_docref(NULL, E_WARNING, "Failed to retrieve handle from object store");
return NULL;
}
if (dbh->driver != &pdo_mysql_driver) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name);
+ php_error_docref(NULL, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name);
return NULL;
}
@@ -132,7 +132,7 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MULTI_STATEMENTS", (zend_long)PDO_MYSQL_ATTR_MULTI_STATEMENTS);
#ifdef PDO_USE_MYSQLND
- mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api TSRMLS_CC);
+ mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api);
#endif
return php_pdo_register_driver(&pdo_mysql_driver);
@@ -176,7 +176,7 @@ static PHP_MINFO_FUNCTION(pdo_mysql)
static PHP_RINIT_FUNCTION(pdo_mysql)
{
if (PDO_MYSQL_G(debug)) {
- MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
+ MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs);
if (!dbg) {
return FAILURE;
}
diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
index 9493fda6f8..03f42509a2 100644
--- a/ext/pdo_mysql/php_pdo_mysql_int.h
+++ b/ext/pdo_mysql/php_pdo_mysql_int.h
@@ -150,9 +150,9 @@ typedef struct {
extern pdo_driver_t pdo_mysql_driver;
-extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
-#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line);
+#define pdo_mysql_error(s) _pdo_mysql_error(s, NULL, __FILE__, __LINE__)
+#define pdo_mysql_error_stmt(s) _pdo_mysql_error(stmt->dbh, stmt, __FILE__, __LINE__)
extern struct pdo_stmt_methods mysql_stmt_methods;
diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c
index 2abc84ba33..3b7db421ab 100644
--- a/ext/pdo_oci/oci_driver.c
+++ b/ext/pdo_oci/oci_driver.c
@@ -33,7 +33,7 @@
static inline ub4 pdo_oci_sanitize_prefetch(long prefetch);
-static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
pdo_oci_error_info *einfo;
@@ -57,7 +57,7 @@ static int pdo_oci_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info
}
/* }}} */
-ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line TSRMLS_DC) /* {{{ */
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line) /* {{{ */
{
text errbuf[1024] = "<<Unknown>>";
char tmp_buf[2048];
@@ -188,14 +188,14 @@ ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, swor
/* little mini hack so that we can use this code from the dbh ctor */
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s]: %s", *pdo_err, einfo->errmsg);
}
return einfo->errcode;
}
/* }}} */
-static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -248,7 +248,7 @@ static int oci_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC) /* {{{ */
+static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pdo_stmt_t *stmt, zval *driver_options) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
pdo_oci_stmt *S = ecalloc(1, sizeof(*S));
@@ -259,7 +259,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
#if HAVE_OCISTMTFETCH2
S->exec_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
- PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL ?
+ PDO_CURSOR_FWDONLY) == PDO_CURSOR_SCROLL ?
OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT;
#else
S->exec_type = OCI_DEFAULT;
@@ -267,7 +267,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
S->H = H;
stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -302,7 +302,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
}
- prefetch = pdo_oci_sanitize_prefetch(pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, PDO_OCI_PREFETCH_DEFAULT TSRMLS_CC));
+ prefetch = pdo_oci_sanitize_prefetch(pdo_attr_lval(driver_options, PDO_ATTR_PREFETCH, PDO_OCI_PREFETCH_DEFAULT));
if (prefetch) {
H->last_err = OCIAttrSet(S->stmt, OCI_HTYPE_STMT, &prefetch, 0,
OCI_ATTR_PREFETCH_ROWS, H->err);
@@ -324,7 +324,7 @@ static int oci_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, pd
}
/* }}} */
-static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS_DC) /* {{{ */
+static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
OCIStmt *stmt;
@@ -346,7 +346,7 @@ static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS
if (stmt_type == OCI_STMT_SELECT) {
/* invalid usage; cancel it */
OCIHandleFree(stmt, OCI_HTYPE_STMT);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "issuing a SELECT query here is invalid");
+ php_error_docref(NULL, E_WARNING, "issuing a SELECT query here is invalid");
return -1;
}
@@ -368,7 +368,7 @@ static long oci_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRMLS
}
/* }}} */
-static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) /* {{{ */
+static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype ) /* {{{ */
{
int qcount = 0;
char const *cu, *l, *r;
@@ -405,14 +405,14 @@ static int oci_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedl
}
/* }}} */
-static int oci_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_begin(pdo_dbh_t *dbh) /* {{{ */
{
/* with Oracle, there is nothing special to be done */
return 1;
}
/* }}} */
-static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_commit(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -426,7 +426,7 @@ static int oci_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int oci_handle_rollback(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -440,7 +440,7 @@ static int oci_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) /* {{{ */
+static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -467,7 +467,7 @@ static int oci_handle_set_attribute(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_
}
/* }}} */
-static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value TSRMLS_DC) /* {{{ */
+static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_value) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
@@ -533,7 +533,7 @@ static int oci_handle_get_attribute(pdo_dbh_t *dbh, long attr, zval *return_valu
}
/* }}} */
-static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int pdo_oci_check_liveness(pdo_dbh_t *dbh) /* {{{ */
{
pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
sb4 error_code = 0;
@@ -588,7 +588,7 @@ static struct pdo_dbh_methods oci_methods = {
NULL /* get_driver_methods */
};
-static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_oci_db_handle *H;
int i, ret = 0;
@@ -708,7 +708,7 @@ cleanup:
}
if (!ret) {
- oci_handle_closer(dbh TSRMLS_CC);
+ oci_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c
index 7c86a23dcc..92f726bb9b 100644
--- a/ext/pdo_oci/oci_statement.c
+++ b/ext/pdo_oci/oci_statement.c
@@ -36,7 +36,7 @@
#define STMT_CALL(name, params) \
do { \
S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name, S->last_err, FALSE, __FILE__, __LINE__); \
if (S->last_err) { \
return 0; \
} \
@@ -45,15 +45,15 @@
#define STMT_CALL_MSG(name, msg, params) \
do { \
S->last_err = name params; \
- S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC); \
+ S->last_err = _oci_error(S->err, stmt->dbh, stmt, #name ": " #msg, S->last_err, FALSE, __FILE__, __LINE__); \
if (S->last_err) { \
return 0; \
} \
} while(0)
-static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC);
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob);
-static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int oci_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
HashTable *BC = stmt->bound_columns;
@@ -116,7 +116,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
return 1;
} /* }}} */
-static int oci_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+static int oci_stmt_execute(pdo_stmt_t *stmt) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
ub4 rowcount;
@@ -188,10 +188,9 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv
{
struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
+ php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
return OCI_ERROR;
}
@@ -220,10 +219,9 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d
{
struct pdo_bound_param_data *param = (struct pdo_bound_param_data*)ctx;
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
- TSRMLS_FETCH();
if (!param || !param->parameter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
+ php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
return OCI_ERROR;
}
@@ -258,7 +256,7 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d
return OCI_CONTINUE;
} /* }}} */
-static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type TSRMLS_DC) /* {{{ */
+static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param, enum pdo_param_event event_type) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
@@ -372,7 +370,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa
* wanted to bind a lob locator into it from the query
* */
- stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing TSRMLS_CC);
+ stm = oci_create_lob_stream(stmt, (OCILobLocator*)P->thing);
if (stm) {
OCILobOpen(S->H->svc, S->err, (OCILobLocator*)P->thing, OCI_LOB_READWRITE);
php_stream_to_zval(stm, param->parameter);
@@ -437,7 +435,7 @@ static int oci_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *pa
return 1;
} /* }}} */
-static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset TSRMLS_DC) /* {{{ */
+static int oci_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori, long offset) /* {{{ */
{
#if HAVE_OCISTMTFETCH2
ub4 ociori;
@@ -481,7 +479,6 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp)
{
pdo_oci_column *col = (pdo_oci_column*)octxp;
- TSRMLS_FETCH();
switch (col->dtype) {
case SQLT_BLOB:
@@ -493,7 +490,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"unhandled datatype in oci_define_callback; this should not happen");
return OCI_ERROR;
}
@@ -501,7 +498,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
return OCI_CONTINUE;
}
-static int oci_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) /* {{{ */
+static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
OCIParam *param = NULL;
@@ -611,7 +608,7 @@ struct oci_lob_self {
ub4 offset;
};
-static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
ub4 amt;
@@ -631,7 +628,7 @@ static size_t oci_blob_write(php_stream *stream, const char *buf, size_t count T
return amt;
}
-static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t oci_blob_read(php_stream *stream, char *buf, size_t count)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
ub4 amt;
@@ -653,7 +650,7 @@ static size_t oci_blob_read(php_stream *stream, char *buf, size_t count TSRMLS_D
return amt;
}
-static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int oci_blob_close(php_stream *stream, int close_handle)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
pdo_stmt_t *stmt = self->stmt;
@@ -663,18 +660,18 @@ static int oci_blob_close(php_stream *stream, int close_handle TSRMLS_DC)
efree(self);
}
- php_pdo_stmt_delref(stmt TSRMLS_CC);
+ php_pdo_stmt_delref(stmt);
return 0;
}
-static int oci_blob_flush(php_stream *stream TSRMLS_DC)
+static int oci_blob_flush(php_stream *stream)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
OCILobFlushBuffer(self->S->H->svc, self->S->err, self->lob, 0);
return 0;
}
-static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset TSRMLS_DC)
+static int oci_blob_seek(php_stream *stream, off_t offset, int whence, off_t *newoffset)
{
struct oci_lob_self *self = (struct oci_lob_self*)stream->abstract;
@@ -698,7 +695,7 @@ static php_stream_ops oci_blob_stream_ops = {
NULL
};
-static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TSRMLS_DC)
+static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob)
{
php_stream *stm;
struct oci_lob_self *self = ecalloc(1, sizeof(*self));
@@ -710,7 +707,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS
stm = php_stream_alloc(&oci_blob_stream_ops, self, 0, "r+b");
if (stm) {
- php_pdo_stmt_addref(stmt TSRMLS_CC);
+ php_pdo_stmt_addref(stmt);
return stm;
}
@@ -718,7 +715,7 @@ static php_stream *oci_create_lob_stream(pdo_stmt_t *stmt, OCILobLocator *lob TS
return NULL;
}
-static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) /* {{{ */
+static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees) /* {{{ */
{
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
pdo_oci_column *C = &S->cols[colno];
@@ -734,7 +731,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo
if (C->dtype == SQLT_BLOB || C->dtype == SQLT_CLOB) {
if (C->data) {
- *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data TSRMLS_CC);
+ *ptr = (char*)oci_create_lob_stream(stmt, (OCILobLocator*)C->data);
OCILobOpen(S->H->svc, S->err, (OCILobLocator*)C->data, OCI_LOB_READONLY);
}
*len = 0;
@@ -746,7 +743,7 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned lo
return 1;
} else {
/* it was truncated */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno);
+ php_error_docref(NULL, E_WARNING, "column %d data was too large for buffer and was truncated to fit it", colno);
*ptr = C->data;
*len = C->fetched_len;
diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h
index 36d45d0af7..ada423ccf0 100644
--- a/ext/pdo_oci/php_pdo_oci_int.h
+++ b/ext/pdo_oci/php_pdo_oci_int.h
@@ -86,10 +86,10 @@ extern const ub4 PDO_OCI_INIT_MODE;
extern pdo_driver_t pdo_oci_driver;
extern OCIEnv *pdo_oci_Env;
-ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line TSRMLS_DC);
-#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__ TSRMLS_CC)
-#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC)
-#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__ TSRMLS_CC)
+ub4 _oci_error(OCIError *err, pdo_dbh_t *dbh, pdo_stmt_t *stmt, char *what, sword status, int isinit, const char *file, int line);
+#define oci_init_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, TRUE, __FILE__, __LINE__)
+#define oci_drv_error(w) _oci_error(H->err, dbh, NULL, w, H->last_err, FALSE, __FILE__, __LINE__)
+#define oci_stmt_error(w) _oci_error(S->err, stmt->dbh, stmt, w, S->last_err, FALSE, __FILE__, __LINE__)
extern struct pdo_stmt_methods oci_stmt_methods;
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c
index c0034d43ea..4b9bd24818 100644
--- a/ext/pdo_odbc/odbc_driver.c
+++ b/ext/pdo_odbc/odbc_driver.c
@@ -31,7 +31,7 @@
#include "php_pdo_odbc_int.h"
#include "zend_exceptions.h"
-static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
pdo_odbc_errinfo *einfo = &H->einfo;
@@ -56,7 +56,7 @@ static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *inf
}
-void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC) /* {{{ */
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line) /* {{{ */
{
SQLRETURN rc;
SQLSMALLINT errmsgsize = 0;
@@ -104,7 +104,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
strcpy(*pdo_err, einfo->last_state);
/* printf("@@ SQLSTATE[%s] %s\n", *pdo_err, einfo->last_err_msg); */
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->last_error TSRMLS_CC, "SQLSTATE[%s] %s: %d %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->last_error, "SQLSTATE[%s] %s: %d %s",
*pdo_err, what, einfo->last_error, einfo->last_err_msg);
}
@@ -124,7 +124,7 @@ void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement,
}
/* }}} */
-static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_closer(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data;
@@ -142,7 +142,7 @@ static int odbc_handle_closer(pdo_dbh_t *dbh TSRMLS_DC)
return 0;
}
-static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
RETCODE rc;
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
@@ -158,7 +158,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
/* before we prepare, we need to peek at the query; if it uses named parameters,
* we want PDO to rewrite them for us */
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL;
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -181,7 +181,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
return 0;
}
- cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC);
+ cursor_type = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY);
if (cursor_type != PDO_CURSOR_FWDONLY) {
rc = SQLSetStmtAttr(S->stmt, SQL_ATTR_CURSOR_SCROLLABLE, (void*)SQL_SCROLLABLE, 0);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
@@ -220,7 +220,7 @@ static int odbc_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_l
return 1;
}
-static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -261,14 +261,14 @@ out:
return row_count;
}
-static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC)
+static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type )
{
/* pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; */
/* TODO: figure it out */
return 0;
}
-static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_begin(pdo_dbh_t *dbh)
{
if (dbh->auto_commit) {
/* we need to disable auto-commit now, to be able to initiate a transaction */
@@ -284,7 +284,7 @@ static int odbc_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_commit(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -310,7 +310,7 @@ static int odbc_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int odbc_handle_rollback(pdo_dbh_t *dbh)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
RETCODE rc;
@@ -336,7 +336,7 @@ static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -351,7 +351,7 @@ static int odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS
}
}
-static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data;
switch (attr) {
@@ -388,7 +388,7 @@ static struct pdo_dbh_methods odbc_methods = {
NULL, /* check_liveness */
};
-static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_odbc_db_handle *H;
RETCODE rc;
@@ -431,7 +431,7 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_D
}
/* set up the cursor library, if needed, or if configured explicitly */
- cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED TSRMLS_CC);
+ cursor_lib = pdo_attr_lval(driver_options, PDO_ODBC_ATTR_USE_CURSOR_LIBRARY, SQL_CUR_USE_IF_NEEDED);
rc = SQLSetConnectAttr(H->dbc, SQL_ODBC_CURSORS, (void*)cursor_lib, SQL_IS_INTEGER);
if (rc != SQL_SUCCESS && cursor_lib != SQL_CUR_USE_IF_NEEDED) {
pdo_odbc_drv_error("SQLSetConnectAttr SQL_ODBC_CURSORS");
diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c
index 7491ec685d..9b73cd5ef9 100644
--- a/ext/pdo_odbc/odbc_stmt.c
+++ b/ext/pdo_odbc/odbc_stmt.c
@@ -123,7 +123,7 @@ static int pdo_odbc_ucs22utf8(pdo_stmt_t *stmt, int is_unicode, const char *buf,
return PDO_ODBC_CONV_NOT_REQUIRED;
}
-static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC)
+static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S)
{
if (S->cols) {
int i;
@@ -138,7 +138,7 @@ static void free_cols(pdo_stmt_t *stmt, pdo_odbc_stmt *S TSRMLS_DC)
}
}
-static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -150,7 +150,7 @@ static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
S->stmt = SQL_NULL_HANDLE;
}
- free_cols(stmt, S TSRMLS_CC);
+ free_cols(stmt, S);
if (S->convbuf) {
efree(S->convbuf);
}
@@ -159,7 +159,7 @@ static int odbc_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_execute(pdo_stmt_t *stmt)
{
RETCODE rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -280,7 +280,7 @@ static int odbc_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
RETCODE rc;
@@ -524,7 +524,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
}
static int odbc_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
RETCODE rc;
SQLSMALLINT odbcori;
@@ -561,7 +561,7 @@ static int odbc_stmt_fetch(pdo_stmt_t *stmt,
return 0;
}
-static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
struct pdo_column_data *col = &stmt->columns[colno];
@@ -628,7 +628,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int odbc_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees)
{
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
pdo_odbc_column *C = &S->cols[colno];
@@ -755,7 +755,7 @@ in_data:
return 1;
}
-static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -782,7 +782,7 @@ static int odbc_stmt_set_param(pdo_stmt_t *stmt, zend_long attr, zval *val TSRML
}
}
-static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS_DC)
+static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val)
{
SQLRETURN rc;
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
@@ -814,7 +814,7 @@ static int odbc_stmt_get_attr(pdo_stmt_t *stmt, zend_long attr, zval *val TSRMLS
}
}
-static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
+static int odbc_stmt_next_rowset(pdo_stmt_t *stmt)
{
SQLRETURN rc;
SQLSMALLINT colcount;
@@ -829,7 +829,7 @@ static int odbc_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
return 0;
}
- free_cols(stmt, S TSRMLS_CC);
+ free_cols(stmt, S);
/* how many columns do we have ? */
SQLNumResultCols(S->stmt, &colcount);
stmt->column_count = (int)colcount;
diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c
index 914b8bc980..21dd0e0ce5 100644
--- a/ext/pdo_odbc/pdo_odbc.c
+++ b/ext/pdo_odbc/pdo_odbc.c
@@ -127,7 +127,7 @@ PHP_MINIT_FUNCTION(pdo_odbc)
} else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) {
pdo_odbc_pool_on = SQL_CP_OFF;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
+ php_error_docref(NULL, E_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'");
return FAILURE;
}
diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h
index 0d6d488b65..bfa83016c9 100644
--- a/ext/pdo_odbc/php_pdo_odbc_int.h
+++ b/ext/pdo_odbc/php_pdo_odbc_int.h
@@ -167,10 +167,10 @@ typedef struct {
extern pdo_driver_t pdo_odbc_driver;
extern struct pdo_stmt_methods odbc_stmt_methods;
-void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line TSRMLS_DC);
-#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__ TSRMLS_CC)
+void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line);
+#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
+#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
+#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__)
void pdo_odbc_init_error_table(void);
void pdo_odbc_fini_error_table(void);
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 2d45152ad9..c2f744f0d5 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -62,7 +62,7 @@ static char * _pdo_pgsql_trim_message(const char *message, int persistent)
return tmp;
}
-int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC) /* {{{ */
+int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
@@ -93,7 +93,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *
}
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -107,7 +107,7 @@ static void _pdo_pgsql_notice(pdo_dbh_t *dbh, const char *message) /* {{{ */
}
/* }}} */
-static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC) /* {{{ */
+static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_error_info *einfo = &H->einfo;
@@ -122,19 +122,19 @@ static int pdo_pgsql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in
/* }}} */
/* {{{ pdo_pgsql_create_lob_stream */
-static size_t pgsql_lob_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t pgsql_lob_write(php_stream *stream, const char *buf, size_t count)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
return lo_write(self->conn, self->lfd, (char*)buf, count);
}
-static size_t pgsql_lob_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t pgsql_lob_read(php_stream *stream, char *buf, size_t count)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
return lo_read(self->conn, self->lfd, buf, count);
}
-static int pgsql_lob_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int pgsql_lob_close(php_stream *stream, int close_handle)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
@@ -146,13 +146,13 @@ static int pgsql_lob_close(php_stream *stream, int close_handle TSRMLS_DC)
return 0;
}
-static int pgsql_lob_flush(php_stream *stream TSRMLS_DC)
+static int pgsql_lob_flush(php_stream *stream)
{
return 0;
}
static int pgsql_lob_seek(php_stream *stream, zend_off_t offset, int whence,
- zend_off_t *newoffset TSRMLS_DC)
+ zend_off_t *newoffset)
{
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
int pos = lo_lseek(self->conn, self->lfd, offset, whence);
@@ -172,7 +172,7 @@ php_stream_ops pdo_pgsql_lob_stream_ops = {
NULL
};
-php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid TSRMLS_DC)
+php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid)
{
php_stream *stm;
struct pdo_pgsql_lob_self *self = ecalloc(1, sizeof(*self));
@@ -195,7 +195,7 @@ php_stream *pdo_pgsql_create_lob_stream(zval *dbh, int lfd, Oid oid TSRMLS_DC)
}
/* }}} */
-static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int pgsql_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (H) {
@@ -214,7 +214,7 @@ static int pgsql_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_stmt *S = ecalloc(1, sizeof(pdo_pgsql_stmt));
@@ -230,7 +230,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
stmt->methods = &pgsql_stmt_methods;
scrollable = pdo_attr_lval(driver_options, PDO_ATTR_CURSOR,
- PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
+ PDO_CURSOR_FWDONLY) == PDO_CURSOR_SCROLL;
if (scrollable) {
if (S->cursor_name) {
@@ -239,14 +239,14 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
spprintf(&S->cursor_name, 0, "pdo_crsr_%08x", ++H->stmt_counter);
emulate = 1;
} else if (driver_options) {
- if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, H->disable_native_prepares TSRMLS_CC) == 1) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
+ if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, H->disable_native_prepares) == 1) {
+ php_error_docref(NULL, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
emulate = 1;
}
- if (pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepares TSRMLS_CC) == 1) {
+ if (pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepares) == 1) {
emulate = 1;
}
- if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_PREPARES, H->disable_prepares TSRMLS_CC) == 1) {
+ if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_PREPARES, H->disable_prepares) == 1) {
execute_only = 1;
}
} else {
@@ -257,7 +257,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
if (!emulate && PQprotocolVersion(H->server) > 2) {
stmt->supports_placeholders = PDO_PLACEHOLDER_NAMED;
stmt->named_rewrite_template = "$%d";
- ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
+ ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len);
if (ret == 1) {
/* query was re-written */
@@ -287,7 +287,7 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_
return 1;
}
-static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
PGresult *res;
@@ -316,7 +316,7 @@ static zend_long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
return ret;
}
-static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype)
{
unsigned char *escaped;
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -345,7 +345,7 @@ static int pgsql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote
return 1;
}
-static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
char *id = NULL;
@@ -377,7 +377,7 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
return id;
}
-static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -461,7 +461,7 @@ static int pdo_pgsql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
}
/* {{{ */
-static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
if (PQstatus(H->server) == CONNECTION_BAD) {
@@ -471,7 +471,7 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
}
/* }}} */
-static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_in_transaction(pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H;
@@ -480,7 +480,7 @@ static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
return PQtransactionStatus(H->server) > PQTRANS_IDLE;
}
-static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
+static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
PGresult *res;
@@ -497,27 +497,27 @@ static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
return ret;
}
-static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_begin(pdo_dbh_t *dbh)
{
- return pdo_pgsql_transaction_cmd("BEGIN", dbh TSRMLS_CC);
+ return pdo_pgsql_transaction_cmd("BEGIN", dbh);
}
-static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_commit(pdo_dbh_t *dbh)
{
- int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC);
+ int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh);
/* When deferred constraints are used the commit could
fail, and a ROLLBACK implicitly ran. See bug #67462 */
if (!ret) {
- dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC);
+ dbh->in_txn = pgsql_handle_in_transaction(dbh);
}
return ret;
}
-static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int pgsql_handle_rollback(pdo_dbh_t *dbh)
{
- return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC);
+ return pdo_pgsql_transaction_cmd("ROLLBACK", dbh);
}
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields])
@@ -536,14 +536,14 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
PGresult *pgsql_result;
ExecStatusType status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s/a|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s/a|sss",
&table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
}
if (!zend_hash_num_elements(Z_ARRVAL_P(pg_rows))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot copy from an empty array");
+ php_error_docref(NULL, E_WARNING, "Cannot copy from an empty array");
RETURN_FALSE;
}
@@ -645,7 +645,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
ExecStatusType status;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -746,7 +746,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile)
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|sss",
&table_name, &table_name_len, &filename, &filename_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -839,7 +839,7 @@ static PHP_METHOD(PDO, pgsqlCopyToArray)
PGresult *pgsql_result;
ExecStatusType status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sss",
&table_name, &table_name_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) {
return;
@@ -944,7 +944,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
int mode = INV_READ;
char *end_ptr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s|s",
&oidstr, &oidstrlen, &modestr, &modestrlen)) {
RETURN_FALSE;
}
@@ -967,7 +967,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
lfd = lo_open(H->server, oid, mode);
if (lfd >= 0) {
- php_stream *stream = pdo_pgsql_create_lob_stream(getThis(), lfd, oid TSRMLS_CC);
+ php_stream *stream = pdo_pgsql_create_lob_stream(getThis(), lfd, oid);
if (stream) {
php_stream_to_zval(stream, return_value);
return;
@@ -991,7 +991,7 @@ static PHP_METHOD(PDO, pgsqlLOBUnlink)
char *oidstr, *end_ptr;
size_t oidlen;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&oidstr, &oidlen)) {
RETURN_FALSE;
}
@@ -1027,7 +1027,7 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
zend_long ms_timeout = 0;
PGnotify *pgsql_notify;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|ll",
&result_type, &ms_timeout)) {
RETURN_FALSE;
}
@@ -1040,12 +1040,12 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
}
if (result_type != PDO_FETCH_BOTH && result_type != PDO_FETCH_ASSOC && result_type != PDO_FETCH_NUM) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
if (ms_timeout < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid timeout");
+ php_error_docref(NULL, E_WARNING, "Invalid timeout");
RETURN_FALSE;
}
@@ -1115,7 +1115,7 @@ static const zend_function_entry dbh_methods[] = {
PHP_FE_END
};
-static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, int kind)
{
switch (kind) {
case PDO_DBH_DRIVER_METHOD_KIND_DBH:
@@ -1125,7 +1125,7 @@ static const zend_function_entry *pdo_pgsql_get_driver_methods(pdo_dbh_t *dbh, i
}
}
-static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -1136,7 +1136,7 @@ static int pdo_pgsql_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_D
return 1;
case PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT:
convert_to_long(val);
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
+ php_error_docref(NULL, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
H->disable_native_prepares = Z_LVAL_P(val);
return 1;
case PDO_PGSQL_ATTR_DISABLE_PREPARES:
@@ -1166,7 +1166,7 @@ static struct pdo_dbh_methods pgsql_methods = {
pgsql_handle_in_transaction,
};
-static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_pgsql_db_handle *H;
int ret = 0;
@@ -1190,7 +1190,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
}
if (driver_options) {
- connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC);
+ connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
}
if (dbh->password) {
@@ -1253,7 +1253,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
cleanup:
dbh->methods = &pgsql_methods;
if (!ret) {
- pgsql_handle_closer(dbh TSRMLS_CC);
+ pgsql_handle_closer(dbh);
}
return ret;
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 49fbc63745..8c2f449e61 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -44,7 +44,7 @@
#define TEXTOID 25
#define OIDOID 26
-static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -113,7 +113,7 @@ static int pgsql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pgsql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pgsql_stmt_execute(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
pdo_pgsql_db_handle *H = S->H;
@@ -240,7 +240,7 @@ stmt_retry:
}
static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -266,7 +266,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
ZEND_ATOL(param->paramno, namevar + 1);
param->paramno--;
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val);
return 0;
}
}
@@ -386,7 +386,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
}
static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
@@ -433,7 +433,7 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
}
}
-static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -493,7 +493,7 @@ static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees )
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
struct pdo_column_data *cols = stmt->columns;
@@ -532,7 +532,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulon
Oid oid = (Oid)strtoul(*ptr, &end_ptr, 10);
int loid = lo_open(S->H->server, oid, INV_READ);
if (loid >= 0) {
- *ptr = (char*)pdo_pgsql_create_lob_stream(&stmt->database_object_handle, loid, oid TSRMLS_CC);
+ *ptr = (char*)pdo_pgsql_create_lob_stream(&stmt->database_object_handle, loid, oid);
*len = 0;
return *ptr ? 1 : 0;
}
@@ -572,7 +572,7 @@ static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulon
return 1;
}
-static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
PGresult *res;
@@ -615,7 +615,7 @@ done:
return 1;
}
-static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt)
{
return 1;
}
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
index 722d63706e..b98afa875b 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql_int.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -79,11 +79,11 @@ typedef struct {
extern pdo_driver_t pdo_pgsql_driver;
-extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC);
-#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line);
+#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__)
+#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__)
+#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__)
+#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__)
extern struct pdo_stmt_methods pgsql_stmt_methods;
@@ -109,7 +109,7 @@ enum pdo_pgsql_specific_constants {
PGSQL_TRANSACTION_UNKNOWN = PQTRANS_UNKNOWN
};
-php_stream *pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid TSRMLS_DC);
+php_stream *pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid);
extern php_stream_ops pdo_pgsql_lob_stream_ops;
#endif /* PHP_PDO_PGSQL_INT_H */
diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h
index 133893bf8f..6fbef66269 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite_int.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h
@@ -70,9 +70,9 @@ typedef struct {
extern pdo_driver_t pdo_sqlite_driver;
-extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC);
-#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__ TSRMLS_CC)
-#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__ TSRMLS_CC)
+extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line);
+#define pdo_sqlite_error(s) _pdo_sqlite_error(s, NULL, __FILE__, __LINE__)
+#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__)
extern struct pdo_stmt_methods sqlite_stmt_methods;
#endif
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index 413b50b9d4..8e1de906a5 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -31,7 +31,7 @@
#include "php_pdo_sqlite_int.h"
#include "zend_exceptions.h"
-int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line TSRMLS_DC) /* {{{ */
+int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code;
@@ -78,7 +78,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li
}
if (!dbh->methods) {
- zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode TSRMLS_CC, "SQLSTATE[%s] [%d] %s",
+ zend_throw_exception_ex(php_pdo_get_exception(), einfo->errcode, "SQLSTATE[%s] [%d] %s",
*pdo_err, einfo->errcode, einfo->errmsg);
}
@@ -86,7 +86,7 @@ int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int li
}
/* }}} */
-static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
+static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_sqlite_error_info *einfo = &H->einfo;
@@ -99,7 +99,7 @@ static int pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *i
return 1;
}
-static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC)
+static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H)
{
struct pdo_sqlite_func *func;
@@ -152,14 +152,14 @@ static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC)
}
}
-static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
+static int sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
if (H) {
pdo_sqlite_error_info *einfo = &H->einfo;
- pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ pdo_sqlite_cleanup_callbacks(H);
if (H->db) {
sqlite3_close(H->db);
H->db = NULL;
@@ -175,7 +175,7 @@ static int sqlite_handle_closer(pdo_dbh_t *dbh TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options TSRMLS_DC)
+static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len, pdo_stmt_t *stmt, zval *driver_options)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
pdo_sqlite_stmt *S = ecalloc(1, sizeof(pdo_sqlite_stmt));
@@ -187,7 +187,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql
stmt->methods = &sqlite_stmt_methods;
stmt->supports_placeholders = PDO_PLACEHOLDER_POSITIONAL|PDO_PLACEHOLDER_NAMED;
- if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY TSRMLS_CC)) {
+ if (PDO_CURSOR_FWDONLY != pdo_attr_lval(driver_options, PDO_ATTR_CURSOR, PDO_CURSOR_FWDONLY)) {
H->einfo.errcode = SQLITE_ERROR;
pdo_sqlite_error(dbh);
return 0;
@@ -203,7 +203,7 @@ static int sqlite_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql
return 0;
}
-static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len TSRMLS_DC)
+static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sql_len)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -219,18 +219,18 @@ static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long s
}
}
-static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len TSRMLS_DC)
+static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned int *len)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *id;
- id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db) TSRMLS_CC);
+ id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db));
*len = strlen(id);
return id;
}
/* NB: doesn't handle binary strings... use prepared stmts for that */
-static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
+static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype )
{
*quoted = safe_emalloc(2, unquotedlen, 3);
sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted);
@@ -238,7 +238,7 @@ static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquot
return 1;
}
-static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_begin(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -252,7 +252,7 @@ static int sqlite_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_commit(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -266,7 +266,7 @@ static int sqlite_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
+static int sqlite_handle_rollback(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
char *errmsg = NULL;
@@ -280,7 +280,7 @@ static int sqlite_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC)
+static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value)
{
switch (attr) {
case PDO_ATTR_CLIENT_VERSION:
@@ -295,7 +295,7 @@ static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return
return 1;
}
-static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC)
+static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
@@ -310,7 +310,7 @@ static int pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_
static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
int argc, sqlite3_value **argv, sqlite3_context *context,
- int is_agg TSRMLS_DC)
+ int is_agg)
{
zval *zargs = NULL;
zval retval;
@@ -379,8 +379,8 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb,
fc->fci.params = zargs;
- if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&fc->fci, &fc->fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
}
/* clean up the params */
@@ -448,26 +448,23 @@ static void php_sqlite3_func_callback(sqlite3_context *context, int argc,
sqlite3_value **argv)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->afunc, &func->func, argc, argv, context, 0 TSRMLS_CC);
+ do_callback(&func->afunc, &func->func, argc, argv, context, 0);
}
static void php_sqlite3_func_step_callback(sqlite3_context *context, int argc,
sqlite3_value **argv)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->astep, &func->step, argc, argv, context, 1 TSRMLS_CC);
+ do_callback(&func->astep, &func->step, argc, argv, context, 1);
}
static void php_sqlite3_func_final_callback(sqlite3_context *context)
{
struct pdo_sqlite_func *func = (struct pdo_sqlite_func*)sqlite3_user_data(context);
- TSRMLS_FETCH();
- do_callback(&func->afini, &func->fini, 0, NULL, context, 1 TSRMLS_CC);
+ do_callback(&func->afini, &func->fini, 0, NULL, context, 1);
}
static int php_sqlite3_collation_callback(void *context,
@@ -478,7 +475,6 @@ static int php_sqlite3_collation_callback(void *context,
zval zargs[2];
zval retval;
struct pdo_sqlite_collation *collation = (struct pdo_sqlite_collation*) context;
- TSRMLS_FETCH();
collation->fc.fci.size = sizeof(collation->fc.fci);
collation->fc.fci.function_table = EG(function_table);
@@ -493,8 +489,8 @@ static int php_sqlite3_collation_callback(void *context,
collation->fc.fci.param_count = 2;
collation->fc.fci.params = zargs;
- if ((ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
convert_to_long_ex(&retval);
@@ -528,7 +524,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz|l",
&func_name, &func_name_len, &callback, &argc)) {
RETURN_FALSE;
}
@@ -536,8 +532,8 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -598,7 +594,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l",
&func_name, &func_name_len, &step_callback, &fini_callback, &argc)) {
RETURN_FALSE;
}
@@ -606,14 +602,14 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(step_callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(step_callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
zend_string_release(cbname);
- if (!zend_is_callable(fini_callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(fini_callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -658,7 +654,7 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
pdo_sqlite_db_handle *H;
int ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz",
&collation_name, &collation_name_len, &callback)) {
RETURN_FALSE;
}
@@ -666,8 +662,8 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
dbh = Z_PDO_DBH_P(getThis());
PDO_CONSTRUCT_CHECK;
- if (!zend_is_callable(callback, 0, &cbname TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "function '%s' is not callable", cbname->val);
+ if (!zend_is_callable(callback, 0, &cbname)) {
+ php_error_docref(NULL, E_WARNING, "function '%s' is not callable", cbname->val);
zend_string_release(cbname);
RETURN_FALSE;
}
@@ -701,7 +697,7 @@ static const zend_function_entry dbh_methods[] = {
PHP_FE_END
};
-static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC)
+static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind)
{
switch (kind) {
case PDO_DBH_DRIVER_METHOD_KIND_DBH:
@@ -712,13 +708,13 @@ static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind TS
}
}
-static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh TSRMLS_DC)
+static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh)
{
pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data;
/* unregister functions, so that they don't linger for the next
* request */
if (H) {
- pdo_sqlite_cleanup_callbacks(H TSRMLS_CC);
+ pdo_sqlite_cleanup_callbacks(H);
}
}
@@ -739,16 +735,16 @@ static struct pdo_dbh_methods sqlite_methods = {
pdo_sqlite_request_shutdown
};
-static char *make_filename_safe(const char *filename TSRMLS_DC)
+static char *make_filename_safe(const char *filename)
{
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
- char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+ char *fullpath = expand_filepath(filename, NULL);
if (!fullpath) {
return NULL;
}
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
+ if (php_check_open_basedir(fullpath)) {
efree(fullpath);
return NULL;
}
@@ -763,8 +759,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
char *filename;
switch (access_type) {
case SQLITE_COPY: {
- TSRMLS_FETCH();
- filename = make_filename_safe(arg4 TSRMLS_CC);
+ filename = make_filename_safe(arg4);
if (!filename) {
return SQLITE_DENY;
}
@@ -773,8 +768,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
}
case SQLITE_ATTACH: {
- TSRMLS_FETCH();
- filename = make_filename_safe(arg3 TSRMLS_CC);
+ filename = make_filename_safe(arg3);
if (!filename) {
return SQLITE_DENY;
}
@@ -788,7 +782,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
}
}
-static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */
+static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */
{
pdo_sqlite_db_handle *H;
int i, ret = 0;
@@ -801,10 +795,10 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS
H->einfo.errmsg = NULL;
dbh->driver_data = H;
- filename = make_filename_safe(dbh->data_source TSRMLS_CC);
+ filename = make_filename_safe(dbh->data_source);
if (!filename) {
- zend_throw_exception_ex(php_pdo_get_exception(), 0 TSRMLS_CC,
+ zend_throw_exception_ex(php_pdo_get_exception(), 0,
"open_basedir prohibits opening %s",
dbh->data_source);
goto cleanup;
@@ -823,7 +817,7 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS
}
if (driver_options) {
- timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout TSRMLS_CC);
+ timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, timeout);
}
sqlite3_busy_timeout(H->db, timeout * 1000);
diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c
index 378d8bb337..ae7a5140df 100644
--- a/ext/pdo_sqlite/sqlite_statement.c
+++ b/ext/pdo_sqlite/sqlite_statement.c
@@ -31,7 +31,7 @@
#include "php_pdo_sqlite_int.h"
-static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -43,7 +43,7 @@ static int pdo_sqlite_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -76,7 +76,7 @@ static int pdo_sqlite_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
}
static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *param,
- enum pdo_param_event event_type TSRMLS_DC)
+ enum pdo_param_event event_type)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
zval *parameter;
@@ -144,7 +144,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
zval_ptr_dtor(parameter);
ZVAL_STR(parameter, php_stream_copy_to_mem(stm, PHP_STREAM_COPY_ALL, 0));
} else {
- pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource");
return 0;
}
} else if (Z_TYPE_P(parameter) == IS_NULL) {
@@ -198,7 +198,7 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
}
static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
- enum pdo_fetch_orientation ori, zend_long offset TSRMLS_DC)
+ enum pdo_fetch_orientation ori, zend_long offset)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
int i;
@@ -230,7 +230,7 @@ static int pdo_sqlite_stmt_fetch(pdo_stmt_t *stmt,
}
}
-static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
+static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
@@ -259,7 +259,7 @@ static int pdo_sqlite_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
return 1;
}
-static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees TSRMLS_DC)
+static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend_ulong *len, int *caller_frees)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
if (!S->stmt) {
@@ -288,7 +288,7 @@ static int pdo_sqlite_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, zend
}
}
-static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value TSRMLS_DC)
+static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
const char *str;
@@ -343,7 +343,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
return SUCCESS;
}
-static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_sqlite_stmt_cursor_closer(pdo_stmt_t *stmt)
{
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
sqlite3_reset(S->stmt);
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 7916afc3fc..f8635298fc 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -86,7 +86,7 @@
#define PQ_SETNONBLOCKING(pg_link, flag) 0
#endif
-#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); }
+#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL, E_WARNING, "No PostgreSQL link opened yet"); }
#define FETCH_DEFAULT_LINK() PGG(default_link) ? (int)PGG(default_link)->handle : -1
#ifndef HAVE_PQFREEMEM
@@ -838,9 +838,8 @@ static char *php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t le
!strncmp(encoding, "GBK", sizeof("GBK")-1) ||
!strncmp(encoding, "JOHAB", sizeof("JOHAB")-1) ||
!strncmp(encoding, "UHC", sizeof("UHC")-1) ) {
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding);
+
+ php_error_docref(NULL, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding);
}
/* check backslashes */
tmp_len = strspn(str, "\\");
@@ -910,13 +909,13 @@ static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf)
#define PHP_PQ_ERROR(text, pgsql) { \
char *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, text, msgbuf); \
+ php_error_docref(NULL, E_WARNING, text, msgbuf); \
efree(msgbuf); \
} \
/* {{{ php_pgsql_set_default_link
*/
-static void php_pgsql_set_default_link(zend_resource *res TSRMLS_DC)
+static void php_pgsql_set_default_link(zend_resource *res)
{
GC_REFCOUNT(res)++;
@@ -930,7 +929,7 @@ static void php_pgsql_set_default_link(zend_resource *res TSRMLS_DC)
/* {{{ _close_pgsql_link
*/
-static void _close_pgsql_link(zend_resource *rsrc TSRMLS_DC)
+static void _close_pgsql_link(zend_resource *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
@@ -945,7 +944,7 @@ static void _close_pgsql_link(zend_resource *rsrc TSRMLS_DC)
/* {{{ _close_pgsql_plink
*/
-static void _close_pgsql_plink(zend_resource *rsrc TSRMLS_DC)
+static void _close_pgsql_plink(zend_resource *rsrc)
{
PGconn *link = (PGconn *)rsrc->ptr;
PGresult *res;
@@ -965,12 +964,11 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
{
php_pgsql_notice *notice;
- TSRMLS_FETCH();
if (! PGG(ignore_notices)) {
notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
notice->message = _php_pgsql_trim_message(message, &notice->len);
if (PGG(log_notices)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
+ php_error_docref(NULL, E_NOTICE, "%s", notice->message);
}
zend_hash_index_update_ptr(&PGG(notices), (zend_ulong)resource_id, notice);
}
@@ -993,7 +991,7 @@ static void _php_pgsql_notice_ptr_dtor(zval *el)
/* {{{ _rollback_transactions
*/
-static int _rollback_transactions(zval *el TSRMLS_DC)
+static int _rollback_transactions(zval *el)
{
PGconn *link;
PGresult *res;
@@ -1006,7 +1004,7 @@ static int _rollback_transactions(zval *el TSRMLS_DC)
link = (PGconn *) rsrc->ptr;
if (PQ_SETNONBLOCKING(link, 0)) {
- php_error_docref("ref.pgsql" TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref("ref.pgsql", E_NOTICE, "Cannot set connection to blocking mode");
return -1;
}
@@ -1036,7 +1034,7 @@ static int _rollback_transactions(zval *el TSRMLS_DC)
/* {{{ _free_ptr
*/
-static void _free_ptr(zend_resource *rsrc TSRMLS_DC)
+static void _free_ptr(zend_resource *rsrc)
{
pgLofp *lofp = (pgLofp *)rsrc->ptr;
efree(lofp);
@@ -1045,7 +1043,7 @@ static void _free_ptr(zend_resource *rsrc TSRMLS_DC)
/* {{{ _free_result
*/
-static void _free_result(zend_resource *rsrc TSRMLS_DC)
+static void _free_result(zend_resource *rsrc)
{
pgsql_result_handle *pg_result = (pgsql_result_handle *)rsrc->ptr;
@@ -1234,7 +1232,7 @@ PHP_RSHUTDOWN_FUNCTION(pgsql)
/* clean up notice messages */
zend_hash_clean(&PGG(notices));
/* clean up persistent connection */
- zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), (apply_func_t) _rollback_transactions);
return SUCCESS;
}
/* }}} */
@@ -1340,12 +1338,12 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_resource new_le;
if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Cannot create new link. Too many open links (%pd)", PGG(num_links));
goto err;
}
if (PGG(max_persistent) != -1 && PGG(num_persistent) >= PGG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Cannot create new link. Too many open persistent links (%pd)", PGG(num_persistent));
goto err;
}
@@ -1396,7 +1394,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
PQreset(le->ptr);
}
if (le->ptr == NULL || PQstatus(le->ptr) == CONNECTION_BAD) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"PostgreSQL link lost, unable to reconnect");
+ php_error_docref(NULL, E_WARNING,"PostgreSQL link lost, unable to reconnect");
zend_hash_del(&EG(persistent_list), str.s);
goto err;
}
@@ -1430,7 +1428,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
link = (zend_resource *)index_ptr->ptr;
if (link->ptr && (link->type == le_link || link->type == le_plink)) {
- php_pgsql_set_default_link(link TSRMLS_CC);
+ php_pgsql_set_default_link(link);
GC_REFCOUNT(link)++;
RETVAL_RES(link);
goto cleanup;
@@ -1439,7 +1437,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (PGG(max_links) != -1 && PGG(num_links) >= PGG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create new link. Too many open links (%pd)", PGG(num_links));
+ php_error_docref(NULL, E_WARNING, "Cannot create new link. Too many open links (%pd)", PGG(num_links));
goto err;
}
@@ -1455,7 +1453,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
goto err;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection string required for async connections");
+ php_error_docref(NULL, E_WARNING, "Connection string required for async connections");
goto err;
}
} else {
@@ -1488,7 +1486,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (! PGG(ignore_notices) && Z_TYPE_P(return_value) == IS_RESOURCE) {
PQsetNoticeProcessor(pgsql, _php_pgsql_notice_handler, (void*)Z_RES_HANDLE_P(return_value));
}
- php_pgsql_set_default_link(Z_RES_P(return_value) TSRMLS_CC);
+ php_pgsql_set_default_link(Z_RES_P(return_value));
cleanup:
smart_str_free(&str);
@@ -1531,7 +1529,7 @@ PHP_FUNCTION(pg_connect_poll)
PGconn *pgsql;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -1563,7 +1561,7 @@ PHP_FUNCTION(pg_close)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -1610,7 +1608,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
char *msgbuf;
char *result;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -1758,9 +1756,9 @@ PHP_FUNCTION(pg_parameter_status)
char *param;
size_t len;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &param, &len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rs", &pgsql_link, &param, &len) == SUCCESS) {
id = -1;
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &param, &len) == SUCCESS) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &param, &len) == SUCCESS) {
pgsql_link = NULL;
id = FETCH_DEFAULT_LINK();
} else {
@@ -1791,7 +1789,7 @@ PHP_FUNCTION(pg_ping)
PGconn *pgsql;
PGresult *res;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r", &pgsql_link) == SUCCESS) {
id = -1;
} else {
pgsql_link = NULL;
@@ -1835,13 +1833,13 @@ PHP_FUNCTION(pg_query)
pgsql_result_handle *pg_result;
if (argc == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &query_len) == FAILURE) {
return;
}
}
@@ -1853,7 +1851,7 @@ PHP_FUNCTION(pg_query)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -1861,7 +1859,7 @@ PHP_FUNCTION(pg_query)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
pgsql_result = PQexec(pgsql, query);
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
@@ -1938,13 +1936,13 @@ PHP_FUNCTION(pg_query_params)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sa", &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "sa", &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
}
@@ -1956,7 +1954,7 @@ PHP_FUNCTION(pg_query_params)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -1964,7 +1962,7 @@ PHP_FUNCTION(pg_query_params)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr));
@@ -1982,7 +1980,7 @@ PHP_FUNCTION(pg_query_params)
ZVAL_COPY(&tmp_val, tmp);
convert_to_cstring(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -2054,13 +2052,13 @@ PHP_FUNCTION(pg_prepare)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
}
@@ -2072,7 +2070,7 @@ PHP_FUNCTION(pg_prepare)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -2080,7 +2078,7 @@ PHP_FUNCTION(pg_prepare)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
pgsql_result = PQprepare(pgsql, stmtname, query, 0, NULL);
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
@@ -2141,13 +2139,13 @@ PHP_FUNCTION(pg_execute)
pgsql_result_handle *pg_result;
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) {
+ if (zend_parse_parameters(argc, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa/", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(argc, "rsa/", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
return;
}
}
@@ -2159,7 +2157,7 @@ PHP_FUNCTION(pg_execute)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to blocking mode");
RETURN_FALSE;
}
while ((pgsql_result = PQgetResult(pgsql))) {
@@ -2167,7 +2165,7 @@ PHP_FUNCTION(pg_execute)
leftover = 1;
}
if (leftover) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
+ php_error_docref(NULL, E_NOTICE, "Found results on this connection. Use pg_get_result() to get these results first");
}
num_params = zend_hash_num_elements(Z_ARRVAL_P(pv_param_arr));
@@ -2185,7 +2183,7 @@ PHP_FUNCTION(pg_execute)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -2254,7 +2252,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2273,7 +2271,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
#if HAVE_PQCMDTUPLES
RETVAL_LONG(atoi(PQcmdTuples(pgsql_result)));
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported under this build");
+ php_error_docref(NULL, E_WARNING, "Not supported under this build");
RETVAL_LONG(0);
#endif
break;
@@ -2318,7 +2316,7 @@ PHP_FUNCTION(pg_last_notice)
int id = -1;
php_pgsql_notice *notice;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -2338,7 +2336,7 @@ PHP_FUNCTION(pg_last_notice)
/* {{{ get_field_name
*/
-static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC)
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list)
{
PGresult *result;
smart_str str = {0};
@@ -2411,14 +2409,14 @@ PHP_FUNCTION(pg_field_table)
char *table_name;
zend_resource *field_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|b", &result, &fnum, &return_oid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|b", &result, &fnum, &return_oid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, result, -1, "PostgreSQL result", le_result);
if (fnum < 0 || fnum >= PQnfields(pg_result->result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad field offset specified");
RETURN_FALSE;
}
@@ -2502,7 +2500,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
pgsql_result_handle *pg_result;
Oid oid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &field) == FAILURE) {
return;
}
@@ -2511,7 +2509,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
pgsql_result = pg_result->result;
if (field < 0 || field >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad field offset specified");
RETURN_FALSE;
}
@@ -2523,7 +2521,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
RETURN_LONG(PQfsize(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_TYPE: {
- char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list) TSRMLS_CC);
+ char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list));
RETVAL_STRING(name);
efree(name);
}
@@ -2591,7 +2589,7 @@ PHP_FUNCTION(pg_field_num)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result, &field, &field_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result, &field, &field_len) == FAILURE) {
return;
}
@@ -2614,11 +2612,11 @@ PHP_FUNCTION(pg_fetch_result)
int field_offset, pgsql_row, argc = ZEND_NUM_ARGS();
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "rz", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz", &result, &field) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rlz", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rlz", &result, &row, &field) == FAILURE) {
return;
}
}
@@ -2636,7 +2634,7 @@ PHP_FUNCTION(pg_fetch_result)
}
} else {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -2646,14 +2644,14 @@ PHP_FUNCTION(pg_fetch_result)
case IS_STRING:
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
default:
convert_to_long_ex(field);
if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
field_offset = (int)Z_LVAL_P(field);
@@ -2684,21 +2682,21 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (into_object) {
zend_string *class_name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!Sz", &result, &zrow, &class_name, &ctor_params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!Sz", &result, &zrow, &class_name, &ctor_params) == FAILURE) {
return;
}
if (!class_name) {
ce = zend_standard_class_def;
} else {
- ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
+ ce = zend_fetch_class(class_name, ZEND_FETCH_CLASS_AUTO);
}
if (!ce) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name->val);
+ php_error_docref(NULL, E_WARNING, "Could not find class '%s'", class_name->val);
return;
}
result_type = PGSQL_ASSOC;
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l", &result, &zrow, &result_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!l", &result, &zrow, &result_type) == FAILURE) {
return;
}
}
@@ -2708,14 +2706,14 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
convert_to_long(zrow);
row = Z_LVAL_P(zrow);
if (row < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The row parameter must be greater or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The row parameter must be greater or equal to zero");
RETURN_FALSE;
}
}
use_row = ZEND_NUM_ARGS() > 1 && row != -1;
if (!(result_type & PGSQL_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
@@ -2725,7 +2723,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
if (use_row) {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -2780,7 +2778,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
*Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset);
efree(Z_ARR(dataset));
} else {
- zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC);
+ zend_merge_properties(return_value, Z_ARRVAL(dataset));
zval_ptr_dtor(&dataset);
}
@@ -2796,14 +2794,14 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fci.no_separation = 1;
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
- if (zend_fcall_info_args(&fci, ctor_params TSRMLS_CC) == FAILURE) {
+ if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {
/* Two problems why we throw exceptions here: PHP is typeless
* and hence passing one argument that's not an array could be
* by mistake and the other way round is possible, too. The
* single value is an array. Also we'd have to make that one
* argument passed by reference.
*/
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
return;
}
}
@@ -2814,8 +2812,8 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
+ if (zend_call_function(&fci, &fcc) == FAILURE) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
} else {
zval_ptr_dtor(&retval);
}
@@ -2823,7 +2821,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
efree(fci.params);
}
} else if (ctor_params) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
}
}
}
@@ -2875,7 +2873,7 @@ PHP_FUNCTION(pg_fetch_all)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -2883,7 +2881,7 @@ PHP_FUNCTION(pg_fetch_all)
pgsql_result = pg_result->result;
array_init(return_value);
- if (php_pgsql_result2array(pgsql_result, return_value TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_result2array(pgsql_result, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2901,7 +2899,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
int pg_numrows, pg_row;
size_t num_fields;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result, &colno) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result, &colno) == FAILURE) {
RETURN_FALSE;
}
@@ -2911,7 +2909,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
num_fields = PQnfields(pgsql_result);
if (colno >= (zend_long)num_fields || colno < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%pd'", colno);
+ php_error_docref(NULL, E_WARNING, "Invalid column number '%pd'", colno);
RETURN_FALSE;
}
@@ -2939,7 +2937,7 @@ PHP_FUNCTION(pg_result_seek)
zend_long row;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &row) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result, &row) == FAILURE) {
return;
}
@@ -2969,11 +2967,11 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
int field_offset, pgsql_row, argc = ZEND_NUM_ARGS();
if (argc == 2) {
- if (zend_parse_parameters(argc TSRMLS_CC, "rz", &result, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rz", &result, &field) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rlz", &result, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(argc, "rlz", &result, &row, &field) == FAILURE) {
return;
}
}
@@ -2991,7 +2989,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
} else {
if (row < 0 || row >= PQntuples(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
+ php_error_docref(NULL, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
@@ -3003,14 +3001,14 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
convert_to_string_ex(field);
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
break;
default:
convert_to_long_ex(field);
if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Bad column offset specified");
RETURN_FALSE;
}
field_offset = (int)Z_LVAL_P(field);
@@ -3051,7 +3049,7 @@ PHP_FUNCTION(pg_free_result)
zval *result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -3075,7 +3073,7 @@ PHP_FUNCTION(pg_last_oid)
Oid oid;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) {
return;
}
@@ -3110,7 +3108,7 @@ PHP_FUNCTION(pg_trace)
php_stream *stream;
id = FETCH_DEFAULT_LINK();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
return;
}
@@ -3148,7 +3146,7 @@ PHP_FUNCTION(pg_untrace)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3176,7 +3174,7 @@ PHP_FUNCTION(pg_lo_create)
Oid pgsql_oid, wanted_oid = InvalidOid;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "|zz", &pgsql_link, &oid) == FAILURE) {
+ if (zend_parse_parameters(argc, "|zz", &pgsql_link, &oid) == FAILURE) {
return;
}
@@ -3197,7 +3195,7 @@ PHP_FUNCTION(pg_lo_create)
if (oid) {
#ifndef HAVE_PG_LO_CREATE
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Passing OID value is not supported. Upgrade your PostgreSQL");
+ php_error_docref(NULL, E_NOTICE, "Passing OID value is not supported. Upgrade your PostgreSQL");
#else
switch (Z_TYPE_P(oid)) {
case IS_STRING:
@@ -3206,24 +3204,24 @@ PHP_FUNCTION(pg_lo_create)
wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10);
if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
}
break;
case IS_LONG:
if (Z_LVAL_P(oid) < (zend_long)InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
wanted_oid = (Oid)Z_LVAL_P(oid);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
if ((pgsql_oid = lo_create(pgsql, wanted_oid)) == InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
}
@@ -3232,7 +3230,7 @@ PHP_FUNCTION(pg_lo_create)
}
if ((pgsql_oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
}
@@ -3254,38 +3252,38 @@ PHP_FUNCTION(pg_lo_unlink)
int argc = ZEND_NUM_ARGS();
/* accept string type since Oid type is unsigned int */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rs", &pgsql_link, &oid_string, &oid_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rl", &pgsql_link, &oid_long) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"s", &oid_string, &oid_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"l", &oid_long) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID is specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID is specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
@@ -3293,7 +3291,7 @@ PHP_FUNCTION(pg_lo_unlink)
CHECK_DEFAULT_LINK(id);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 1 or 2 arguments");
RETURN_FALSE;
}
if (pgsql_link == NULL && id == -1) {
@@ -3303,7 +3301,7 @@ PHP_FUNCTION(pg_lo_unlink)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (lo_unlink(pgsql, oid) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete PostgreSQL large object %u", oid);
+ php_error_docref(NULL, E_WARNING, "Unable to delete PostgreSQL large object %u", oid);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -3326,38 +3324,38 @@ PHP_FUNCTION(pg_lo_open)
int argc = ZEND_NUM_ARGS();
/* accept string type since Oid is unsigned int */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rss", &pgsql_link, &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rls", &pgsql_link, &oid_long, &mode_string, &mode_strlen) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"ss", &oid_string, &oid_strlen, &mode_string, &mode_strlen) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"ls", &oid_long, &mode_string, &mode_strlen) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
@@ -3365,7 +3363,7 @@ PHP_FUNCTION(pg_lo_open)
CHECK_DEFAULT_LINK(id);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 1 or 2 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 1 or 2 arguments");
RETURN_FALSE;
}
if (pgsql_link == NULL && id == -1) {
@@ -3399,17 +3397,17 @@ PHP_FUNCTION(pg_lo_open)
if (create) {
if ((oid = lo_creat(pgsql, INV_READ|INV_WRITE)) == 0) {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to create PostgreSQL large object");
RETURN_FALSE;
} else {
if ((pgsql_lofd = lo_open(pgsql, oid, pgsql_mode)) == -1) {
if (lo_unlink(pgsql, oid) == -1) {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Something is really messed up! Your database is badly corrupted in a way NOT related to PHP");
+ php_error_docref(NULL, E_WARNING, "Something is really messed up! Your database is badly corrupted in a way NOT related to PHP");
RETURN_FALSE;
}
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to open PostgreSQL large object");
RETURN_FALSE;
} else {
pgsql_lofp->conn = pgsql;
@@ -3419,7 +3417,7 @@ PHP_FUNCTION(pg_lo_open)
}
} else {
efree(pgsql_lofp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open PostgreSQL large object");
+ php_error_docref(NULL, E_WARNING, "Unable to open PostgreSQL large object");
RETURN_FALSE;
}
} else {
@@ -3437,14 +3435,14 @@ PHP_FUNCTION(pg_lo_close)
zval *pgsql_lofp;
pgLofp *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_lofp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_lofp) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp);
if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd);
+ php_error_docref(NULL, E_WARNING, "Unable to close PostgreSQL large object descriptor %d", pgsql->lofd);
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -3468,7 +3466,7 @@ PHP_FUNCTION(pg_lo_read)
zend_string *buf;
pgLofp *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &pgsql_id, &len) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &pgsql_id, &len) == FAILURE) {
return;
}
@@ -3502,17 +3500,17 @@ PHP_FUNCTION(pg_lo_write)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &pgsql_id, &str, &str_len, &z_len) == FAILURE) {
return;
}
if (argc > 2) {
if (z_len > (zend_long)str_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
+ php_error_docref(NULL, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
RETURN_FALSE;
}
if (z_len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len);
+ php_error_docref(NULL, E_WARNING, "Buffer size must be larger than 0, but %pd was specified", z_len);
RETURN_FALSE;
}
len = z_len;
@@ -3541,7 +3539,7 @@ PHP_FUNCTION(pg_lo_read_all)
char buf[PGSQL_LO_READ_BUF_SIZE];
pgLofp *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_id) == FAILURE) {
return;
}
@@ -3568,25 +3566,25 @@ PHP_FUNCTION(pg_lo_import)
PGconn *pgsql;
Oid returned_oid;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rp|z", &pgsql_link, &file_in, &name_len, &oid) == SUCCESS) {
;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"p|z", &file_in, &name_len, &oid) == SUCCESS) {
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
/* old calling convention, deprecated since PHP 4.2 */
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"pr", &file_in, &name_len, &pgsql_link ) == SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
+ php_error_docref(NULL, E_NOTICE, "Old API is used");
}
else {
WRONG_PARAM_COUNT;
}
- if (php_check_open_basedir(file_in TSRMLS_CC)) {
+ if (php_check_open_basedir(file_in)) {
RETURN_FALSE;
}
@@ -3598,7 +3596,7 @@ PHP_FUNCTION(pg_lo_import)
if (oid) {
#ifndef HAVE_PG_LO_IMPORT_WITH_OID
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "OID value passing not supported");
+ php_error_docref(NULL, E_NOTICE, "OID value passing not supported");
#else
Oid wanted_oid;
switch (Z_TYPE_P(oid)) {
@@ -3608,20 +3606,20 @@ PHP_FUNCTION(pg_lo_import)
wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10);
if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
}
break;
case IS_LONG:
if (Z_LVAL_P(oid) < (zend_long)InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
wanted_oid = (Oid)Z_LVAL_P(oid);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "invalid OID value passed");
+ php_error_docref(NULL, E_NOTICE, "invalid OID value passed");
RETURN_FALSE;
}
@@ -3659,68 +3657,68 @@ PHP_FUNCTION(pg_lo_export)
int argc = ZEND_NUM_ARGS();
/* allow string to handle large OID value correctly */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rlp", &pgsql_link, &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"rss", &pgsql_link, &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"lp", &oid_long, &file_out, &name_len) == SUCCESS) {
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"sp", &oid_string, &oid_strlen, &file_out, &name_len) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"spr", &oid_string, &oid_strlen, &file_out, &name_len, &pgsql_link) == SUCCESS) {
oid = (Oid)strtoul(oid_string, &end_ptr, 10);
if ((oid_string+oid_strlen) != end_ptr) {
/* wrong integer format */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
+ php_error_docref(NULL, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
}
- else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
+ else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc,
"lpr", &oid_long, &file_out, &name_len, &pgsql_link) == SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Old API is used");
+ php_error_docref(NULL, E_NOTICE, "Old API is used");
if (oid_long <= InvalidOid) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid OID specified");
+ php_error_docref(NULL, E_NOTICE, "Invalid OID specified");
RETURN_FALSE;
}
oid = (Oid)oid_long;
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires 2 or 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Requires 2 or 3 arguments");
RETURN_FALSE;
}
- if (php_check_open_basedir(file_out TSRMLS_CC)) {
+ if (php_check_open_basedir(file_out)) {
RETURN_FALSE;
}
@@ -3746,11 +3744,11 @@ PHP_FUNCTION(pg_lo_seek)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &pgsql_id, &offset, &whence) == FAILURE) {
return;
}
if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid whence parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid whence parameter");
return;
}
@@ -3782,7 +3780,7 @@ PHP_FUNCTION(pg_lo_tell)
pgLofp *pgsql;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r", &pgsql_id) == FAILURE) {
+ if (zend_parse_parameters(argc, "r", &pgsql_id) == FAILURE) {
return;
}
@@ -3812,7 +3810,7 @@ PHP_FUNCTION(pg_lo_truncate)
int argc = ZEND_NUM_ARGS();
int result;
- if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_id, &size) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl", &pgsql_id, &size) == FAILURE) {
return;
}
@@ -3847,13 +3845,13 @@ PHP_FUNCTION(pg_set_error_verbosity)
PGconn *pgsql;
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "l", &verbosity) == FAILURE) {
+ if (zend_parse_parameters(argc, "l", &verbosity) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_link, &verbosity) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl", &pgsql_link, &verbosity) == FAILURE) {
return;
}
}
@@ -3885,13 +3883,13 @@ PHP_FUNCTION(pg_set_client_encoding)
PGconn *pgsql;
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s", &encoding, &encoding_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) {
return;
}
}
@@ -3914,7 +3912,7 @@ PHP_FUNCTION(pg_client_encoding)
int id = -1, argc = ZEND_NUM_ARGS();
PGconn *pgsql;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3949,7 +3947,7 @@ PHP_FUNCTION(pg_end_copy)
PGconn *pgsql;
int result = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(argc, "|r", &pgsql_link) == FAILURE) {
return;
}
@@ -3986,13 +3984,13 @@ PHP_FUNCTION(pg_put_line)
int result = 0, argc = ZEND_NUM_ARGS();
if (argc == 1) {
- if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s", &query, &query_len) == FAILURE) {
return;
}
id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
- if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
return;
}
}
@@ -4032,7 +4030,7 @@ PHP_FUNCTION(pg_copy_to)
int ret;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|ss",
+ if (zend_parse_parameters(argc, "rs|ss",
&pgsql_link, &table_name, &table_name_len,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
@@ -4164,7 +4162,7 @@ PHP_FUNCTION(pg_copy_from)
ExecStatusType status;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|ss",
+ if (zend_parse_parameters(argc, "rsa|ss",
&pgsql_link, &table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
@@ -4283,7 +4281,7 @@ PHP_FUNCTION(pg_escape_string)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &from) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &from) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4291,7 +4289,7 @@ PHP_FUNCTION(pg_escape_string)
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rS", &pgsql_link, &from) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS", &pgsql_link, &from) == FAILURE) {
return;
}
break;
@@ -4328,7 +4326,7 @@ PHP_FUNCTION(pg_escape_bytea)
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &from, &from_len) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4336,7 +4334,7 @@ PHP_FUNCTION(pg_escape_bytea)
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
break;
@@ -4468,7 +4466,7 @@ PHP_FUNCTION(pg_unescape_bytea)
char *from = NULL, *to = NULL, *tmp = NULL;
size_t to_len;
size_t from_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&from, &from_len) == FAILURE) {
return;
}
@@ -4481,7 +4479,7 @@ PHP_FUNCTION(pg_unescape_bytea)
to = (char *)php_pgsql_unescape_bytea((unsigned char*)from, &to_len);
#endif
if (!to) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invalid parameter");
+ php_error_docref(NULL, E_WARNING,"Invalid parameter");
RETURN_FALSE;
}
RETVAL_STRINGL(to, to_len);
@@ -4501,7 +4499,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
switch (ZEND_NUM_ARGS()) {
case 1:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &from, &from_len) == FAILURE) {
return;
}
pgsql_link = NULL;
@@ -4509,20 +4507,20 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
break;
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &from, &from_len) == FAILURE) {
return;
}
break;
}
if (pgsql_link == NULL && id == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link");
+ php_error_docref(NULL, E_WARNING,"Cannot get default pgsql link");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (pgsql == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get pgsql link");
+ php_error_docref(NULL, E_WARNING,"Cannot get pgsql link");
RETURN_FALSE;
}
@@ -4532,7 +4530,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
tmp = PGSQLescapeIdentifier(pgsql, from, (size_t)from_len);
}
if (!tmp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
+ php_error_docref(NULL, E_WARNING,"Failed to escape");
RETURN_FALSE;
}
@@ -4567,7 +4565,7 @@ PHP_FUNCTION(pg_result_error)
pgsql_result_handle *pg_result;
char *err = NULL;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&result) == FAILURE) {
RETURN_FALSE;
}
@@ -4594,7 +4592,7 @@ PHP_FUNCTION(pg_result_error_field)
pgsql_result_handle *pg_result;
char *field = NULL;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "rl",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rl",
&result, &fieldcode) == FAILURE) {
RETURN_FALSE;
}
@@ -4636,7 +4634,7 @@ PHP_FUNCTION(pg_connection_status)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4657,7 +4655,7 @@ PHP_FUNCTION(pg_transaction_status)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4678,7 +4676,7 @@ PHP_FUNCTION(pg_connection_reset)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4698,13 +4696,13 @@ PHP_FUNCTION(pg_connection_reset)
/* {{{ php_pgsql_flush_query
*/
-static int php_pgsql_flush_query(PGconn *pgsql TSRMLS_DC)
+static int php_pgsql_flush_query(PGconn *pgsql)
{
PGresult *res;
int leftover = 0;
if (PQ_SETNONBLOCKING(pgsql, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,"Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE,"Cannot set connection to nonblocking mode");
return -1;
}
while ((res = PQgetResult(pgsql))) {
@@ -4725,7 +4723,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
PGconn *pgsql;
PGresult *pgsql_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -4733,7 +4731,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (PQ_SETNONBLOCKING(pgsql, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
switch(entry_type) {
@@ -4748,11 +4746,11 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "PostgreSQL module error, please report this error");
+ php_error_docref(NULL, E_ERROR, "PostgreSQL module error, please report this error");
break;
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
convert_to_boolean_ex(return_value);
}
@@ -4797,7 +4795,7 @@ PHP_FUNCTION(pg_send_query)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &len) == FAILURE) {
return;
}
@@ -4806,12 +4804,12 @@ PHP_FUNCTION(pg_send_query)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -4833,14 +4831,14 @@ PHP_FUNCTION(pg_send_query)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -4869,7 +4867,7 @@ PHP_FUNCTION(pg_send_query_params)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
@@ -4882,12 +4880,12 @@ PHP_FUNCTION(pg_send_query_params)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -4905,7 +4903,7 @@ PHP_FUNCTION(pg_send_query_params)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -4939,14 +4937,14 @@ PHP_FUNCTION(pg_send_query_params)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -4974,7 +4972,7 @@ PHP_FUNCTION(pg_send_prepare)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
@@ -4987,12 +4985,12 @@ PHP_FUNCTION(pg_send_prepare)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -5015,13 +5013,13 @@ PHP_FUNCTION(pg_send_prepare)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -5052,7 +5050,7 @@ PHP_FUNCTION(pg_send_execute)
int is_non_blocking;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
return;
}
@@ -5065,12 +5063,12 @@ PHP_FUNCTION(pg_send_execute)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
if (_php_pgsql_link_has_results(pgsql)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"There are results on this connection. Call pg_get_result() until it returns FALSE");
}
@@ -5088,7 +5086,7 @@ PHP_FUNCTION(pg_send_execute)
ZVAL_COPY(&tmp_val, tmp);
convert_to_string(&tmp_val);
if (Z_TYPE(tmp_val) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter");
+ php_error_docref(NULL, E_WARNING,"Error converting parameter");
zval_ptr_dtor(&tmp_val);
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
@@ -5122,13 +5120,13 @@ PHP_FUNCTION(pg_send_execute)
/* Wait to finish sending buffer */
while ((ret = PQflush(pgsql))) {
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not empty PostgreSQL send buffer");
+ php_error_docref(NULL, E_NOTICE, "Could not empty PostgreSQL send buffer");
break;
}
usleep(10000);
}
if (PQ_SETNONBLOCKING(pgsql, 0) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
}
}
@@ -5153,7 +5151,7 @@ PHP_FUNCTION(pg_get_result)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -5182,7 +5180,7 @@ PHP_FUNCTION(pg_result_status)
PGresult *pgsql_result;
pgsql_result_handle *pg_result;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l",
&result, &result_type) == FAILURE) {
RETURN_FALSE;
}
@@ -5198,7 +5196,7 @@ PHP_FUNCTION(pg_result_status)
RETURN_STRING(PQcmdStatus(pgsql_result));
}
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Optional 2nd parameter should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING");
+ php_error_docref(NULL, E_WARNING, "Optional 2nd parameter should be PGSQL_STATUS_LONG or PGSQL_STATUS_STRING");
RETURN_FALSE;
}
}
@@ -5214,7 +5212,7 @@ PHP_FUNCTION(pg_get_notify)
PGconn *pgsql;
PGnotify *pgsql_notify;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l",
&pgsql_link, &result_type) == FAILURE) {
RETURN_FALSE;
}
@@ -5222,7 +5220,7 @@ PHP_FUNCTION(pg_get_notify)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
if (!(result_type & PGSQL_BOTH)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type");
+ php_error_docref(NULL, E_WARNING, "Invalid result type");
RETURN_FALSE;
}
@@ -5271,7 +5269,7 @@ PHP_FUNCTION(pg_get_pid)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r",
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r",
&pgsql_link) == FAILURE) {
RETURN_FALSE;
}
@@ -5282,31 +5280,31 @@ PHP_FUNCTION(pg_get_pid)
}
/* }}} */
-static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return 0;
}
/* }}} */
-static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
return 0;
}
/* }}} */
-static int php_pgsql_fd_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_close(php_stream *stream, int close_handle) /* {{{ */
{
return EOF;
}
/* }}} */
-static int php_pgsql_fd_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_flush(php_stream *stream) /* {{{ */
{
return FAILURE;
}
/* }}} */
-static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam) /* {{{ */
{
PGconn *pgsql = (PGconn *) stream->abstract;
switch (option) {
@@ -5318,7 +5316,7 @@ static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, vo
}
/* }}} */
-static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret TSRMLS_DC) /* {{{ */
+static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret) /* {{{ */
{
PGconn *pgsql = (PGconn *) stream->abstract;
int fd_number;
@@ -5351,7 +5349,7 @@ PHP_FUNCTION(pg_socket)
PGconn *pgsql;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5376,7 +5374,7 @@ PHP_FUNCTION(pg_consume_input)
int id = -1;
PGconn *pgsql;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5396,7 +5394,7 @@ PHP_FUNCTION(pg_flush)
int ret;
int is_non_blocking;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pgsql_link) == FAILURE) {
return;
}
@@ -5405,14 +5403,14 @@ PHP_FUNCTION(pg_flush)
is_non_blocking = PQisnonblocking(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 1) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot set connection to nonblocking mode");
+ php_error_docref(NULL, E_NOTICE, "Cannot set connection to nonblocking mode");
RETURN_FALSE;
}
ret = PQflush(pgsql);
if (is_non_blocking == 0 && PQ_SETNONBLOCKING(pgsql, 0) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed resetting connection to blocking mode");
+ php_error_docref(NULL, E_NOTICE, "Failed resetting connection to blocking mode");
}
switch (ret) {
@@ -5426,7 +5424,7 @@ PHP_FUNCTION(pg_flush)
/* {{{ php_pgsql_meta_data
* TODO: Add meta_data cache for better performance
*/
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended)
{
PGresult *pg_result;
char *src, *tmp_name, *tmp_name2 = NULL;
@@ -5437,7 +5435,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
zval elem;
if (!*table_name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified");
+ php_error_docref(NULL, E_WARNING, "The table name must be specified");
return FAILURE;
}
@@ -5490,7 +5488,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
pg_result = PQexec(pg_link, querystr.s->val);
if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Table '%s' doesn't exists", table_name);
+ php_error_docref(NULL, E_WARNING, "Table '%s' doesn't exists", table_name);
smart_str_free(&querystr);
PQclear(pg_result);
return FAILURE;
@@ -5544,7 +5542,7 @@ PHP_FUNCTION(pg_meta_data)
PGconn *pgsql;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|b",
&pgsql_link, &table_name, &table_name_len, &extended) == FAILURE) {
return;
}
@@ -5552,7 +5550,7 @@ PHP_FUNCTION(pg_meta_data)
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
array_init(return_value);
- if (php_pgsql_meta_data(pgsql, table_name, return_value, extended TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_meta_data(pgsql, table_name, return_value, extended) == FAILURE) {
zval_dtor(return_value); /* destroy array */
RETURN_FALSE;
}
@@ -5652,7 +5650,7 @@ static php_pgsql_data_type php_pgsql_get_data_type(const char *type_name, size_t
/* {{{ php_pgsql_convert_match
* test field value with regular expression specified.
*/
-static int php_pgsql_convert_match(const char *str, size_t str_len, const char *regex , int icase TSRMLS_DC)
+static int php_pgsql_convert_match(const char *str, size_t str_len, const char *regex , int icase)
{
regex_t re;
regmatch_t *subs;
@@ -5675,7 +5673,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
regerr = regcomp(&re, regex, regopt);
if (regerr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex");
+ php_error_docref(NULL, E_WARNING, "Cannot compile regex");
regfree(&re);
return FAILURE;
}
@@ -5684,12 +5682,12 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
if (regerr == REG_NOMATCH) {
#ifdef PHP_DEBUG
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex);
+ php_error_docref(NULL, E_NOTICE, "'%s' does not match with '%s'", str, regex);
#endif
ret = FAILURE;
}
else if (regerr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot exec regex");
+ php_error_docref(NULL, E_WARNING, "Cannot exec regex");
ret = FAILURE;
}
regfree(&re);
@@ -5702,7 +5700,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
/* {{{ php_pgsql_add_quote
* add quotes around string.
*/
-static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
+static int php_pgsql_add_quotes(zval *src, zend_bool should_free)
{
smart_str str = {0};
@@ -5733,7 +5731,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
} \
/* raise error if it's not null and cannot be ignored */ \
else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_TYPE_P(not_null) == IS_TRUE) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field->val); \
+ php_error_docref(NULL, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field->val); \
err = 1; \
} \
}
@@ -5741,7 +5739,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC)
/* {{{ php_pgsql_convert
* check and convert array values (fieldname=>vlaue pair) for sql
*/
-PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt)
{
zend_string *field = NULL;
zend_ulong num_idx = -1;
@@ -5760,7 +5758,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
array_init(&meta);
/* table_name is escaped by php_pgsql_meta_data */
- if (php_pgsql_meta_data(pg_link, table_name, &meta, 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_meta_data(pg_link, table_name, &meta, 0) == FAILURE) {
zval_ptr_dtor(&meta);
return FAILURE;
}
@@ -5770,32 +5768,32 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_NULL(&new_val);
if (!err && field == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Accepts only string key for values");
+ php_error_docref(NULL, E_WARNING, "Accepts only string key for values");
err = 1;
}
if (!err && (def = zend_hash_find(Z_ARRVAL(meta), field)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid field name (%s) in values", field->val);
+ php_error_docref(NULL, E_NOTICE, "Invalid field name (%s) in values", field->val);
err = 1;
}
if (!err && (type = zend_hash_str_find(Z_ARRVAL_P(def), "type", sizeof("type") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'type'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'type'");
err = 1;
}
if (!err && (not_null = zend_hash_str_find(Z_ARRVAL_P(def), "not null", sizeof("not null") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'not null'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'not null'");
err = 1;
}
if (!err && (has_default = zend_hash_str_find(Z_ARRVAL_P(def), "has default", sizeof("has default") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'has default'");
err = 1;
}
if (!err && (is_enum = zend_hash_str_find(Z_ARRVAL_P(def), "is enum", sizeof("is enum") - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'is enum'");
+ php_error_docref(NULL, E_NOTICE, "Detected broken meta data. Missing 'is enum'");
err = 1;
}
if (!err && (Z_TYPE_P(val) == IS_ARRAY || Z_TYPE_P(val) == IS_OBJECT)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scalar values as field values");
+ php_error_docref(NULL, E_NOTICE, "Expects scalar values as field values");
err = 1;
}
if (err) {
@@ -5834,7 +5832,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "'f'", sizeof("'f'")-1);
}
else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_P(val), Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Detected invalid value (%s) for PostgreSQL %s field (%s)", Z_STRVAL_P(val), Z_STRVAL_P(type), field->val);
err = 1;
}
}
@@ -5866,7 +5864,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5881,7 +5879,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([+-]{0,1}[0-9]+)$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([+-]{0,1}[0-9]+)$", 0) == FAILURE) {
err = 1;
}
else {
@@ -5908,7 +5906,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for pgsql '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for pgsql '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5923,7 +5921,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0) == FAILURE) {
err = 1;
}
else {
@@ -5949,7 +5947,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -5989,7 +5987,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
str->len = PQescapeStringConn(pg_link, str->val, Z_STRVAL_P(val), Z_STRLEN_P(val), NULL);
str = zend_string_realloc(str, str->len, 0);
ZVAL_NEW_STR(&new_val, str);
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
break;
@@ -6012,7 +6010,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6026,7 +6024,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[0-9]+$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^[0-9]+$", 0) == FAILURE) {
err = 1;
}
else {
@@ -6054,7 +6052,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6067,12 +6065,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* better regex? IPV6 and IPV4 */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", 0 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", 0) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6086,7 +6084,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6101,11 +6099,11 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "NOW()", sizeof("NOW()")-1);
} else {
/* better regex? */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1) == FAILURE) {
err = 1;
} else {
ZVAL_STRING(&new_val, Z_STRVAL_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6119,7 +6117,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6131,12 +6129,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6150,7 +6148,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6162,12 +6160,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
else {
/* FIXME: better regex must be used */
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6181,7 +6179,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6241,12 +6239,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
"(([0-9]{1,2}:){0,2}[0-9]{0,2})" /* hh:[mm:[ss]] */
")?))"
"([ \\t]+ago)?$",
- 1 TSRMLS_CC) == FAILURE) {
+ 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRING(&new_val, Z_STRVAL_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6260,7 +6258,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
#ifdef HAVE_PQESCAPE
@@ -6281,7 +6279,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
#endif
ZVAL_STRINGL(&new_val, (char *)tmp, to_len - 1); /* PQescapeBytea's to_len includes additional '\0' */
PQfreemem(tmp);
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
smart_str_appendl(&s, Z_STRVAL(new_val), Z_STRLEN(new_val));
smart_str_0(&s);
zval_ptr_dtor(&new_val);
@@ -6308,7 +6306,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_P(type), field->val);
}
break;
@@ -6320,12 +6318,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
ZVAL_STRINGL(&new_val, "NULL", sizeof("NULL")-1);
}
else {
- if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1 TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert_match(Z_STRVAL_P(val), Z_STRLEN_P(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1) == FAILURE) {
err = 1;
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- php_pgsql_add_quotes(&new_val, 1 TSRMLS_CC);
+ php_pgsql_add_quotes(&new_val, 1);
}
}
break;
@@ -6339,13 +6337,13 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_P(type), field->val);
}
break;
default:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or system data type '%s' for '%s'. Report error", Z_STRVAL_P(type), field->val);
+ php_error_docref(NULL, E_NOTICE, "Unknown or system data type '%s' for '%s'. Report error", Z_STRVAL_P(type), field->val);
err = 1;
break;
} /* switch */
@@ -6389,33 +6387,33 @@ PHP_FUNCTION(pg_convert)
PGconn *pg_link;
int id = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(),
"rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) {
return;
}
if (option & ~PGSQL_CONV_OPTS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
if (!table_name_len) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Table name is invalid");
+ php_error_docref(NULL, E_NOTICE, "Table name is invalid");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
array_init(return_value);
- if (php_pgsql_convert(pg_link, table_name, values, return_value, option TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table_name, values, return_value, option) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong opt TSRMLS_DC) /* {{{ */
+static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong opt) /* {{{ */
{
if (opt & PGSQL_DML_ASYNC) {
if (PQsendQuery(pg_link, querystr->s->val)) {
@@ -6430,7 +6428,7 @@ static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong
PQclear(pg_result);
return 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", PQresultErrorMessage(pg_result));
+ php_error_docref(NULL, E_WARNING, "%s", PQresultErrorMessage(pg_result));
PQclear(pg_result);
}
}
@@ -6474,7 +6472,7 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
/* {{{ php_pgsql_insert
*/
-PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var_array, zend_ulong opt, zend_string **sql)
{
zval *val, converted;
char buf[256];
@@ -6500,7 +6498,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
/* convert input array if needed */
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&converted);
- if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, var_array, &converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
var_array = &converted;
@@ -6512,7 +6510,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(var_array), num_idx, fld) {
if (fld == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted");
+ php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted");
goto cleanup;
}
if (opt & PGSQL_DML_ESCAPE) {
@@ -6555,7 +6553,7 @@ PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *var
smart_str_appendl(&querystr, "NULL", sizeof("NULL")-1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects scaler values. type = %d", Z_TYPE_P(val));
+ php_error_docref(NULL, E_WARNING, "Expects scaler values. type = %d", Z_TYPE_P(val));
goto cleanup;
break;
}
@@ -6570,7 +6568,7 @@ no_values:
smart_str_0(&querystr);
if ((opt & (PGSQL_DML_EXEC|PGSQL_DML_ASYNC)) &&
- do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == 0) {
+ do_exec(&querystr, PGRES_COMMAND_OK, pg_link, (opt & PGSQL_CONV_OPTS)) == 0) {
ret = SUCCESS;
}
else if (opt & PGSQL_DML_STRING) {
@@ -6604,25 +6602,25 @@ PHP_FUNCTION(pg_insert)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &values, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
return_sql = option & PGSQL_DML_STRING;
if (option & PGSQL_DML_EXEC) {
/* return resource when executed */
option = option & ~PGSQL_DML_EXEC;
- if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_insert(pg_link, table, values, option|PGSQL_DML_STRING, &sql) == FAILURE) {
RETURN_FALSE;
}
pg_result = PQexec(pg_link, sql->val);
@@ -6663,7 +6661,7 @@ PHP_FUNCTION(pg_insert)
}
break;
}
- } else if (php_pgsql_insert(pg_link, table, values, option, &sql TSRMLS_CC) == FAILURE) {
+ } else if (php_pgsql_insert(pg_link, table, values, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (return_sql) {
@@ -6674,7 +6672,7 @@ PHP_FUNCTION(pg_insert)
}
/* }}} */
-static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, zend_ulong opt TSRMLS_DC) /* {{{ */
+static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len, zend_ulong opt) /* {{{ */
{
char *tmp;
char buf[256];
@@ -6684,7 +6682,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
ZEND_HASH_FOREACH_KEY_VAL(ht, num_idx, fld, val) {
if (fld == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted");
+ php_error_docref(NULL, E_NOTICE, "Expects associative array for values to be inserted");
return -1;
}
if (opt & PGSQL_DML_ESCAPE) {
@@ -6724,7 +6722,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
smart_str_appendl(querystr, "NULL", sizeof("NULL")-1);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects scaler values. type=%d", Z_TYPE_P(val));
+ php_error_docref(NULL, E_WARNING, "Expects scaler values. type=%d", Z_TYPE_P(val));
return -1;
}
smart_str_appendl(querystr, pad, pad_len);
@@ -6739,7 +6737,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
/* {{{ php_pgsql_update
*/
-PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var_array, zval *ids_array, zend_ulong opt, zend_string **sql)
{
zval var_converted, ids_converted;
smart_str querystr = {0};
@@ -6760,12 +6758,12 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&var_converted);
- if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, var_array, &var_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
var_array = &var_converted;
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6775,18 +6773,18 @@ PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *var
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " SET ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(var_array), 0, ",", 1, opt))
goto cleanup;
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
smart_str_0(&querystr);
- if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) {
+ if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
ret = SUCCESS;
} else if (opt & PGSQL_DML_STRING) {
ret = SUCCESS;
@@ -6817,21 +6815,21 @@ PHP_FUNCTION(pg_update)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsaa|l",
+ if (zend_parse_parameters(argc, "rsaa|l",
&pgsql_link, &table, &table_len, &values, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
- if (php_pgsql_update(pg_link, table, values, ids, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_update(pg_link, table, values, ids, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (option & PGSQL_DML_STRING) {
@@ -6843,7 +6841,7 @@ PHP_FUNCTION(pg_update)
/* {{{ php_pgsql_delete
*/
-PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids_array, zend_ulong opt, zend_string **sql)
{
zval ids_converted;
smart_str querystr = {0};
@@ -6861,7 +6859,7 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6871,13 +6869,13 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
smart_str_0(&querystr);
- if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt TSRMLS_CC) == 0) {
+ if ((opt & PGSQL_DML_EXEC) && do_exec(&querystr, PGRES_COMMAND_OK, pg_link, opt) == 0) {
ret = SUCCESS;
} else if (opt & PGSQL_DML_STRING) {
ret = SUCCESS;
@@ -6907,21 +6905,21 @@ PHP_FUNCTION(pg_delete)
zend_string *sql;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
- if (php_pgsql_delete(pg_link, table, ids, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_delete(pg_link, table, ids, option, &sql) == FAILURE) {
RETURN_FALSE;
}
if (option & PGSQL_DML_STRING) {
@@ -6933,7 +6931,7 @@ PHP_FUNCTION(pg_delete)
/* {{{ php_pgsql_result2array
*/
-PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array)
{
zval row;
char *field_name;
@@ -6969,7 +6967,7 @@ PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TS
/* {{{ php_pgsql_select
*/
-PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, zend_ulong opt, zend_string **sql TSRMLS_DC)
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids_array, zval *ret_array, zend_ulong opt, zend_string **sql)
{
zval ids_converted;
smart_str querystr = {0};
@@ -6989,7 +6987,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
ZVAL_UNDEF(&ids_converted);
if (!(opt & (PGSQL_DML_NO_CONV|PGSQL_DML_ESCAPE))) {
array_init(&ids_converted);
- if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS) TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_convert(pg_link, table, ids_array, &ids_converted, (opt & PGSQL_CONV_OPTS)) == FAILURE) {
goto cleanup;
}
ids_array = &ids_converted;
@@ -6999,7 +6997,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
build_tablename(&querystr, pg_link, table);
smart_str_appends(&querystr, " WHERE ");
- if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt TSRMLS_CC))
+ if (build_assignment_string(pg_link, &querystr, Z_ARRVAL_P(ids_array), 1, " AND ", sizeof(" AND ")-1, opt))
goto cleanup;
smart_str_appendc(&querystr, ';');
@@ -7007,9 +7005,9 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids
pg_result = PQexec(pg_link, querystr.s->val);
if (PQresultStatus(pg_result) == PGRES_TUPLES_OK) {
- ret = php_pgsql_result2array(pg_result, ret_array TSRMLS_CC);
+ ret = php_pgsql_result2array(pg_result, ret_array);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to execute '%s'", querystr.s->val);
+ php_error_docref(NULL, E_NOTICE, "Failed to execute '%s'", querystr.s->val);
}
PQclear(pg_result);
@@ -7037,22 +7035,22 @@ PHP_FUNCTION(pg_select)
zend_string *sql = NULL;
int id = -1, argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rsa|l",
+ if (zend_parse_parameters(argc, "rsa|l",
&pgsql_link, &table, &table_len, &ids, &option) == FAILURE) {
return;
}
if (option & ~(PGSQL_CONV_FORCE_NULL|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING|PGSQL_DML_ESCAPE)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option is specified");
+ php_error_docref(NULL, E_WARNING, "Invalid option is specified");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE2(pg_link, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
- if (php_pgsql_flush_query(pg_link TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected unhandled result(s) in connection");
+ if (php_pgsql_flush_query(pg_link)) {
+ php_error_docref(NULL, E_NOTICE, "Detected unhandled result(s) in connection");
}
array_init(return_value);
- if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql TSRMLS_CC) == FAILURE) {
+ if (php_pgsql_select(pg_link, table, ids, return_value, option, &sql) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index 18f1bbe77f..4c50666e12 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -210,29 +210,29 @@ PHP_FUNCTION(pg_select);
/* exported functions */
-PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, zend_ulong opt, zend_string **sql TSRMLS_DC);
-PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array TSRMLS_DC);
+PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, zval *meta, zend_bool extended);
+PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, const zval *values, zval *result, zend_ulong opt);
+PHP_PGSQL_API int php_pgsql_insert(PGconn *pg_link, const char *table, zval *values, zend_ulong opt, zend_string **sql);
+PHP_PGSQL_API int php_pgsql_update(PGconn *pg_link, const char *table, zval *values, zval *ids, zend_ulong opt , zend_string **sql);
+PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids, zend_ulong opt, zend_string **sql);
+PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids, zval *ret_array, zend_ulong opt, zend_string **sql );
+PHP_PGSQL_API int php_pgsql_result2array(PGresult *pg_result, zval *ret_array);
/* internal functions */
static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent);
static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
-static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC);
+static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list);
static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type);
static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS,int entry_type);
-static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int php_pgsql_fd_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int php_pgsql_fd_flush(php_stream *stream TSRMLS_DC);
-static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
-static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret TSRMLS_DC);
+static size_t php_pgsql_fd_write(php_stream *stream, const char *buf, size_t count);
+static size_t php_pgsql_fd_read(php_stream *stream, char *buf, size_t count);
+static int php_pgsql_fd_close(php_stream *stream, int close_handle);
+static int php_pgsql_fd_flush(php_stream *stream);
+static int php_pgsql_fd_set_option(php_stream *stream, int option, int value, void *ptrparam);
+static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret);
typedef enum _php_pgsql_data_type {
/* boolean */
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c
index b8875891b0..33a3cd20c2 100644
--- a/ext/phar/dirstream.c
+++ b/ext/phar/dirstream.c
@@ -22,7 +22,7 @@
#include "dirstream.h"
BEGIN_EXTERN_C()
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir TSRMLS_DC);
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir);
END_EXTERN_C()
php_stream_ops phar_dir_ops = {
@@ -40,7 +40,7 @@ php_stream_ops phar_dir_ops = {
/**
* Used for closedir($fp) where $fp is an opendir('phar://...') directory handle
*/
-static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int phar_dir_close(php_stream *stream, int close_handle) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
@@ -58,7 +58,7 @@ static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{
/**
* Used for seeking on a phar directory handle
*/
-static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
HashTable *data = (HashTable *)stream->abstract;
@@ -90,7 +90,7 @@ static int phar_dir_seek(php_stream *stream, zend_off_t offset, int whence, zend
/**
* Used for readdir() on an opendir()ed phar directory handle
*/
-static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_dir_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
size_t to_read;
HashTable *data = (HashTable *)stream->abstract;
@@ -119,7 +119,7 @@ static size_t phar_dir_read(php_stream *stream, char *buf, size_t count TSRMLS_D
/**
* Dummy: Used for writing to a phar directory (i.e. not used)
*/
-static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return 0;
}
@@ -128,7 +128,7 @@ static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count T
/**
* Dummy: Used for flushing writes to a phar directory (i.e. not used)
*/
-static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int phar_dir_flush(php_stream *stream) /* {{{ */
{
return EOF;
}
@@ -152,7 +152,7 @@ static int phar_add_empty(HashTable *ht, char *arKey, uint nKeyLength) /* {{{ *
/**
* Used for sorting directories alphabetically
*/
-static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int phar_compare_dir_name(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -177,7 +177,7 @@ static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{
* files in a phar and retrieving its relative path. From this, construct
* a list of files/directories that are "in" the directory represented by dir
*/
-static php_stream *phar_make_dirstream(char *dir, HashTable *manifest TSRMLS_DC) /* {{{ */
+static php_stream *phar_make_dirstream(char *dir, HashTable *manifest) /* {{{ */
{
HashTable *data;
int dirlen = strlen(dir);
@@ -285,7 +285,7 @@ PHAR_ADD_ENTRY:
if (FAILURE != zend_hash_has_more_elements(data)) {
efree(dir);
- if (zend_hash_sort(data, zend_qsort, phar_compare_dir_name, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(data, zend_qsort, phar_compare_dir_name, 0) == FAILURE) {
FREE_HASHTABLE(data);
return NULL;
}
@@ -300,7 +300,7 @@ PHAR_ADD_ENTRY:
/**
* Open a directory handle within a phar archive
*/
-php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
php_url *resource = NULL;
php_stream *ret;
@@ -311,39 +311,39 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
phar_entry_info *entry = NULL;
uint host_len;
- if ((resource = phar_parse_url(wrapper, path, mode, options TSRMLS_CC)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar url \"%s\" is unknown", path);
+ if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) {
+ php_stream_wrapper_log_error(wrapper, options, "phar url \"%s\" is unknown", path);
return NULL;
}
/* we must have at the very least phar://alias.phar/ */
if (!resource->scheme || !resource->host || !resource->path) {
if (resource->host && !resource->path) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, resource->host);
php_url_free(resource);
return NULL;
}
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\", must have at least phar://%s/", path, path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\", must have at least phar://%s/", path, path);
return NULL;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar url \"%s\"", path);
return NULL;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
internal_file = resource->path + 1; /* strip leading "/" */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar file \"%s\" is unknown", resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", resource->host);
}
php_url_free(resource);
return NULL;
@@ -356,7 +356,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
if (*internal_file == '\0') {
/* root directory requested */
internal_file = estrndup(internal_file - 1, 1);
- ret = phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ ret = phar_make_dirstream(internal_file, &phar->manifest);
php_url_free(resource);
return ret;
}
@@ -376,7 +376,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
}
internal_file = estrdup(internal_file);
php_url_free(resource);
- return phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ return phar_make_dirstream(internal_file, &phar->manifest);
} else {
int i_len = strlen(internal_file);
@@ -391,7 +391,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
internal_file = estrndup(internal_file,
i_len);
php_url_free(resource);
- return phar_make_dirstream(internal_file, &phar->manifest TSRMLS_CC);
+ return phar_make_dirstream(internal_file, &phar->manifest);
}
}
@@ -409,7 +409,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
/**
* Make a new directory within a phar archive
*/
-int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context) /* {{{ */
{
phar_entry_info entry, *e;
phar_archive_data *phar = NULL;
@@ -419,12 +419,12 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
uint host_len;
/* pre-readonly check, we need to know if this is a data phar */
- if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2 TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\", no phar archive specified", url_from);
+ if (FAILURE == phar_split_fname(url_from, strlen(url_from), &arch, &arch_len, &entry2, &entry_len, 2, 2)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", no phar archive specified", url_from);
return 0;
}
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar = NULL;
}
@@ -432,63 +432,63 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
efree(entry2);
if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\", write operations disabled", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\", write operations disabled", url_from);
return 0;
}
- if ((resource = phar_parse_url(wrapper, url_from, "w", options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url_from, "w", options)) == NULL) {
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url_from);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url_from);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url_from);
return 0;
}
host_len = strlen(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
}
- if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1 TSRMLS_CC))) {
+ if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1))) {
/* directory exists, or is a subdirectory of an existing file */
if (e->is_temp_dir) {
efree(e->filename);
efree(e);
}
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", resource->path+1, resource->host);
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
}
- if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1 TSRMLS_CC)) {
+ if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1)) {
/* entry exists as a file */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", resource->path+1, resource->host);
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
@@ -518,22 +518,22 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
entry.old_flags = PHAR_ENT_PERM_DEF_DIR;
if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", entry.filename, phar->fname);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", entry.filename, phar->fname);
efree(error);
efree(entry.filename);
return 0;
}
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry.filename, phar->fname, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry.filename, phar->fname, error);
zend_hash_str_del(&phar->manifest, entry.filename, entry.filename_len);
efree(error);
return 0;
}
- phar_add_virtual_dirs(phar, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, entry.filename, entry.filename_len);
return 1;
}
/* }}} */
@@ -541,7 +541,7 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
/**
* Remove a directory within a phar archive
*/
-int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */
{
phar_entry_info *entry;
phar_archive_data *phar = NULL;
@@ -554,12 +554,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
uint path_len;
/* pre-readonly check, we need to know if this is a data phar */
- if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2 TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url);
+ if (FAILURE == phar_split_fname(url, strlen(url), &arch, &arch_len, &entry2, &entry_len, 2, 2)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\", no phar archive specified, or phar archive does not exist", url);
return 0;
}
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar = NULL;
}
@@ -567,31 +567,31 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
efree(entry2);
if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot rmdir directory \"%s\", write operations disabled", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot rmdir directory \"%s\", write operations disabled", url);
return 0;
}
- if ((resource = phar_parse_url(wrapper, url, "w", options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) {
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
host_len = strlen(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
efree(error);
php_url_free(resource);
return 0;
@@ -599,12 +599,12 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
path_len = strlen(resource->path+1);
- if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1 TSRMLS_CC))) {
+ if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1))) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", resource->path+1, resource->host);
}
php_url_free(resource);
return 0;
@@ -618,7 +618,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
if (str_key->len > path_len &&
memcmp(str_key->val, resource->path+1, path_len) == 0 &&
IS_SLASH(str_key->val[path_len])) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
efree(entry->filename);
efree(entry);
@@ -635,7 +635,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
if (str_key->len > path_len &&
memcmp(str_key->val, resource->path+1, path_len) == 0 &&
IS_SLASH(str_key->val[path_len])) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: Directory not empty");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
efree(entry->filename);
efree(entry);
@@ -653,10 +653,10 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
} else {
entry->is_deleted = 1;
entry->is_modified = 1;
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
php_url_free(resource);
efree(error);
return 0;
diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h
index f9a300a63c..c59ba1b95b 100644
--- a/ext/phar/dirstream.h
+++ b/ext/phar/dirstream.h
@@ -20,20 +20,20 @@
/* $Id$ */
BEGIN_EXTERN_C()
-int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context TSRMLS_DC);
-int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
+int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mode, int options, php_stream_context *context);
+int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
#ifdef PHAR_DIRSTREAM
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC);
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
/* directory handlers */
-static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t phar_dir_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int phar_dir_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int phar_dir_flush(php_stream *stream TSRMLS_DC);
-static int phar_dir_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
+static size_t phar_dir_write(php_stream *stream, const char *buf, size_t count);
+static size_t phar_dir_read( php_stream *stream, char *buf, size_t count);
+static int phar_dir_close(php_stream *stream, int close_handle);
+static int phar_dir_flush(php_stream *stream);
+static int phar_dir_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset);
#else
-php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream* phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
#endif
END_EXTERN_C()
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index bd7324c78e..5fd3753ab6 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -38,14 +38,14 @@ PHAR_FUNC(phar_opendir) /* {{{ */
goto skip_phar;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|z", &filename, &filename_len, &zcontext) == FAILURE) {
return;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -54,7 +54,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
php_stream_context *context = NULL;
php_stream *stream;
char *name;
@@ -64,7 +64,7 @@ PHAR_FUNC(phar_opendir) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (entry[0] == '/') {
spprintf(&name, 4096, "phar://%s%s", arch, entry);
@@ -112,7 +112,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
}
/* Parse arguments */
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
goto skip_phar;
}
@@ -121,13 +121,13 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
int arch_len, entry_len, fname_len;
php_stream_context *context = NULL;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
char *name;
phar_archive_data *phar;
@@ -138,17 +138,17 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
if (ZEND_NUM_ARGS() == 5 && maxlen < 0) {
efree(arch);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "length must be greater than or equal to zero");
RETURN_FALSE;
}
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if ((entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if ((entry = phar_find_in_include_path(entry, entry_len, NULL))) {
name = entry;
goto phar_it;
} else {
@@ -157,7 +157,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
goto skip_phar;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -195,7 +195,7 @@ phar_it:
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %pd in the stream", offset);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position %pd in the stream", offset);
php_stream_close(stream);
RETURN_FALSE;
}
@@ -238,7 +238,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -247,13 +247,13 @@ PHAR_FUNC(phar_readfile) /* {{{ */
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
goto skip_phar;
}
@@ -262,12 +262,12 @@ PHAR_FUNC(phar_readfile) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if (!(entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if (!(entry = phar_find_in_include_path(entry, entry_len, NULL))) {
/* this file is not in the phar, use the original path */
efree(arch);
goto skip_phar;
@@ -275,7 +275,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
name = entry;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -334,7 +334,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
/* no need to check, include_path not even specified in fopen/ no active phars */
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
goto skip_phar;
}
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) {
@@ -343,13 +343,13 @@ PHAR_FUNC(phar_fopen) /* {{{ */
php_stream_context *context = NULL;
char *name;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
if (strncasecmp(fname, "phar://", 7)) {
goto skip_phar;
}
fname_len = strlen(fname);
- if (FAILURE == phar_split_fname(fname, fname_len, &arch, (int *)&arch_len, &entry, (int *)&entry_len, 2, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_split_fname(fname, fname_len, &arch, (int *)&arch_len, &entry, (int *)&entry_len, 2, 0)) {
goto skip_phar;
}
@@ -358,12 +358,12 @@ PHAR_FUNC(phar_fopen) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file defaults to within the current directory, so use this if possible */
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
goto skip_phar;
}
if (use_include_path) {
- if (!(entry = phar_find_in_include_path(entry, entry_len, NULL TSRMLS_CC))) {
+ if (!(entry = phar_find_in_include_path(entry, entry_len, NULL))) {
/* this file is not in the phar, use the original path */
efree(arch);
goto skip_phar;
@@ -371,7 +371,7 @@ PHAR_FUNC(phar_fopen) /* {{{ */
name = entry;
}
} else {
- entry = phar_fix_filepath(estrndup(entry, entry_len), (int *)&entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), (int *)&entry_len, 1);
if (entry[0] == '/') {
if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
/* this file is not in the phar, use the original path */
@@ -433,7 +433,7 @@ skip_phar:
/* {{{ php_stat
*/
-static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value TSRMLS_DC)
+static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
@@ -512,7 +512,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
case S_IFDIR: RETURN_STRING("dir");
case S_IFREG: RETURN_STRING("file");
}
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%u)", stat_sb->st_mode & S_IFMT);
+ php_error_docref(NULL, E_NOTICE, "Unknown file type (%u)", stat_sb->st_mode & S_IFMT);
RETURN_STRING("unknown");
case FS_IS_W:
RETURN_BOOL((stat_sb->st_mode & wmask) != 0);
@@ -597,7 +597,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value T
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call");
+ php_error_docref(NULL, E_WARNING, "Didn't understand stat call");
RETURN_FALSE;
}
/* }}} */
@@ -615,7 +615,7 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
phar_entry_info *data = NULL;
phar_archive_data *phar;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -633,19 +633,19 @@ static void phar_file_stat(const char *filename, php_stat_len filename_length, i
phar = PHAR_G(last_phar);
goto splitted;
}
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
entry = estrndup(filename, filename_length);
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = (int) filename_length;
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
efree(entry);
goto skip_phar;
}
splitted:
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
efree(entry);
@@ -690,7 +690,7 @@ notfound:
PHAR_G(cwd) = "/";
PHAR_G(cwd_len) = 0;
/* clean path without cwd */
- entry = phar_fix_filepath(entry, &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(entry, &entry_len, 1);
if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
PHAR_G(cwd) = save;
PHAR_G(cwd_len) = save_len;
@@ -729,7 +729,7 @@ notfound:
efree(arch);
/* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
+ php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
RETURN_FALSE;
}
@@ -789,7 +789,7 @@ statme_baby:
sb.st_blksize = -1;
sb.st_blocks = -1;
#endif
- phar_fancy_stat(&sb, type, return_value TSRMLS_CC);
+ phar_fancy_stat(&sb, type, return_value);
return;
}
}
@@ -807,7 +807,7 @@ void fname(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
size_t filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
@@ -899,13 +899,13 @@ PHAR_FUNC(phar_is_file) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -914,7 +914,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
phar_archive_data *phar;
efree(entry);
@@ -922,10 +922,10 @@ PHAR_FUNC(phar_is_file) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar_entry_info *etemp;
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
/* this file is not in the current directory, use the original path */
@@ -966,13 +966,13 @@ PHAR_FUNC(phar_is_link) /* {{{ */
&& !cached_phars.arHash) {
goto skip_phar;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
goto skip_phar;
}
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) {
char *arch, *entry, *fname;
int arch_len, entry_len, fname_len;
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
/* we are checking for existence of a file within the relative path. Chances are good that this is
retrieving something from within the phar archive */
@@ -981,7 +981,7 @@ PHAR_FUNC(phar_is_link) /* {{{ */
goto skip_phar;
}
fname_len = strlen(fname);
- if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
phar_archive_data *phar;
efree(entry);
@@ -989,10 +989,10 @@ PHAR_FUNC(phar_is_link) /* {{{ */
/* fopen within phar, if :// is not in the url, then prepend phar://<archive>/ */
entry_len = filename_len;
/* retrieving a file within the current directory, so use this if possible */
- if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar_entry_info *etemp;
- entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1 TSRMLS_CC);
+ entry = phar_fix_filepath(estrndup(entry, entry_len), &entry_len, 1);
if (entry[0] == '/') {
if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
/* this file is not in the current directory, use the original path */
@@ -1028,8 +1028,8 @@ PharFileFunction(phar_lstat, FS_LSTAT, orig_lstat)
PharFileFunction(phar_stat, FS_STAT, orig_stat)
/* }}} */
-/* {{{ void phar_intercept_functions(TSRMLS_D) */
-void phar_intercept_functions(TSRMLS_D)
+/* {{{ void phar_intercept_functions(void) */
+void phar_intercept_functions(void)
{
if (!PHAR_G(request_init)) {
PHAR_G(cwd) = NULL;
@@ -1039,14 +1039,14 @@ void phar_intercept_functions(TSRMLS_D)
}
/* }}} */
-/* {{{ void phar_release_functions(TSRMLS_D) */
-void phar_release_functions(TSRMLS_D)
+/* {{{ void phar_release_functions(void) */
+void phar_release_functions(void)
{
PHAR_G(intercepted) = 0;
}
/* }}} */
-/* {{{ void phar_intercept_functions_init(TSRMLS_D) */
+/* {{{ void phar_intercept_functions_init(void) */
#define PHAR_INTERCEPT(func) \
PHAR_G(orig_##func) = NULL; \
if (NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
@@ -1054,7 +1054,7 @@ void phar_release_functions(TSRMLS_D)
orig->internal_function.handler = phar_##func; \
}
-void phar_intercept_functions_init(TSRMLS_D)
+void phar_intercept_functions_init(void)
{
zend_function *orig;
@@ -1084,14 +1084,14 @@ void phar_intercept_functions_init(TSRMLS_D)
}
/* }}} */
-/* {{{ void phar_intercept_functions_shutdown(TSRMLS_D) */
+/* {{{ void phar_intercept_functions_shutdown(void) */
#define PHAR_RELEASE(func) \
if (PHAR_G(orig_##func) && NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
orig->internal_function.handler = PHAR_G(orig_##func); \
} \
PHAR_G(orig_##func) = NULL;
-void phar_intercept_functions_shutdown(TSRMLS_D)
+void phar_intercept_functions_shutdown(void)
{
zend_function *orig;
@@ -1145,7 +1145,7 @@ static struct _phar_orig_functions {
void (*orig_stat)(INTERNAL_FUNCTION_PARAMETERS);
} phar_orig_functions = {NULL};
-void phar_save_orig_functions(TSRMLS_D) /* {{{ */
+void phar_save_orig_functions(void) /* {{{ */
{
phar_orig_functions.orig_fopen = PHAR_G(orig_fopen);
phar_orig_functions.orig_file_get_contents = PHAR_G(orig_file_get_contents);
@@ -1172,7 +1172,7 @@ void phar_save_orig_functions(TSRMLS_D) /* {{{ */
}
/* }}} */
-void phar_restore_orig_functions(TSRMLS_D) /* {{{ */
+void phar_restore_orig_functions(void) /* {{{ */
{
PHAR_G(orig_fopen) = phar_orig_functions.orig_fopen;
PHAR_G(orig_file_get_contents) = phar_orig_functions.orig_file_get_contents;
diff --git a/ext/phar/func_interceptors.h b/ext/phar/func_interceptors.h
index ff271460fe..e0aba7a8a2 100644
--- a/ext/phar/func_interceptors.h
+++ b/ext/phar/func_interceptors.h
@@ -20,12 +20,12 @@
/* $Id$ */
BEGIN_EXTERN_C()
-void phar_intercept_functions(TSRMLS_D);
-void phar_release_functions(TSRMLS_D);
-void phar_intercept_functions_init(TSRMLS_D);
-void phar_intercept_functions_shutdown(TSRMLS_D);
-void phar_save_orig_functions(TSRMLS_D);
-void phar_restore_orig_functions(TSRMLS_D);
+void phar_intercept_functions(void);
+void phar_release_functions(void);
+void phar_intercept_functions_init(void);
+void phar_intercept_functions_shutdown(void);
+void phar_save_orig_functions(void);
+void phar_restore_orig_functions(void);
END_EXTERN_C()
/*
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index ec64f09c09..b601669507 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -27,12 +27,12 @@
static void destroy_phar_data(zval *zv);
ZEND_DECLARE_MODULE_GLOBALS(phar)
-char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+char *(*phar_save_resolve_path)(const char *filename, int filename_len);
/**
* set's phar->is_writeable based on the current INI value
*/
-static int phar_set_writeable_bit(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_set_writeable_bit(zval *zv, void *argument) /* {{{ */
{
zend_bool keep = *(zend_bool *)argument;
phar_archive_data *phar = (phar_archive_data *)Z_PTR_P(zv);
@@ -83,7 +83,7 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
if (entry->name->len == sizeof("phar.readonly")-1) {
PHAR_G(readonly) = ini;
if (PHAR_GLOBALS->request_init && PHAR_GLOBALS->phar_fname_map.arHash) {
- zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_fname_map), phar_set_writeable_bit, (void *)&ini TSRMLS_CC);
+ zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_fname_map), phar_set_writeable_bit, (void *)&ini);
}
} else {
PHAR_G(require_hash) = ini;
@@ -97,7 +97,7 @@ ZEND_INI_MH(phar_ini_modify_handler) /* {{{ */
HashTable cached_phars;
HashTable cached_alias;
-static void phar_split_cache_list(TSRMLS_D) /* {{{ */
+static void phar_split_cache_list(void) /* {{{ */
{
char *tmp;
char *key, *lasts, *end;
@@ -135,7 +135,7 @@ static void phar_split_cache_list(TSRMLS_D) /* {{{ */
end = strchr(key, DEFAULT_DIR_SEPARATOR);
if (end) {
- if (SUCCESS == phar_open_from_filename(key, end - key, NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename(key, end - key, NULL, 0, 0, &phar, NULL)) {
finish_up:
phar->phar_pos = i++;
php_stream_close(phar->fp);
@@ -158,7 +158,7 @@ finish_error:
return;
}
} else {
- if (SUCCESS == phar_open_from_filename(key, strlen(key), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename(key, strlen(key), NULL, 0, 0, &phar, NULL)) {
goto finish_up;
} else {
goto finish_error;
@@ -186,7 +186,7 @@ ZEND_INI_MH(phar_ini_cache_list) /* {{{ */
PHAR_G(cache_list) = new_value->val;
if (stage == ZEND_INI_STAGE_STARTUP) {
- phar_split_cache_list(TSRMLS_C);
+ phar_split_cache_list();
}
return SUCCESS;
@@ -203,7 +203,7 @@ PHP_INI_END()
* When all uses of a phar have been concluded, this frees the manifest
* and the phar slot
*/
-void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */
{
if (phar->alias && phar->alias != phar->fname) {
pefree(phar->alias, phar->is_persistent);
@@ -267,7 +267,7 @@ void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/**
* Delete refcount and destruct if needed. On destruct return 1 else 0.
*/
-int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+int phar_archive_delref(phar_archive_data *phar) /* {{{ */
{
if (phar->is_persistent) {
return 0;
@@ -276,7 +276,7 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
if (--phar->refcount < 0) {
if (PHAR_GLOBALS->request_done
|| zend_hash_str_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_len) != SUCCESS) {
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
}
return 1;
} else if (!phar->refcount) {
@@ -297,7 +297,7 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/* this is a new phar that has perhaps had an alias/metadata set, but has never
been flushed */
if (zend_hash_str_del(&(PHAR_GLOBALS->phar_fname_map), phar->fname, phar->fname_len) != SUCCESS) {
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
}
return 1;
}
@@ -312,10 +312,9 @@ int phar_archive_delref(phar_archive_data *phar TSRMLS_DC) /* {{{ */
static void destroy_phar_data_only(zval *zv) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *) Z_PTR_P(zv);
- TSRMLS_FETCH();
if (EG(exception) || --phar_data->refcount < 0) {
- phar_destroy_phar_data(phar_data TSRMLS_CC);
+ phar_destroy_phar_data(phar_data);
}
}
/* }}}*/
@@ -323,7 +322,7 @@ static void destroy_phar_data_only(zval *zv) /* {{{ */
/**
* Delete aliases to phar's that got kicked out of the global table
*/
-static int phar_unalias_apply(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_unalias_apply(zval *zv, void *argument) /* {{{ */
{
return Z_PTR_P(zv) == argument ? ZEND_HASH_APPLY_REMOVE : ZEND_HASH_APPLY_KEEP;
}
@@ -332,7 +331,7 @@ static int phar_unalias_apply(zval *zv, void *argument TSRMLS_DC) /* {{{ */
/**
* Delete aliases to phar's that got kicked out of the global table
*/
-static int phar_tmpclose_apply(zval *zv TSRMLS_DC) /* {{{ */
+static int phar_tmpclose_apply(zval *zv) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *) Z_PTR_P(zv);
@@ -355,20 +354,19 @@ static int phar_tmpclose_apply(zval *zv TSRMLS_DC) /* {{{ */
static void destroy_phar_data(zval *zv) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *)Z_PTR_P(zv);
- TSRMLS_FETCH();
if (PHAR_GLOBALS->request_ends) {
/* first, iterate over the manifest and close all PHAR_TMP entry fp handles,
this prevents unnecessary unfreed stream resources */
- zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply TSRMLS_CC);
+ zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply);
destroy_phar_data_only(zv);
return;
}
- zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_alias_map), phar_unalias_apply, phar_data TSRMLS_CC);
+ zend_hash_apply_with_argument(&(PHAR_GLOBALS->phar_alias_map), phar_unalias_apply, phar_data);
if (--phar_data->refcount < 0) {
- phar_destroy_phar_data(phar_data TSRMLS_CC);
+ phar_destroy_phar_data(phar_data);
}
}
/* }}}*/
@@ -378,7 +376,6 @@ static void destroy_phar_data(zval *zv) /* {{{ */
*/
void destroy_phar_manifest_entry_int(phar_entry_info *entry) /* {{{ */
{
- TSRMLS_FETCH();
if (entry->cfp) {
php_stream_close(entry->cfp);
@@ -432,7 +429,7 @@ void destroy_phar_manifest_entry(zval *zv) /* {{{ */
}
/* }}} */
-int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
+int phar_entry_delref(phar_entry_data *idata) /* {{{ */
{
int ret = 0;
@@ -451,7 +448,7 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
}
}
- phar_archive_delref(idata->phar TSRMLS_CC);
+ phar_archive_delref(idata->phar);
efree(idata);
return ret;
}
@@ -460,7 +457,7 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
/**
* Removes an entry, either by actually removing it or by marking it.
*/
-void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
+void phar_entry_remove(phar_entry_data *idata, char **error) /* {{{ */
{
phar_archive_data *phar;
@@ -475,11 +472,11 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
efree(idata);
} else {
idata->internal_file->is_deleted = 1;
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
}
if (!phar->donotflush) {
- phar_flush(phar, 0, 0, 0, error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, error);
}
}
/* }}} */
@@ -496,7 +493,7 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
#define MAPPHAR_FAIL(msg) \
efree(savebuf);\
if (mydata) {\
- phar_destroy_phar_data(mydata TSRMLS_CC);\
+ phar_destroy_phar_data(mydata);\
}\
if (signature) {\
pefree(signature, PHAR_G(persist));\
@@ -532,7 +529,7 @@ void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC) /* {{{ */
/**
* Open an already loaded phar
*/
-int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
#ifdef PHP_WIN32
@@ -546,14 +543,14 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
unixfname = estrndup(fname, fname_len);
phar_unixify_path_separators(unixfname, fname_len);
- if (SUCCESS == phar_get_archive(&phar, unixfname, fname_len, alias, alias_len, error TSRMLS_CC)
+ if (SUCCESS == phar_get_archive(&phar, unixfname, fname_len, alias, alias_len, error)
&& ((alias && fname_len == phar->fname_len
&& !strncmp(unixfname, phar->fname, fname_len)) || !alias)
) {
phar_entry_info *stub;
efree(unixfname);
#else
- if (SUCCESS == phar_get_archive(&phar, fname, fname_len, alias, alias_len, error TSRMLS_CC)
+ if (SUCCESS == phar_get_archive(&phar, fname, fname_len, alias, alias_len, error)
&& ((alias && fname_len == phar->fname_len
&& !strncmp(fname, phar->fname, fname_len)) || !alias)
) {
@@ -607,7 +604,7 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
*
* data is the serialized zval
*/
-int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRMLS_DC) /* {{{ */
+int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len) /* {{{ */
{
const unsigned char *p;
php_uint32 buf_len;
@@ -624,7 +621,7 @@ int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRM
p = (const unsigned char*) *buffer;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_ptr_dtor(metadata);
ZVAL_UNDEF(metadata);
@@ -662,7 +659,7 @@ int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRM
* This is used by phar_open_from_filename to process the manifest, but can be called
* directly.
*/
-static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, zend_long halt_offset, phar_archive_data** pphar, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
+static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, zend_long halt_offset, phar_archive_data** pphar, php_uint32 compression, char **error) /* {{{ */
{
char b32[4], *buffer, *endbuffer, *savebuf;
phar_archive_data *mydata = NULL;
@@ -823,7 +820,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, end_of_phar, PHAR_SIG_OPENSSL, sig, signature_len, fname, &signature, &sig_len, error)) {
efree(savebuf);
efree(sig);
php_stream_close(fp);
@@ -853,7 +850,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA512, (char *)digest, 64, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -880,7 +877,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA256, (char *)digest, 32, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -918,7 +915,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_SHA1, (char *)digest, 20, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -945,7 +942,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
return FAILURE;
}
- if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signature, &sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, read_len, PHAR_SIG_MD5, (char *)digest, 16, fname, &signature, &sig_len, error)) {
efree(savebuf);
php_stream_close(fp);
if (error) {
@@ -1036,11 +1033,11 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
/* check whether we have meta data, zero check works regardless of byte order */
if (mydata->is_persistent) {
PHAR_GET_32(buffer, mydata->metadata_len);
- if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
} else {
- if (phar_parse_metadata(&buffer, &mydata->metadata, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &mydata->metadata, 0) == FAILURE) {
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
}
}
@@ -1088,7 +1085,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
entry.is_dir = 0;
}
- phar_add_virtual_dirs(mydata, buffer, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(mydata, buffer, entry.filename_len);
entry.filename = pestrndup(buffer, entry.filename_len, entry.is_persistent);
buffer += entry.filename_len;
PHAR_GET_32(buffer, entry.uncompressed_filesize);
@@ -1117,12 +1114,12 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
if (entry.is_persistent) {
PHAR_GET_32(buffer, entry.metadata_len);
if (!entry.metadata_len) buffer -= 4;
- if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
} else {
- if (phar_parse_metadata(&buffer, &entry.metadata, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&buffer, &entry.metadata, 0) == FAILURE) {
pefree(entry.filename, entry.is_persistent);
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
}
@@ -1176,7 +1173,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
manifest_flags |= (entry.flags & PHAR_ENT_COMPRESSION_MASK);
/* if signature matched, no need to check CRC32 for each file */
entry.is_crc_checked = (manifest_flags & PHAR_HDR_SIGNATURE ? 1 : 0);
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
}
@@ -1204,7 +1201,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
mydata->fp = fp;
mydata->sig_len = sig_len;
mydata->signature = signature;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (register_alias) {
phar_archive_data *fd_ptr;
@@ -1218,7 +1215,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
}
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
signature = NULL;
fp = NULL;
MAPPHAR_FAIL("Cannot open archive \"%s\", alias is already in use by existing archive");
@@ -1244,7 +1241,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
/**
* Create or open a phar for writing
*/
-int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
const char *ext_str, *z;
char *my_error;
@@ -1258,12 +1255,12 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al
}
/* first try to open an existing file */
- if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, 1 TSRMLS_CC) == SUCCESS) {
+ if (phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 0, 1) == SUCCESS) {
goto check_file;
}
/* next try to create a new file */
- if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, !is_data, 1, 1)) {
if (error) {
if (ext_len == -2) {
spprintf(error, 0, "Cannot create a phar archive from a URL like \"%s\". Phar objects can only be created from local files", fname);
@@ -1274,7 +1271,7 @@ int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int al
return FAILURE;
}
check_file:
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, test, &my_error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, test, &my_error) == SUCCESS) {
if (pphar) {
*pphar = *test;
}
@@ -1309,19 +1306,19 @@ check_file:
if (ext_len > 3 && (z = memchr(ext_str, 'z', ext_len)) && ((ext_str + ext_len) - z >= 2) && !memcmp(z + 1, "ip", 2)) {
/* assume zip-based phar */
- return phar_open_or_create_zip(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_open_or_create_zip(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
if (ext_len > 3 && (z = memchr(ext_str, 't', ext_len)) && ((ext_str + ext_len) - z >= 2) && !memcmp(z + 1, "ar", 2)) {
/* assume tar-based phar */
- return phar_open_or_create_tar(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_open_or_create_tar(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
- return phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC);
+ return phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, pphar, error);
}
/* }}} */
-int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *mydata;
php_stream *fp;
@@ -1335,7 +1332,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
return FAILURE;
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -1348,7 +1345,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
}
if (fp) {
- if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error) == SUCCESS) {
if ((*pphar)->is_data || !PHAR_G(readonly)) {
(*pphar)->is_writeable = 1;
}
@@ -1380,7 +1377,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
/* set up our manifest */
mydata = ecalloc(1, sizeof(phar_archive_data));
- mydata->fname = expand_filepath(fname, NULL TSRMLS_CC);
+ mydata->fname = expand_filepath(fname, NULL);
fname_len = strlen(mydata->fname);
#ifdef PHP_WIN32
phar_unixify_path_separators(mydata->fname, fname_len);
@@ -1414,7 +1411,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
mydata->fp = NULL;
mydata->is_writeable = 1;
mydata->is_brandnew = 1;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_fname_map), mydata->fname, fname_len, mydata);
if (is_data) {
@@ -1427,7 +1424,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
phar_archive_data *fd_ptr;
if (alias && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: phar \"%s\" cannot set alias \"%s\", already in use by another phar archive", mydata->fname, alias);
}
@@ -1475,7 +1472,7 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
* that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
* or FAILURE is returned and pphar is set to a pointer to the phar's manifest
*/
-int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
php_stream *fp;
char *actual;
@@ -1489,7 +1486,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
is_data = 1;
}
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, pphar, error TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, is_data, options, pphar, error) == SUCCESS) {
return SUCCESS;
} else if (error && *error) {
return FAILURE;
@@ -1499,7 +1496,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
return FAILURE;
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -1522,7 +1519,7 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
fname_len = strlen(actual);
}
- ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error TSRMLS_CC);
+ ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, options, pphar, is_data, error);
if (actual) {
efree(actual);
@@ -1566,7 +1563,7 @@ static inline char *phar_strnstr(const char *buf, int buf_len, const char *searc
* that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
* or FAILURE is returned and pphar is set to a pointer to the phar's manifest
*/
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error TSRMLS_DC) /* {{{ */
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error) /* {{{ */
{
const char token[] = "__HALT_COMPILER();";
const char zip_magic[] = "PK\x03\x04";
@@ -1626,12 +1623,12 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_rewind(fp);
- filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
if (!filter) {
err = 1;
add_assoc_long_ex(&filterparams, "window", sizeof("window") - 1, MAX_WBITS);
- filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", &filterparams, php_stream_is_persistent(fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -1654,7 +1651,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(fp);
fp = temp;
php_stream_rewind(fp);
@@ -1677,7 +1674,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_rewind(fp);
- filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
if (!filter) {
php_stream_close(temp);
@@ -1692,7 +1689,7 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(fp);
fp = temp;
php_stream_rewind(fp);
@@ -1705,20 +1702,20 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
if (!memcmp(pos, zip_magic, 4)) {
php_stream_seek(fp, 0, SEEK_END);
- return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error TSRMLS_CC);
+ return phar_parse_zipfile(fp, fname, fname_len, alias, alias_len, pphar, error);
}
if (got > 512) {
if (phar_is_tar(pos, fname)) {
php_stream_rewind(fp);
- return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, error TSRMLS_CC);
+ return phar_parse_tarfile(fp, fname, fname_len, alias, alias_len, pphar, is_data, compression, error);
}
}
}
if (got > 0 && (pos = phar_strnstr(buffer, got + sizeof(token), token, sizeof(token)-1)) != NULL) {
halt_offset += (pos - buffer); /* no -tokenlen+tokenlen here */
- return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression, error TSRMLS_CC);
+ return phar_parse_pharfile(fp, fname, fname_len, alias, alias_len, halt_offset, pphar, compression, error);
}
halt_offset += got;
@@ -1738,13 +1735,13 @@ static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *a
* if not, check to see if its dirname() exists (i.e. "/path/to") and is a directory
* succeed if we are creating the file, otherwise fail.
*/
-static int phar_analyze_path(const char *fname, const char *ext, int ext_len, int for_create TSRMLS_DC) /* {{{ */
+static int phar_analyze_path(const char *fname, const char *ext, int ext_len, int for_create) /* {{{ */
{
php_stream_statbuf ssb;
char *realpath;
char *filename = estrndup(fname, (ext - fname) + ext_len);
- if ((realpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if ((realpath = expand_filepath(filename, NULL))) {
#ifdef PHP_WIN32
phar_unixify_path_separators(realpath, strlen(realpath));
#endif
@@ -1791,7 +1788,7 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
if (SUCCESS != php_stream_stat_path((char *) filename, &ssb)) {
if (!slash) {
- if (!(realpath = expand_filepath(filename, NULL TSRMLS_CC))) {
+ if (!(realpath = expand_filepath(filename, NULL))) {
efree(filename);
return FAILURE;
}
@@ -1840,7 +1837,7 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
/* }}} */
/* check for ".phar" in extension */
-static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create TSRMLS_DC) /* {{{ */
+static int phar_check_str(const char *fname, const char *ext_str, int ext_len, int executable, int for_create) /* {{{ */
{
char test[51];
const char *pos;
@@ -1859,7 +1856,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
if (pos && (*(pos - 1) != '/')
&& (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
} else {
return FAILURE;
}
@@ -1870,11 +1867,11 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
pos = strstr(ext_str, ".phar");
if (!(pos && (*(pos - 1) != '/')
&& (pos += 5) && (*pos == '\0' || *pos == '/' || *pos == '.')) && *(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
}
} else {
if (*(ext_str + 1) != '.' && *(ext_str + 1) != '/' && *(ext_str + 1) != '\0') {
- return phar_analyze_path(fname, ext_str, ext_len, for_create TSRMLS_CC);
+ return phar_analyze_path(fname, ext_str, ext_len, for_create);
}
}
@@ -1895,7 +1892,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i
* the last parameter should be set to tell the thing to assume that filename is the full path, and only to check the
* extension rules, not to iterate.
*/
-int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete TSRMLS_DC) /* {{{ */
+int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete) /* {{{ */
{
const char *pos, *slash;
@@ -1906,7 +1903,7 @@ int phar_detect_phar_fname_ext(const char *filename, int filename_len, const cha
return FAILURE;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
/* first check for alias in first segment */
pos = memchr(filename, '/', filename_len);
@@ -2023,7 +2020,7 @@ next_extension:
*ext_len = strlen(pos);
/* file extension must contain "phar" */
- switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create TSRMLS_CC)) {
+ switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create)) {
case SUCCESS:
return SUCCESS;
case FAILURE:
@@ -2036,7 +2033,7 @@ next_extension:
*ext_str = pos;
*ext_len = slash - pos;
- switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create TSRMLS_CC)) {
+ switch (phar_check_str(filename, *ext_str, *ext_len, executable, for_create)) {
case SUCCESS:
return SUCCESS;
case FAILURE:
@@ -2075,7 +2072,7 @@ static int php_check_dots(const char *element, int n) /* {{{ */
/**
* Remove .. and . references within a phar filename
*/
-char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{ */
+char *phar_fix_filepath(char *path, int *new_len, int use_cwd) /* {{{ */
{
char newpath[MAXPATHLEN];
int newpath_len;
@@ -2183,7 +2180,7 @@ last_time:
*
* This is used by phar_parse_url()
*/
-int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC) /* {{{ */
+int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create) /* {{{ */
{
const char *ext_str;
#ifdef PHP_WIN32
@@ -2202,7 +2199,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
filename = estrndup(filename, filename_len);
phar_unixify_path_separators(filename, filename_len);
#endif
- if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0 TSRMLS_CC) == FAILURE) {
+ if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0) == FAILURE) {
if (ext_len != -1) {
if (!ext_str) {
/* no / detected, restore arch for error message */
@@ -2232,7 +2229,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
#ifdef PHP_WIN32
phar_unixify_path_separators(*entry, *entry_len);
#endif
- *entry = phar_fix_filepath(*entry, entry_len, 0 TSRMLS_CC);
+ *entry = phar_fix_filepath(*entry, entry_len, 0);
} else {
*entry_len = 1;
*entry = estrndup("/", 1);
@@ -2250,7 +2247,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
* Invoked when a user calls Phar::mapPhar() from within an executing .phar
* to set up its manifest directly
*/
-int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
+int phar_open_executed_filename(char *alias, int alias_len, char **error) /* {{{ */
{
char *fname;
php_stream *fp;
@@ -2262,10 +2259,10 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
*error = NULL;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, 0, REPORT_ERRORS, NULL, 0 TSRMLS_CC) == SUCCESS) {
+ if (phar_open_parsed_phar(fname, fname_len, alias, alias_len, 0, REPORT_ERRORS, NULL, 0) == SUCCESS) {
return SUCCESS;
}
@@ -2276,7 +2273,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
return FAILURE;
}
- if (0 == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1 TSRMLS_CC)) {
+ if (0 == zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) {
if (error) {
spprintf(error, 0, "__HALT_COMPILER(); must be declared in a phar");
}
@@ -2290,7 +2287,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
+ if (php_check_open_basedir(fname)) {
return FAILURE;
}
@@ -2311,7 +2308,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
fname_len = strlen(actual);
}
- ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error TSRMLS_CC);
+ ret = phar_open_from_fp(fp, fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, 0, error);
if (actual) {
efree(actual);
@@ -2324,7 +2321,7 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_
/**
* Validate the CRC32 of a file opened from within the phar
*/
-int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip TSRMLS_DC) /* {{{ */
+int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip) /* {{{ */
{
php_uint32 crc = ~0;
int len = idata->internal_file->uncompressed_filesize;
@@ -2340,13 +2337,13 @@ int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error
phar_zip_file_header local;
phar_zip_data_desc desc;
- if (SUCCESS != phar_open_archive_fp(idata->phar TSRMLS_CC)) {
+ if (SUCCESS != phar_open_archive_fp(idata->phar)) {
spprintf(error, 0, "phar error: unable to open zip-based phar archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
return FAILURE;
}
- php_stream_seek(phar_get_entrypfp(idata->internal_file TSRMLS_CC), entry->header_offset, SEEK_SET);
+ php_stream_seek(phar_get_entrypfp(idata->internal_file), entry->header_offset, SEEK_SET);
- if (sizeof(local) != php_stream_read(phar_get_entrypfp(idata->internal_file TSRMLS_CC), (char *) &local, sizeof(local))) {
+ if (sizeof(local) != php_stream_read(phar_get_entrypfp(idata->internal_file), (char *) &local, sizeof(local))) {
spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
return FAILURE;
@@ -2354,12 +2351,12 @@ int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error
/* check for data descriptor */
if (((PHAR_ZIP_16(local.flags)) & 0x8) == 0x8) {
- php_stream_seek(phar_get_entrypfp(idata->internal_file TSRMLS_CC),
+ php_stream_seek(phar_get_entrypfp(idata->internal_file),
entry->header_offset + sizeof(local) +
PHAR_ZIP_16(local.filename_len) +
PHAR_ZIP_16(local.extra_len) +
entry->compressed_filesize, SEEK_SET);
- if (sizeof(desc) != php_stream_read(phar_get_entrypfp(idata->internal_file TSRMLS_CC),
+ if (sizeof(desc) != php_stream_read(phar_get_entrypfp(idata->internal_file),
(char *) &desc, sizeof(desc))) {
spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
return FAILURE;
@@ -2420,7 +2417,7 @@ static inline void phar_set_32(char *buffer, int var) /* {{{ */
#endif
} /* }}} */
-static int phar_flush_clean_deleted_apply(zval *zv TSRMLS_DC) /* {{{ */
+static int phar_flush_clean_deleted_apply(zval *zv) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
@@ -2434,7 +2431,7 @@ static int phar_flush_clean_deleted_apply(zval *zv TSRMLS_DC) /* {{{ */
#include "stub.h"
-char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error TSRMLS_DC) /* {{{ */
+char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error) /* {{{ */
{
char *stub = NULL;
int index_len, web_len;
@@ -2475,7 +2472,7 @@ char *phar_create_default_stub(const char *index_php, const char *web_index, siz
}
}
- phar_get_stub(index_php, web_index, len, &stub, index_len+1, web_len+1 TSRMLS_CC);
+ phar_get_stub(index_php, web_index, len, &stub, index_len+1, web_len+1);
return stub;
}
/* }}} */
@@ -2486,7 +2483,7 @@ char *phar_create_default_stub(const char *index_php, const char *web_index, siz
* user_stub contains either a string, or a resource pointer, if len is a negative length.
* user_stub and len should be both 0 if the default or existing stub should be used
*/
-int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int convert, char **error TSRMLS_DC) /* {{{ */
+int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int convert, char **error) /* {{{ */
{
char halt_stub[] = "__HALT_COMPILER();";
char *newstub, *tmp;
@@ -2524,11 +2521,11 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
zend_hash_clean(&phar->virtual_dirs);
if (phar->is_zip) {
- return phar_zip_flush(phar, user_stub, len, convert, error TSRMLS_CC);
+ return phar_zip_flush(phar, user_stub, len, convert, error);
}
if (phar->is_tar) {
- return phar_tar_flush(phar, user_stub, len, convert, error TSRMLS_CC);
+ return phar_tar_flush(phar, user_stub, len, convert, error);
}
if (PHAR_G(readonly)) {
@@ -2635,7 +2632,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
newstub = NULL;
} else {
/* this is either a brand new phar or a default stub overwrite */
- newstub = phar_create_default_stub(NULL, NULL, &(phar->halt_offset), NULL TSRMLS_CC);
+ newstub = phar_create_default_stub(NULL, NULL, &(phar->halt_offset), NULL);
written = php_stream_write(newfile, newstub, phar->halt_offset);
}
if (phar->halt_offset != written) {
@@ -2665,13 +2662,13 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
/* Check whether we can get rid of some of the deleted entries which are
* unused. However some might still be in use so even after this clean-up
* we need to skip entries marked is_deleted. */
- zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply TSRMLS_CC);
+ zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply);
/* compress as necessary, calculate crcs, serialize meta-data, manifest size, and file sizes */
main_metadata_str.s = NULL;
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
}
new_manifest_count = 0;
@@ -2705,7 +2702,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
/* after excluding deleted files, calculate manifest size in bytes and number of entries */
++new_manifest_count;
- phar_add_virtual_dirs(phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
if (entry->is_dir) {
/* we use this to calculate API version, 1.1.1 is used for phars with directories */
@@ -2717,7 +2714,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
} else {
if (entry->metadata_str.s) {
@@ -2737,9 +2734,9 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
continue;
}
- if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
+ if (!phar_get_efp(entry, 0)) {
/* re-open internal file pointer just-in-time */
- newentry = phar_open_jit(phar, entry, error TSRMLS_CC);
+ newentry = phar_open_jit(phar, entry, error);
if (!newentry) {
/* major problem re-opening, so we ignore this file and the error */
efree(*error);
@@ -2748,8 +2745,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
entry = newentry;
}
- file = phar_get_efp(entry, 0 TSRMLS_CC);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC)) {
+ file = phar_get_efp(entry, 0);
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -2771,7 +2768,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
entry->compressed_filesize = entry->uncompressed_filesize;
continue;
}
- filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
if (!filter) {
if (closeoldfile) {
php_stream_close(oldfile);
@@ -2804,7 +2801,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
return EOF;
}
php_stream_flush(file);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -2827,7 +2824,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
}
php_stream_filter_flush(filter, 1);
php_stream_flush(entry->cfp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_seek(entry->cfp, 0, SEEK_END);
entry->compressed_filesize = (php_uint32) php_stream_tell(entry->cfp);
/* generate crc on compressed file */
@@ -3021,8 +3018,8 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
file = entry->cfp;
php_stream_rewind(file);
} else {
- file = phar_get_efp(entry, 0 TSRMLS_CC);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ file = phar_get_efp(entry, 0);
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -3110,7 +3107,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
char *digest = NULL;
int digest_len;
- if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error)) {
if (error) {
char *save = *error;
spprintf(error, 0, "phar error: unable to write signature: %s", save);
@@ -3183,7 +3180,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
array_init(&filterparams);
add_assoc_long(&filterparams, "window", MAX_WBITS+16);
- filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -3196,16 +3193,16 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
- filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
@@ -3243,26 +3240,26 @@ zend_function_entry phar_functions[] = {
};
/* }}}*/
-static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len TSRMLS_DC) /* {{{ */
+static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len) /* {{{ */
{
- return php_stream_read(phar_get_pharfp((phar_archive_data*)handle TSRMLS_CC), buf, len);
+ return php_stream_read(phar_get_pharfp((phar_archive_data*)handle), buf, len);
}
/* }}} */
-static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */
+static size_t phar_zend_stream_fsizer(void *handle) /* {{{ */
{
return ((phar_archive_data*)handle)->halt_offset + 32;
} /* }}} */
-zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
+zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type);
#define phar_orig_zend_open zend_stream_open_function
-static char *phar_resolve_path(const char *filename, int filename_len TSRMLS_DC)
+static char *phar_resolve_path(const char *filename, int filename_len)
{
- return phar_find_in_include_path((char *) filename, filename_len, NULL TSRMLS_CC);
+ return phar_find_in_include_path((char *) filename, filename_len, NULL);
}
-static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) /* {{{ */
+static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) /* {{{ */
{
zend_op_array *res;
char *name = NULL;
@@ -3270,16 +3267,16 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
phar_archive_data *phar;
if (!file_handle || !file_handle->filename) {
- return phar_orig_compile_file(file_handle, type TSRMLS_CC);
+ return phar_orig_compile_file(file_handle, type);
}
if (strstr(file_handle->filename, ".phar") && !strstr(file_handle->filename, "://")) {
- if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL TSRMLS_CC)) {
+ if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL)) {
if (phar->is_zip || phar->is_tar) {
zend_file_handle f = *file_handle;
/* zip or tar-based phar */
spprintf(&name, 4096, "phar://%s/%s", file_handle->filename, ".phar/stub.php");
- if (SUCCESS == phar_orig_zend_open((const char *)name, file_handle TSRMLS_CC)) {
+ if (SUCCESS == phar_orig_zend_open((const char *)name, file_handle)) {
efree(name);
name = NULL;
file_handle->filename = f.filename;
@@ -3311,7 +3308,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
zend_try {
failed = 0;
CG(zend_lineno) = 0;
- res = phar_orig_compile_file(file_handle, type TSRMLS_CC);
+ res = phar_orig_compile_file(file_handle, type);
} zend_catch {
failed = 1;
res = NULL;
@@ -3329,7 +3326,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type
}
/* }}} */
-typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int TSRMLS_DC);
+typedef zend_op_array* (zend_compile_t)(zend_file_handle*, int);
typedef zend_compile_t* (compile_hook)(zend_compile_t *ptr);
static void mime_type_dtor(zval *zv)
@@ -3396,7 +3393,7 @@ PHP_GINIT_FUNCTION(phar) /* {{{ */
PHAR_SET_MIME("image/xbm", PHAR_MIME_OTHER, "xbm")
PHAR_SET_MIME("text/xml", PHAR_MIME_OTHER, "xml")
- phar_restore_orig_functions(TSRMLS_C);
+ phar_restore_orig_functions();
}
/* }}} */
@@ -3416,20 +3413,20 @@ PHP_MINIT_FUNCTION(phar) /* {{{ */
phar_save_resolve_path = zend_resolve_path;
zend_resolve_path = phar_resolve_path;
- phar_object_init(TSRMLS_C);
+ phar_object_init();
- phar_intercept_functions_init(TSRMLS_C);
- phar_save_orig_functions(TSRMLS_C);
+ phar_intercept_functions_init();
+ phar_save_orig_functions();
- return php_register_url_stream_wrapper("phar", &php_stream_phar_wrapper TSRMLS_CC);
+ return php_register_url_stream_wrapper("phar", &php_stream_phar_wrapper);
}
/* }}} */
PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
{
- php_unregister_url_stream_wrapper("phar" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("phar");
- phar_intercept_functions_shutdown(TSRMLS_C);
+ phar_intercept_functions_shutdown();
if (zend_compile_file == phar_compile_file) {
zend_compile_file = phar_orig_compile_file;
@@ -3444,7 +3441,7 @@ PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
}
/* }}} */
-void phar_request_initialize(TSRMLS_D) /* {{{ */
+void phar_request_initialize(void) /* {{{ */
{
if (!PHAR_GLOBALS->request_init)
{
@@ -3488,7 +3485,7 @@ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
if (PHAR_GLOBALS->request_init)
{
- phar_release_functions(TSRMLS_C);
+ phar_release_functions();
zend_hash_destroy(&(PHAR_GLOBALS->phar_alias_map));
PHAR_GLOBALS->phar_alias_map.arHash = NULL;
zend_hash_destroy(&(PHAR_GLOBALS->phar_fname_map));
@@ -3529,7 +3526,7 @@ PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
PHP_MINFO_FUNCTION(phar) /* {{{ */
{
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
php_info_print_table_start();
php_info_print_table_header(2, "Phar: PHP Archive support", "enabled");
php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION);
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 7fe647b97d..fed80029f6 100644
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -346,7 +346,7 @@ struct _phar_entry_fp {
phar_entry_fp_info *manifest;
};
-static inline php_stream *phar_get_entrypfp(phar_entry_info *entry TSRMLS_DC)
+static inline php_stream *phar_get_entrypfp(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->phar->fp;
@@ -354,7 +354,7 @@ static inline php_stream *phar_get_entrypfp(phar_entry_info *entry TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].fp;
}
-static inline php_stream *phar_get_entrypufp(phar_entry_info *entry TSRMLS_DC)
+static inline php_stream *phar_get_entrypufp(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->phar->ufp;
@@ -362,7 +362,7 @@ static inline php_stream *phar_get_entrypufp(phar_entry_info *entry TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].ufp;
}
-static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp TSRMLS_DC)
+static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp)
{
if (!entry->phar->is_persistent) {
entry->phar->fp = fp;
@@ -372,7 +372,7 @@ static inline void phar_set_entrypfp(phar_entry_info *entry, php_stream *fp TSRM
PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].fp = fp;
}
-static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp TSRMLS_DC)
+static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp)
{
if (!entry->phar->is_persistent) {
entry->phar->ufp = fp;
@@ -382,7 +382,7 @@ static inline void phar_set_entrypufp(phar_entry_info *entry, php_stream *fp TSR
PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].ufp = fp;
}
-static inline php_stream *phar_get_pharfp(phar_archive_data *phar TSRMLS_DC)
+static inline php_stream *phar_get_pharfp(phar_archive_data *phar)
{
if (!phar->is_persistent) {
return phar->fp;
@@ -390,7 +390,7 @@ static inline php_stream *phar_get_pharfp(phar_archive_data *phar TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[phar->phar_pos].fp;
}
-static inline php_stream *phar_get_pharufp(phar_archive_data *phar TSRMLS_DC)
+static inline php_stream *phar_get_pharufp(phar_archive_data *phar)
{
if (!phar->is_persistent) {
return phar->ufp;
@@ -398,7 +398,7 @@ static inline php_stream *phar_get_pharufp(phar_archive_data *phar TSRMLS_DC)
return PHAR_GLOBALS->cached_fp[phar->phar_pos].ufp;
}
-static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp TSRMLS_DC)
+static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp)
{
if (!phar->is_persistent) {
phar->fp = fp;
@@ -408,7 +408,7 @@ static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp TSRML
PHAR_GLOBALS->cached_fp[phar->phar_pos].fp = fp;
}
-static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp TSRMLS_DC)
+static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp)
{
if (!phar->is_persistent) {
phar->ufp = fp;
@@ -418,7 +418,7 @@ static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp TSRM
PHAR_GLOBALS->cached_fp[phar->phar_pos].ufp = fp;
}
-static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zend_off_t offset TSRMLS_DC)
+static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type type, zend_off_t offset)
{
phar_entry_fp_info *data;
@@ -432,7 +432,7 @@ static inline void phar_set_fp_type(phar_entry_info *entry, enum phar_fp_type ty
data->offset = offset;
}
-static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry TSRMLS_DC)
+static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->fp_type;
@@ -440,7 +440,7 @@ static inline enum phar_fp_type phar_get_fp_type(phar_entry_info *entry TSRMLS_D
return PHAR_GLOBALS->cached_fp[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type;
}
-static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry TSRMLS_DC)
+static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry)
{
if (!entry->is_persistent) {
return entry->offset;
@@ -495,7 +495,7 @@ union _phar_entry_object {
#endif
#ifndef PHAR_MAIN
-extern char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
+extern char *(*phar_save_resolve_path)(const char *filename, int filename_len);
#endif
BEGIN_EXTERN_C()
@@ -525,7 +525,7 @@ static inline int phar_validate_alias(const char *alias, int alias_len) /* {{{ *
}
/* }}} */
-static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+static inline void phar_set_inode(phar_entry_info *entry) /* {{{ */
{
char tmp[MAXPATHLEN];
int tmp_len;
@@ -537,75 +537,75 @@ static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
}
/* }}} */
-void phar_request_initialize(TSRMLS_D);
+void phar_request_initialize(void);
-void phar_object_init(TSRMLS_D);
-void phar_destroy_phar_data(phar_archive_data *phar TSRMLS_DC);
+void phar_object_init(void);
+void phar_destroy_phar_data(phar_archive_data *phar);
-int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip TSRMLS_DC);
-int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_executed_filename(char *alias, int alias_len, char **error TSRMLS_DC);
-int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC);
-int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC);
-int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error TSRMLS_DC);
-int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC);
+int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_postprocess_file(phar_entry_data *idata, php_uint32 crc32, char **error, int process_zip);
+int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error);
+int phar_open_or_create_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_open_executed_filename(char *alias, int alias_len, char **error);
+int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len);
+int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error);
+int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error);
+int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error);
/* utility functions */
-char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error TSRMLS_DC);
+char *phar_create_default_stub(const char *index_php, const char *web_index, size_t *len, char **error);
char *phar_decompress_filter(phar_entry_info * entry, int return_unknown);
char *phar_compress_filter(phar_entry_info * entry, int return_unknown);
-void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC);
-void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC);
-int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len TSRMLS_DC);
-char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar TSRMLS_DC);
-char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC);
-phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len TSRMLS_DC);
+void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
+void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
+int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len);
+char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar);
+char *phar_fix_filepath(char *path, int *new_len, int use_cwd);
+phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_parse_metadata(char **buffer, zval *metadata, int zip_metadata_len);
void destroy_phar_manifest_entry(zval *zv);
-int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC);
-php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC);
-int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC);
-int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TSRMLS_DC);
-phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC);
-int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC);
-int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC);
-int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC);
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links);
+php_stream *phar_get_efp(phar_entry_info *entry, int follow_links);
+int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error);
+int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links);
+phar_entry_info *phar_get_link_source(phar_entry_info *entry);
+int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error);
+int phar_separate_entry_fp(phar_entry_info *entry, char **error);
+int phar_open_archive_fp(phar_archive_data *phar);
+int phar_copy_on_write(phar_archive_data **pphar);
/* tar functions in tar.c */
int phar_is_tar(char *buf, char *fname);
-int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC);
-int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC);
+int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error);
+int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error);
/* zip functions in zip.c */
-int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
-int phar_zip_flush(phar_archive_data *archive, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC);
+int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error);
+int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error);
+int phar_zip_flush(phar_archive_data *archive, char *user_stub, zend_long len, int defaultstub, char **error);
#ifdef PHAR_MAIN
-static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error TSRMLS_DC);
+static int phar_open_from_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, int is_data, char **error);
extern php_stream_wrapper php_stream_phar_wrapper;
#else
extern HashTable cached_phars;
extern HashTable cached_alias;
#endif
-int phar_archive_delref(phar_archive_data *phar TSRMLS_DC);
-int phar_entry_delref(phar_entry_data *idata TSRMLS_DC);
+int phar_archive_delref(phar_archive_data *phar);
+int phar_entry_delref(phar_entry_data *idata);
-phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC);
-phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC);
-phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC);
-int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC);
-int phar_flush(phar_archive_data *archive, char *user_stub, zend_long len, int convert, char **error TSRMLS_DC);
-int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete TSRMLS_DC);
-int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create TSRMLS_DC);
+phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security);
+phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security);
+phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security);
+int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security);
+int phar_flush(phar_archive_data *archive, char *user_stub, zend_long len, int convert, char **error);
+int phar_detect_phar_fname_ext(const char *filename, int filename_len, const char **ext_str, int *ext_len, int executable, int for_create, int is_complete);
+int phar_split_fname(const char *filename, int filename_len, char **arch, int *arch_len, char **entry, int *entry_len, int executable, int for_create);
typedef enum {
pcr_use_query,
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index d23c7cd6c6..70577ff496 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -36,7 +36,7 @@ static zend_class_entry *phar_ce_entry;
# define PHAR_ARG_INFO static
#endif
-static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_DC) /* {{{ */
+static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ */
{
char *ext;
phar_mime_type *mime;
@@ -56,7 +56,7 @@ static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_
}
/* }}} */
-static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len TSRMLS_DC) /* {{{ */
+static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int request_uri_len) /* {{{ */
{
HashTable *_SERVER;
zval *stuff;
@@ -142,7 +142,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
}
/* }}} */
-static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */
+static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len) /* {{{ */
{
char *name = NULL, buf[8192];
const char *cwd;
@@ -168,7 +168,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
php_get_highlight_struct(&syntax_highlighter_ini);
- highlight_file(name, &syntax_highlighter_ini TSRMLS_CC);
+ highlight_file(name, &syntax_highlighter_ini);
efree(name);
#ifdef PHP_WIN32
@@ -179,32 +179,32 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
/* send headers, output file contents */
efree(basename);
ctr.line_len = spprintf(&(ctr.line), 0, "Content-type: %s", mime_type);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
efree(ctr.line);
ctr.line_len = spprintf(&(ctr.line), 0, "Content-length: %u", info->uncompressed_filesize);
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
efree(ctr.line);
- if (FAILURE == sapi_send_headers(TSRMLS_C)) {
+ if (FAILURE == sapi_send_headers()) {
zend_bailout();
}
/* prepare to output */
- fp = phar_get_efp(info, 1 TSRMLS_CC);
+ fp = phar_get_efp(info, 1);
if (!fp) {
char *error;
- if (!phar_open_jit(phar, info, &error TSRMLS_CC)) {
+ if (!phar_open_jit(phar, info, &error)) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
return -1;
}
- fp = phar_get_efp(info, 1 TSRMLS_CC);
+ fp = phar_get_efp(info, 1);
}
position = 0;
- phar_seek_efp(info, 0, SEEK_SET, 0, 1 TSRMLS_CC);
+ phar_seek_efp(info, 0, SEEK_SET, 0, 1);
do {
got = php_stream_read(fp, buf, MIN(8192, info->uncompressed_filesize - position));
@@ -220,7 +220,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
zend_bailout();
case PHAR_MIME_PHP:
if (basename) {
- phar_mung_server_vars(arch, entry, entry_len, basename, ru_len TSRMLS_CC);
+ phar_mung_server_vars(arch, entry, entry_len, basename, ru_len);
efree(basename);
}
@@ -256,13 +256,13 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
}
- new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE);
if (!new_op_array) {
zend_hash_str_del(&EG(included_files), name, name_len);
}
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
} else {
efree(name);
@@ -275,7 +275,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
ZVAL_UNDEF(&result);
zend_try {
- zend_execute(new_op_array, &result TSRMLS_CC);
+ zend_execute(new_op_array, &result);
if (PHAR_G(cwd)) {
efree(PHAR_G(cwd));
PHAR_G(cwd) = NULL;
@@ -284,7 +284,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
PHAR_G(cwd_init) = 0;
efree(name);
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree(new_op_array);
zval_ptr_dtor(&result);
} zend_catch {
@@ -307,31 +307,31 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
}
/* }}} */
-static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
+static void phar_do_403(char *entry, int entry_len) /* {{{ */
{
sapi_header_line ctr = {0};
ctr.response_code = 403;
ctr.line_len = sizeof("HTTP/1.0 403 Access Denied")-1;
ctr.line = "HTTP/1.0 403 Access Denied";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
PHPWRITE("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ", sizeof("<html>\n <head>\n <title>Access Denied</title>\n </head>\n <body>\n <h1>403 - File ") - 1);
PHPWRITE(entry, entry_len);
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
}
/* }}} */
-static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len TSRMLS_DC) /* {{{ */
+static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len) /* {{{ */
{
sapi_header_line ctr = {0};
phar_entry_info *info;
if (phar && f404_len) {
- info = phar_get_entry_info(phar, f404, f404_len, NULL, 1 TSRMLS_CC);
+ info = phar_get_entry_info(phar, f404, f404_len, NULL, 1);
if (info) {
- phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0 TSRMLS_CC);
+ phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0);
return;
}
}
@@ -339,8 +339,8 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
ctr.response_code = 404;
ctr.line_len = sizeof("HTTP/1.0 404 Not Found")-1;
ctr.line = "HTTP/1.0 404 Not Found";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
PHPWRITE("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ", sizeof("<html>\n <head>\n <title>File Not Found</title>\n </head>\n <body>\n <h1>404 - File ") - 1);
PHPWRITE(entry, entry_len);
PHPWRITE(" Not Found</h1>\n </body>\n</html>", sizeof(" Not Found</h1>\n </body>\n</html>") - 1);
@@ -350,7 +350,7 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
-static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char **ru, int *ru_len TSRMLS_DC) /* {{{ */
+static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char **ru, int *ru_len) /* {{{ */
{
char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL;
int e_len = *entry_len - 1, u_len = 0;
@@ -421,14 +421,14 @@ PHP_METHOD(Phar, running)
int fname_len, arch_len, entry_len;
zend_bool retphar = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &retphar) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &retphar) == FAILURE) {
return;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
if (retphar) {
RETVAL_STRINGL(fname, arch_len + 7);
@@ -459,35 +459,35 @@ PHP_METHOD(Phar, mount)
size_t path_len, actual_len;
phar_archive_data *pphar;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &actual, &actual_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &path, &path_len, &actual, &actual_len) == FAILURE) {
return;
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
#ifdef PHP_WIN32
phar_unixify_path_separators(fname, fname_len);
#endif
- if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
efree(entry);
entry = NULL;
if (path_len > 7 && !memcmp(path, "phar://", 7)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Can only mount internal paths within a phar archive, use a relative path instead of \"%s\"", path);
efree(arch);
return;
}
carry_on2:
if (NULL == (pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len))) {
if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, arch, arch_len))) {
- if (SUCCESS == phar_copy_on_write(&pphar TSRMLS_CC)) {
+ if (SUCCESS == phar_copy_on_write(&pphar)) {
goto carry_on;
}
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s is not a phar archive, cannot mount", arch);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s is not a phar archive, cannot mount", arch);
if (arch) {
efree(arch);
@@ -495,8 +495,8 @@ carry_on2:
return;
}
carry_on:
- if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Mounting of %s to %s within phar %s failed", path, actual, arch);
+ if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch);
if (path && path == entry) {
efree(entry);
}
@@ -520,18 +520,18 @@ carry_on:
} else if (PHAR_GLOBALS->phar_fname_map.arHash && NULL != (pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), fname, fname_len))) {
goto carry_on;
} else if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, fname, fname_len))) {
- if (SUCCESS == phar_copy_on_write(&pphar TSRMLS_CC)) {
+ if (SUCCESS == phar_copy_on_write(&pphar)) {
goto carry_on;
}
goto carry_on;
- } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
path = entry;
path_len = entry_len;
goto carry_on2;
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Mounting of %s to %s failed", path, actual);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s failed", path, actual);
}
/* }}} */
@@ -555,17 +555,17 @@ PHP_METHOD(Phar, webPhar)
phar_entry_info *info = NULL;
size_t sapi_mod_name_len = strlen(sapi_module.name);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!saz", &alias, &alias_len, &index_php, &index_php_len, &f404, &f404_len, &mimeoverride, &rewrite) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ phar_request_initialize();
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
- if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) {
+ if (phar_open_executed_filename(alias, alias_len, &error) != SUCCESS) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
return;
@@ -621,13 +621,13 @@ PHP_METHOD(Phar, webPhar)
} else {
char *testit;
- testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC);
+ testit = sapi_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1);
if (!(pt = strstr(testit, basename))) {
efree(testit);
return;
}
- path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
+ path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1);
if (path_info) {
entry = path_info;
@@ -667,8 +667,8 @@ PHP_METHOD(Phar, webPhar)
ZVAL_STRINGL(&params, entry, entry_len);
- if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: invalid rewrite callback");
+ if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: invalid rewrite callback");
if (free_pathinfo) {
efree(path_info);
@@ -682,9 +682,9 @@ PHP_METHOD(Phar, webPhar)
Z_ADDREF(params);
fci.retval = &retval;
- if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) {
+ if (FAILURE == zend_call_function(&fci, &fcc)) {
if (!EG(exception)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: failed to call rewrite callback");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: failed to call rewrite callback");
}
if (free_pathinfo) {
@@ -698,7 +698,7 @@ PHP_METHOD(Phar, webPhar)
if (free_pathinfo) {
efree(path_info);
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: rewrite callback must return a string or false");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
return;
}
@@ -710,7 +710,7 @@ PHP_METHOD(Phar, webPhar)
break;
case IS_TRUE:
case IS_FALSE:
- phar_do_403(entry, entry_len TSRMLS_CC);
+ phar_do_403(entry, entry_len);
if (free_pathinfo) {
efree(path_info);
@@ -723,13 +723,13 @@ PHP_METHOD(Phar, webPhar)
efree(path_info);
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar error: rewrite callback must return a string or false");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback must return a string or false");
return;
}
}
if (entry_len) {
- phar_postprocess_ru_web(fname, fname_len, &entry, (int *)&entry_len, &ru, (int *)&ru_len TSRMLS_CC);
+ phar_postprocess_ru_web(fname, fname_len, &entry, (int *)&entry_len, &ru, (int *)&ru_len);
}
if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
@@ -748,9 +748,9 @@ PHP_METHOD(Phar, webPhar)
entry_len = sizeof("/index.php")-1;
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL TSRMLS_CC) ||
- (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
- phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
+ (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
+ phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
if (free_pathinfo) {
efree(path_info);
@@ -763,7 +763,7 @@ PHP_METHOD(Phar, webPhar)
ctr.response_code = 301;
ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")-1;
ctr.line = "HTTP/1.1 301 Moved Permanently";
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
if (not_cgi) {
tmp = strstr(path_info, basename) + fname_len;
@@ -787,16 +787,16 @@ PHP_METHOD(Phar, webPhar)
efree(path_info);
}
- sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
- sapi_send_headers(TSRMLS_C);
+ sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
+ sapi_send_headers();
efree(ctr.line);
zend_bailout();
}
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL TSRMLS_CC) ||
- (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
- phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
+ (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
+ phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -817,7 +817,7 @@ PHP_METHOD(Phar, webPhar)
mime_type = "";
code = Z_LVAL_P(val);
} else {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed");
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -829,7 +829,7 @@ PHP_METHOD(Phar, webPhar)
code = PHAR_MIME_OTHER;
break;
default:
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed");
#ifdef PHP_WIN32
efree(fname);
#endif
@@ -840,9 +840,9 @@ PHP_METHOD(Phar, webPhar)
}
if (!mime_type) {
- code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC);
+ code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type);
}
- phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len TSRMLS_CC);
+ phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len);
}
/* }}} */
@@ -856,26 +856,26 @@ PHP_METHOD(Phar, mungServer)
{
zval *mungvalues, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &mungvalues) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &mungvalues) == FAILURE) {
return;
}
if (!zend_hash_num_elements(Z_ARRVAL_P(mungvalues))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
if (zend_hash_num_elements(Z_ARRVAL_P(mungvalues)) > 4) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(mungvalues), data) {
if (Z_TYPE_P(data) != IS_STRING) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
@@ -912,7 +912,7 @@ PHP_METHOD(Phar, interceptFileFuncs)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- phar_intercept_functions(TSRMLS_C);
+ phar_intercept_functions();
}
/* }}} */
@@ -927,14 +927,14 @@ PHP_METHOD(Phar, createDefaultStub)
size_t index_len = 0, webindex_len = 0;
size_t stub_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ss", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
return;
}
- stub = phar_create_default_stub(index, webindex, &stub_len, &error TSRMLS_CC);
+ stub = phar_create_default_stub(index, webindex, &stub_len, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
return;
}
@@ -952,16 +952,16 @@ PHP_METHOD(Phar, mapPhar)
size_t alias_len = 0;
zend_long dataoffset = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!l", &alias, &alias_len, &dataoffset) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
- RETVAL_BOOL(phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_open_executed_filename(alias, alias_len, &error) == SUCCESS);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} /* }}} */
@@ -973,16 +973,16 @@ PHP_METHOD(Phar, loadPhar)
char *fname, *alias = NULL, *error;
size_t fname_len, alias_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
- RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, &error TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, &error) == SUCCESS);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} /* }}} */
@@ -1004,11 +1004,11 @@ PHP_METHOD(Phar, canCompress)
{
zend_long method = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &method) == FAILURE) {
return;
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
switch (method) {
case PHAR_ENT_COMPRESSED_GZ:
if (PHAR_G(has_zlib)) {
@@ -1053,12 +1053,12 @@ PHP_METHOD(Phar, isValidPharFilename)
int ext_len, is_executable;
zend_bool executable = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &fname, &fname_len, &executable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &fname, &fname_len, &executable) == FAILURE) {
return;
}
is_executable = executable;
- RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1 TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS);
}
/* }}} */
@@ -1066,12 +1066,12 @@ PHP_METHOD(Phar, isValidPharFilename)
/**
* from spl_directory
*/
-static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{{ */
+static void phar_spl_foreign_dtor(spl_filesystem_object *object) /* {{{ */
{
phar_archive_data *phar = (phar_archive_data *) object->oth;
if (!phar->is_persistent) {
- phar_archive_delref(phar TSRMLS_CC);
+ phar_archive_delref(phar);
}
object->oth = NULL;
@@ -1081,7 +1081,7 @@ static void phar_spl_foreign_dtor(spl_filesystem_object *object TSRMLS_DC) /* {{
/**
* from spl_directory
*/
-static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC) /* {{{ */
+static void phar_spl_foreign_clone(spl_filesystem_object *src, spl_filesystem_object *dst) /* {{{ */
{
phar_archive_data *phar_data = (phar_archive_data *) dst->oth;
@@ -1109,7 +1109,7 @@ static spl_other_handler phar_spl_foreign_handler = {
PHP_METHOD(Phar, __construct)
{
#if !HAVE_SPL
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Cannot instantiate Phar object without SPL extension");
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Cannot instantiate Phar object without SPL extension");
#else
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
size_t fname_len, alias_len = 0;
@@ -1122,25 +1122,25 @@ PHP_METHOD(Phar, __construct)
phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
- is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data TSRMLS_CC);
+ is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data);
if (is_data) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!l", &fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ls!l", &fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!", &fname, &fname_len, &flags, &alias, &alias_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ls!", &fname, &fname_len, &flags, &alias, &alias_len) == FAILURE) {
return;
}
}
if (phar_obj->archive) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot call constructor twice");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice");
return;
}
save_fname = fname;
- if (SUCCESS == phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, 2 TSRMLS_CC)) {
+ if (SUCCESS == phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, 2)) {
/* use arch (the basename for the archive) for fname instead of fname */
/* this allows support for RecursiveDirectoryIterator of subdirectories */
#ifdef PHP_WIN32
@@ -1157,7 +1157,7 @@ PHP_METHOD(Phar, __construct)
#endif
}
- if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error TSRMLS_CC) == FAILURE) {
+ if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error) == FAILURE) {
if (fname == arch && fname != save_fname) {
efree(arch);
@@ -1169,11 +1169,11 @@ PHP_METHOD(Phar, __construct)
}
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"%s", error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Phar creation or opening failed");
}
@@ -1192,10 +1192,10 @@ PHP_METHOD(Phar, __construct)
if ((is_data && !phar_data->is_data) || (!is_data && phar_data->is_data)) {
if (is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"PharData class can only be used for non-executable tar and zip archives");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Phar class can only be used for executable tar and zip archives");
}
efree(entry);
@@ -1276,7 +1276,7 @@ PHP_METHOD(Phar, getSupportedCompression)
}
array_init(return_value);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (PHAR_G(has_zlib)) {
add_next_index_stringl(return_value, "GZ", 2);
@@ -1298,31 +1298,31 @@ PHP_METHOD(Phar, unlinkArchive)
int zname_len, arch_len, entry_len;
phar_archive_data *phar;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
RETURN_FALSE;
}
if (!fname_len) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"\"");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"\"");
return;
}
- if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error TSRMLS_CC)) {
+ if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error)) {
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"%s\": %s", fname, error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\": %s", fname, error);
efree(error);
} else {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown phar archive \"%s\"", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\"", fname);
}
return;
}
- zname = (char*)zend_get_executed_filename(TSRMLS_C);
+ zname = (char*)zend_get_executed_filename();
zname_len = strlen(zname);
- if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) {
+ if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) {
if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" cannot be unlinked from within itself", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", fname);
efree(arch);
efree(entry);
return;
@@ -1332,12 +1332,12 @@ PHP_METHOD(Phar, unlinkArchive)
}
if (phar->is_persistent) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" is in phar.cache_list, cannot unlinkArchive()", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" is in phar.cache_list, cannot unlinkArchive()", fname);
return;
}
if (phar->refcount) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar archive \"%s\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", fname);
return;
}
@@ -1347,7 +1347,7 @@ PHP_METHOD(Phar, unlinkArchive)
PHAR_G(last_phar) = NULL;
PHAR_G(last_phar_name) = PHAR_G(last_alias) = NULL;
- phar_archive_delref(phar TSRMLS_CC);
+ phar_archive_delref(phar);
unlink(fname);
efree(fname);
RETURN_TRUE;
@@ -1360,7 +1360,7 @@ PHP_METHOD(Phar, unlinkArchive)
zval *zobj = getThis(); \
phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!phar_obj->archive) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Cannot call method on an uninitialized Phar object"); \
return; \
}
@@ -1389,7 +1389,7 @@ struct _phar_t {
int count;
};
-static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *value;
zend_bool close_fp = 1;
@@ -1404,7 +1404,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
phar_archive_object *phar_obj = p_obj->p;
char *str = "[stream]";
- value = iter->funcs->get_current_data(iter TSRMLS_CC);
+ value = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1412,7 +1412,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
if (!value) {
/* failure in get_current_data */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned no value", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned no value", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1423,13 +1423,13 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
php_stream_from_zval_no_verify(fp, value);
if (!fp) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returned an invalid stream handle", ce->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returned an invalid stream handle", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1437,7 +1437,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
if (Z_TYPE(key) != IS_STRING) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1447,7 +1447,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
save = str_key;
zval_dtor(&key);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1455,21 +1455,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
opened = (char *) estrndup(str, sizeof("[stream]") - 1);
goto after_open_fp;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo)) {
char *test = NULL;
zval dummy;
spl_filesystem_object *intern = (spl_filesystem_object*)((char*)Z_OBJ_P(value) - Z_OBJ_P(value)->handlers->offset);
if (!base_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
switch (intern->type) {
case SPL_FS_DIR:
- test = spl_filesystem_object_get_path(intern, NULL TSRMLS_CC);
+ test = spl_filesystem_object_get_path(intern, NULL);
fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name);
- php_stat(fname, fname_len, FS_IS_DIR, &dummy TSRMLS_CC);
+ php_stat(fname, fname_len, FS_IS_DIR, &dummy);
if (Z_TYPE(dummy) == IS_TRUE) {
/* ignore directories */
@@ -1477,14 +1477,14 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
return ZEND_HASH_APPLY_KEEP;
}
- test = expand_filepath(fname, NULL TSRMLS_CC);
+ test = expand_filepath(fname, NULL);
efree(fname);
if (test) {
fname = test;
fname_len = strlen(fname);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
return ZEND_HASH_APPLY_STOP;
}
@@ -1492,9 +1492,9 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
goto phar_spl_fileinfo;
case SPL_FS_INFO:
case SPL_FS_FILE:
- fname = expand_filepath(intern->file_name, NULL TSRMLS_CC);
+ fname = expand_filepath(intern->file_name, NULL);
if (!fname) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
return ZEND_HASH_APPLY_STOP;
}
@@ -1505,7 +1505,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
/* fall-through */
default:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid value (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid value (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1514,9 +1514,9 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
phar_spl_fileinfo:
if (base_len) {
- temp = expand_filepath(base, NULL TSRMLS_CC);
+ temp = expand_filepath(base, NULL);
if (!temp) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Could not resolve file path");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path");
if (save) {
efree(save);
}
@@ -1545,7 +1545,7 @@ phar_spl_fileinfo:
}
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name->val, fname, base);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name->val, fname, base);
if (save) {
efree(save);
@@ -1557,7 +1557,7 @@ phar_spl_fileinfo:
} else {
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
@@ -1565,7 +1565,7 @@ phar_spl_fileinfo:
if (Z_TYPE(key) != IS_STRING) {
zval_dtor(&key);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
@@ -1575,13 +1575,13 @@ phar_spl_fileinfo:
save = str_key;
zval_dtor(&key);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (must return a string)", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name->val, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name->val, fname);
if (save) {
efree(save);
@@ -1595,8 +1595,8 @@ phar_spl_fileinfo:
}
#endif
- if (php_check_open_basedir(fname TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name->val, fname);
+ if (php_check_open_basedir(fname)) {
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name->val, fname);
if (save) {
efree(save);
@@ -1613,7 +1613,7 @@ phar_spl_fileinfo:
fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened);
if (!fp) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a file that could not be opened \"%s\"", ce->name->val, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a file that could not be opened \"%s\"", ce->name->val, fname);
if (save) {
efree(save);
@@ -1647,8 +1647,8 @@ after_open_fp:
return ZEND_HASH_APPLY_KEEP;
}
- if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, 1 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s cannot be created: %s", str_key, error);
+ if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len, str_key, str_key_len, "w+b", 0, &error, 1))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s cannot be created: %s", str_key, error);
efree(error);
if (save) {
@@ -1704,7 +1704,7 @@ after_open_fp:
}
data->internal_file->compressed_filesize = data->internal_file->uncompressed_filesize = contents_len;
- phar_entry_delref(data TSRMLS_CC);
+ phar_entry_delref(data);
return ZEND_HASH_APPLY_KEEP;
}
@@ -1727,18 +1727,18 @@ PHP_METHOD(Phar, buildFromDirectory)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write to archive - write operations restricted by INI setting");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &dir, &dir_len, &regex, &regex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &dir, &dir_len, &regex, &regex_len) == FAILURE) {
RETURN_FALSE;
}
if (SUCCESS != object_init_ex(&iter, spl_ce_RecursiveDirectoryIterator)) {
zval_ptr_dtor(&iter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1757,7 +1757,7 @@ PHP_METHOD(Phar, buildFromDirectory)
if (SUCCESS != object_init_ex(&iteriter, spl_ce_RecursiveIteratorIterator)) {
zval_ptr_dtor(&iter);
zval_ptr_dtor(&iteriter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1778,7 +1778,7 @@ PHP_METHOD(Phar, buildFromDirectory)
if (SUCCESS != object_init_ex(&regexiter, spl_ce_RegexIterator)) {
zval_ptr_dtor(&iteriter);
zval_dtor(&regexiter);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -1799,21 +1799,21 @@ PHP_METHOD(Phar, buildFromDirectory)
pass.ret = return_value;
pass.fp = php_stream_fopen_tmpfile();
if (pass.fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname);
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
zval_ptr_dtor(&iteriter);
if (apply_reg) {
zval_ptr_dtor(&regexiter);
}
php_stream_close(pass.fp);
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- if (SUCCESS == spl_iterator_apply((apply_reg ? &regexiter : &iteriter), (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) {
+ if (SUCCESS == spl_iterator_apply((apply_reg ? &regexiter : &iteriter), (spl_iterator_apply_func_t) phar_build, (void *) &pass)) {
zval_ptr_dtor(&iteriter);
if (apply_reg) {
@@ -1821,10 +1821,10 @@ PHP_METHOD(Phar, buildFromDirectory)
}
phar_obj->archive->ufp = pass.fp;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -1859,17 +1859,17 @@ PHP_METHOD(Phar, buildFromIterator)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|s", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s", &obj, zend_ce_traversable, &base, &base_len) == FAILURE) {
RETURN_FALSE;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
@@ -1883,15 +1883,15 @@ PHP_METHOD(Phar, buildFromIterator)
pass.count = 0;
pass.fp = php_stream_fopen_tmpfile();
if (pass.fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname);
return;
}
- if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) {
+ if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass)) {
phar_obj->archive->ufp = pass.fp;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
} else {
@@ -1909,7 +1909,7 @@ PHP_METHOD(Phar, count)
zend_long mode;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -1926,7 +1926,7 @@ PHP_METHOD(Phar, isFileFormat)
zend_long type;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
RETURN_FALSE;
}
@@ -1938,40 +1938,40 @@ PHP_METHOD(Phar, isFileFormat)
case PHAR_FORMAT_PHAR:
RETURN_BOOL(!phar_obj->archive->is_tar && !phar_obj->archive->is_zip);
default:
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unknown file format specified");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown file format specified");
}
}
/* }}} */
-static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */
+static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp) /* {{{ */
{
char *error;
zend_off_t offset;
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(entry, &error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, &error, 1)) {
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, entry->filename, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents", entry->phar->fname, entry->filename);
}
return FAILURE;
}
/* copy old contents in entirety */
- phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 1);
offset = php_stream_tell(fp);
- link = phar_get_link_source(entry TSRMLS_CC);
+ link = phar_get_link_source(entry);
if (!link) {
link = entry;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), fp, link->uncompressed_filesize, NULL)) {
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filename);
return FAILURE;
}
@@ -1989,7 +1989,7 @@ static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS
}
/* }}} */
-static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */
+static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress) /* {{{ */
{
const char *oldname = NULL;
char *oldpath = NULL;
@@ -2053,9 +2053,9 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
} else if (phar_path_check(&ext, (int *)&ext_len, &pcr_error) > pcr_is_ok) {
if (phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
}
return NULL;
}
@@ -2084,7 +2084,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, newpath, phar->fname_len))) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", phar->fname);
return NULL;
}
@@ -2097,7 +2097,7 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
pphar->flags = phar->flags;
pphar->fp = phar->fp;
phar->fp = NULL;
- phar_destroy_phar_data(phar TSRMLS_CC);
+ phar_destroy_phar_data(phar);
phar = pphar;
phar->refcount++;
newpath = oldpath;
@@ -2106,19 +2106,19 @@ static zend_object *phar_rename_archive(phar_archive_data *phar, char *ext, zend
}
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", phar->fname);
return NULL;
}
its_ok:
if (SUCCESS == php_stream_stat_path(newpath, &ssb)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
return NULL;
}
if (!phar->is_data) {
- if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 1, 1, 1 TSRMLS_CC)) {
+ if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 1, 1, 1)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", phar->fname, ext);
return NULL;
}
@@ -2136,9 +2136,9 @@ its_ok:
} else {
- if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 0, 1, 1 TSRMLS_CC)) {
+ if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 0, 1, 1)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "data phar \"%s\" has invalid extension %s", phar->fname, ext);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", phar->fname, ext);
return NULL;
}
@@ -2148,14 +2148,14 @@ its_ok:
if ((!pphar || phar == pphar) && NULL == zend_hash_str_update_ptr(&(PHAR_GLOBALS->phar_fname_map), newpath, phar->fname_len, phar)) {
efree(oldpath);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to add newly converted phar \"%s\" to the list of phars", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars", phar->fname);
return NULL;
}
- phar_flush(phar, 0, 0, 1, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 1, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
efree(oldpath);
return NULL;
@@ -2172,7 +2172,7 @@ its_ok:
ZVAL_NULL(&ret);
if (SUCCESS != object_init_ex(&ret, ce)) {
zval_dtor(&ret);
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
return NULL;
}
@@ -2184,7 +2184,7 @@ its_ok:
}
/* }}} */
-static zend_object *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags TSRMLS_DC) /* {{{ */
+static zend_object *phar_convert_to_other(phar_archive_data *source, int convert, char *ext, php_uint32 flags) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry, newentry;
@@ -2220,7 +2220,7 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert
phar->fp = php_stream_fopen_tmpfile();
if (phar->fp == NULL) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file");
+ zend_throw_exception_ex(phar_ce_PharException, 0, "unable to create temporary file");
return NULL;
}
phar->fname = source->fname;
@@ -2250,7 +2250,7 @@ static zend_object *phar_convert_to_other(phar_archive_data *source, int convert
newentry.metadata_str.s = NULL;
- if (FAILURE == phar_copy_file_contents(&newentry, phar->fp TSRMLS_CC)) {
+ if (FAILURE == phar_copy_file_contents(&newentry, phar->fp)) {
zend_hash_destroy(&(phar->manifest));
php_stream_close(phar->fp);
efree(phar);
@@ -2275,12 +2275,12 @@ no_copy:
newentry.is_modified = 1;
newentry.phar = phar;
newentry.old_flags = newentry.flags & ~PHAR_ENT_COMPRESSION_MASK; /* remove compression from old_flags */
- phar_set_inode(&newentry TSRMLS_CC);
+ phar_set_inode(&newentry);
zend_hash_str_add_mem(&(phar->manifest), newentry.filename, newentry.filename_len, (void*)&newentry, sizeof(phar_entry_info));
- phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len);
} ZEND_HASH_FOREACH_END();
- if ((ret = phar_rename_archive(phar, ext, 0 TSRMLS_CC))) {
+ if ((ret = phar_rename_archive(phar, ext, 0))) {
return ret;
} else {
zend_hash_destroy(&(phar->manifest));
@@ -2310,12 +2310,12 @@ PHP_METHOD(Phar, convertToExecutable)
zend_long format = 9021976, method = 9021976;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out executable phar archive, phar is read-only");
return;
}
@@ -2337,7 +2337,7 @@ PHP_METHOD(Phar, convertToExecutable)
case PHAR_FORMAT_ZIP:
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP");
return;
}
@@ -2351,13 +2351,13 @@ PHP_METHOD(Phar, convertToExecutable)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -2366,13 +2366,13 @@ PHP_METHOD(Phar, convertToExecutable)
break;
case PHAR_ENT_COMPRESSED_BZ2:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
@@ -2380,14 +2380,14 @@ PHP_METHOD(Phar, convertToExecutable)
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
is_data = phar_obj->archive->is_data;
phar_obj->archive->is_data = 0;
- ret = phar_convert_to_other(phar_obj->archive, format, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, format, ext, flags);
phar_obj->archive->is_data = is_data;
if (ret) {
@@ -2414,7 +2414,7 @@ PHP_METHOD(Phar, convertToData)
zend_long format = 9021976, method = 9021976;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls", &format, &method, &ext, &ext_len) == FAILURE) {
return;
}
@@ -2427,20 +2427,20 @@ PHP_METHOD(Phar, convertToData)
} else if (phar_obj->archive->is_zip) {
format = PHAR_FORMAT_ZIP;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out data phar archive, use Phar::TAR or Phar::ZIP");
return;
}
break;
case PHAR_FORMAT_PHAR:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out data phar archive, use Phar::TAR or Phar::ZIP");
return;
case PHAR_FORMAT_TAR:
case PHAR_FORMAT_ZIP:
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP");
return;
}
@@ -2454,13 +2454,13 @@ PHP_METHOD(Phar, convertToData)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -2469,13 +2469,13 @@ PHP_METHOD(Phar, convertToData)
break;
case PHAR_ENT_COMPRESSED_BZ2:
if (format == PHAR_FORMAT_ZIP) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, zip archives do not support whole-archive compression");
return;
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
@@ -2483,14 +2483,14 @@ PHP_METHOD(Phar, convertToData)
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
is_data = phar_obj->archive->is_data;
phar_obj->archive->is_data = 1;
- ret = phar_convert_to_other(phar_obj->archive, format, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, format, ext, flags);
phar_obj->archive->is_data = is_data;
if (ret) {
@@ -2565,17 +2565,17 @@ PHP_METHOD(Phar, delete)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
RETURN_FALSE;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) {
@@ -2590,13 +2590,13 @@ PHP_METHOD(Phar, delete)
}
}
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be deleted", fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be deleted", fname);
RETURN_FALSE;
}
- phar_flush(phar_obj->archive, NULL, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, NULL, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -2650,7 +2650,7 @@ PHP_METHOD(Phar, setAlias)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
RETURN_FALSE;
}
@@ -2661,37 +2661,37 @@ PHP_METHOD(Phar, setAlias)
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar alias cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar alias cannot be set in a plain zip archive");
}
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &alias, &alias_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &alias, &alias_len) == SUCCESS) {
if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) {
RETURN_TRUE;
}
if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", alias, fd_ptr->fname);
- if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
efree(error);
goto valid_alias;
}
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
}
if (!phar_validate_alias(alias, alias_len)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname);
RETURN_FALSE;
}
valid_alias:
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), phar_obj->archive->alias, phar_obj->archive->alias_len))) {
@@ -2711,13 +2711,13 @@ valid_alias:
phar_obj->archive->alias_len = alias_len;
phar_obj->archive->is_temporary_alias = 0;
- phar_flush(phar_obj->archive, NULL, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, NULL, 0, 0, &error);
if (error) {
phar_obj->archive->alias = oldalias;
phar_obj->archive->alias_len = oldalias_len;
phar_obj->archive->is_temporary_alias = old_temp;
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
if (readd) {
zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_alias_map), oldalias, oldalias_len, phar_obj->archive);
}
@@ -2797,16 +2797,16 @@ PHP_METHOD(Phar, stopBuffering)
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot write out phar archive, phar is read-only");
return;
}
phar_obj->archive->donotflush = 0;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -2826,52 +2826,52 @@ PHP_METHOD(Phar, setStub)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub, phar is read-only");
return;
}
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain zip archive");
}
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zstub, &len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l", &zstub, &len) == SUCCESS) {
if ((php_stream_from_zval_no_verify(stream, zstub)) != NULL) {
if (len > 0) {
len = -len;
} else {
len = -1;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, (char *) zstub, len, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, (char *) zstub, len, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
RETURN_TRUE;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub, unable to read from input stream");
}
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &stub, &stub_len) == SUCCESS) {
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &stub, &stub_len) == SUCCESS) {
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, stub, stub_len, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, stub, stub_len, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -2905,35 +2905,35 @@ PHP_METHOD(Phar, setDefaultStub)
if (phar_obj->archive->is_data) {
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain tar archive");
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"A Phar stub cannot be set in a plain zip archive");
}
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s", &index, &index_len, &webindex, &webindex_len) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() > 0 && (phar_obj->archive->is_tar || phar_obj->archive->is_zip)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "method accepts no arguments for a tar- or zip-based phar stub, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "method accepts no arguments for a tar- or zip-based phar stub, %d given", ZEND_NUM_ARGS());
RETURN_FALSE;
}
if (PHAR_G(readonly)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot change stub: phar.readonly=1");
RETURN_FALSE;
}
if (!phar_obj->archive->is_tar && !phar_obj->archive->is_zip) {
- stub = phar_create_default_stub(index, webindex, &stub_len, &error TSRMLS_CC);
+ stub = phar_create_default_stub(index, webindex, &stub_len, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "%s", error);
efree(error);
if (stub) {
efree(stub);
@@ -2944,18 +2944,18 @@ PHP_METHOD(Phar, setDefaultStub)
created_stub = 1;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- phar_flush(phar_obj->archive, stub, stub_len, 1, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, stub, stub_len, 1, &error);
if (created_stub) {
efree(stub);
}
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
}
@@ -2979,12 +2979,12 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot set signature algorithm, phar is read-only");
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &algo, &key, &key_len) != SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l|s", &algo, &key, &key_len) != SUCCESS) {
return;
}
@@ -2992,15 +2992,15 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
case PHAR_SIG_SHA256:
case PHAR_SIG_SHA512:
#ifndef PHAR_HASH_OK
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"SHA-256 and SHA-512 signatures are only supported if the hash extension is enabled and built non-shared");
return;
#endif
case PHAR_SIG_MD5:
case PHAR_SIG_SHA1:
case PHAR_SIG_OPENSSL:
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
phar_obj->archive->sig_flags = algo;
@@ -3008,14 +3008,14 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
PHAR_G(openssl_privatekey) = key;
PHAR_G(openssl_privatekey_len) = key_len;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
break;
default:
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Unknown signature algorithm specified");
}
}
@@ -3079,7 +3079,7 @@ PHP_METHOD(Phar, getModified)
}
/* }}} */
-static int phar_set_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_set_compression(zval *zv, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
php_uint32 compress = *(php_uint32 *)argument;
@@ -3096,7 +3096,7 @@ static int phar_set_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int phar_test_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_test_compression(zval *zv, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(zv);
@@ -3120,18 +3120,18 @@ static int phar_test_compression(zval *zv, void *argument TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void pharobj_set_compression(HashTable *manifest, php_uint32 compress TSRMLS_DC) /* {{{ */
+static void pharobj_set_compression(HashTable *manifest, php_uint32 compress) /* {{{ */
{
- zend_hash_apply_with_argument(manifest, phar_set_compression, &compress TSRMLS_CC);
+ zend_hash_apply_with_argument(manifest, phar_set_compression, &compress);
}
/* }}} */
-static int pharobj_cancompress(HashTable *manifest TSRMLS_DC) /* {{{ */
+static int pharobj_cancompress(HashTable *manifest) /* {{{ */
{
int test;
test = 1;
- zend_hash_apply_with_argument(manifest, phar_test_compression, &test TSRMLS_CC);
+ zend_hash_apply_with_argument(manifest, phar_test_compression, &test);
return test;
}
/* }}} */
@@ -3150,18 +3150,18 @@ PHP_METHOD(Phar, compress)
zend_object *ret;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|s", &method, &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s", &method, &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot compress phar archive, phar is read-only");
return;
}
if (phar_obj->archive->is_zip) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot compress zip-based archives with whole-archive compression");
return;
}
@@ -3172,7 +3172,7 @@ PHP_METHOD(Phar, compress)
break;
case PHAR_ENT_COMPRESSED_GZ:
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -3181,22 +3181,22 @@ PHP_METHOD(Phar, compress)
case PHAR_ENT_COMPRESSED_BZ2:
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress entire archive with bz2, enable ext/bz2 in php.ini");
return;
}
flags = PHAR_FILE_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
if (phar_obj->archive->is_tar) {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags);
} else {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags);
}
if (ret) {
@@ -3217,26 +3217,26 @@ PHP_METHOD(Phar, decompress)
zend_object *ret;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext, &ext_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext, &ext_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot decompress phar archive, phar is read-only");
return;
}
if (phar_obj->archive->is_zip) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot decompress zip-based archives with whole-archive compression");
return;
}
if (phar_obj->archive->is_tar) {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE);
} else {
- ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE TSRMLS_CC);
+ ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE);
}
if (ret) {
@@ -3259,12 +3259,12 @@ PHP_METHOD(Phar, compressFiles)
zend_long method;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
@@ -3272,7 +3272,7 @@ PHP_METHOD(Phar, compressFiles)
switch (method) {
case PHAR_ENT_COMPRESSED_GZ:
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress files within archive with gzip, enable ext/zlib in php.ini");
return;
}
@@ -3281,45 +3281,45 @@ PHP_METHOD(Phar, compressFiles)
case PHAR_ENT_COMPRESSED_BZ2:
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress files within archive with bz2, enable ext/bz2 in php.ini");
return;
}
flags = PHAR_ENT_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2");
return;
}
if (phar_obj->archive->is_tar) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with Gzip compression, tar archives cannot compress individual files, use compress() to compress the whole archive");
return;
}
- if (!pharobj_cancompress(&phar_obj->archive->manifest TSRMLS_CC)) {
+ if (!pharobj_cancompress(&phar_obj->archive->manifest)) {
if (flags == PHAR_FILE_COMPRESSED_GZ) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress all files as Gzip, some are compressed as bzip2 and cannot be decompressed");
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress all files as Bzip2, some are compressed as gzip and cannot be decompressed");
}
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- pharobj_set_compression(&phar_obj->archive->manifest, flags TSRMLS_CC);
+ pharobj_set_compression(&phar_obj->archive->manifest, flags);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
}
}
@@ -3338,13 +3338,13 @@ PHP_METHOD(Phar, decompressFiles)
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
- if (!pharobj_cancompress(&phar_obj->archive->manifest TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (!pharobj_cancompress(&phar_obj->archive->manifest)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress all files, some are compressed as bzip2 or gzip and cannot be decompressed");
return;
}
@@ -3352,18 +3352,18 @@ PHP_METHOD(Phar, decompressFiles)
if (phar_obj->archive->is_tar) {
RETURN_TRUE;
} else {
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
- pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE TSRMLS_CC);
+ pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE);
}
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s", error);
efree(error);
}
@@ -3384,39 +3384,39 @@ PHP_METHOD(Phar, copy)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE) {
return;
}
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"Cannot copy \"%s\" to \"%s\", phar is read-only", oldfile, newfile);
RETURN_FALSE;
}
if (oldfile_len >= sizeof(".phar")-1 && !memcmp(oldfile, ".phar", sizeof(".phar")-1)) {
/* can't copy a meta file */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", cannot copy Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (newfile_len >= sizeof(".phar")-1 && !memcmp(newfile, ".phar", sizeof(".phar")-1)) {
/* can't copy a meta file */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", cannot copy to Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (!zend_hash_str_exists(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len) || NULL == (oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint) oldfile_len)) || oldentry->is_deleted) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", file does not exist in %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
if (zend_hash_str_exists(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) {
if (NULL != (temp = zend_hash_str_find_ptr(&phar_obj->archive->manifest, newfile, (uint) newfile_len)) || !temp->is_deleted) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" cannot be copied to file \"%s\", file must not already exist in phar %s", oldfile, newfile, phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -3424,15 +3424,15 @@ PHP_METHOD(Phar, copy)
tmp_len = (int)newfile_len;
if (phar_path_check(&newfile, &tmp_len, &pcr_error) > pcr_is_ok) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0,
"file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname);
RETURN_FALSE;
}
newfile_len = tmp_len;
if (phar_obj->archive->is_persistent) {
- if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
/* re-populate with copied-on-write entry */
@@ -3451,10 +3451,10 @@ PHP_METHOD(Phar, copy)
newentry.fp_refcount = 0;
if (oldentry->fp_type != PHAR_FP) {
- if (FAILURE == phar_copy_entry_fp(oldentry, &newentry, &error TSRMLS_CC)) {
+ if (FAILURE == phar_copy_entry_fp(oldentry, &newentry, &error)) {
efree(newentry.filename);
php_stream_close(newentry.fp);
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
return;
}
@@ -3462,10 +3462,10 @@ PHP_METHOD(Phar, copy)
zend_hash_str_add_mem(&oldentry->phar->manifest, newfile, newfile_len, &newentry, sizeof(phar_entry_info));
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -3484,7 +3484,7 @@ PHP_METHOD(Phar, offsetExists)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
@@ -3522,26 +3522,26 @@ PHP_METHOD(Phar, offsetGet)
zend_string *sfname;
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
/* security is 0 here so that we can get a better error message than "entry doesn't exist" */
- if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist%s%s", fname, error?", ":"", error?error:"");
+ if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", fname, error?", ":"", error?error:"");
} else {
if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname);
return;
}
if (fname_len == sizeof(".phar/alias.txt")-1 && !memcmp(fname, ".phar/alias.txt", sizeof(".phar/alias.txt")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname);
return;
}
if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot directly get any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot directly get any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
return;
}
@@ -3552,7 +3552,7 @@ PHP_METHOD(Phar, offsetGet)
sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, fname);
ZVAL_NEW_STR(&zfname, sfname);
- spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname TSRMLS_CC);
+ spl_instantiate_arg_ex1(phar_obj->spl.info_class, return_value, &zfname);
zval_ptr_dtor(&zfname);
}
}
@@ -3560,7 +3560,7 @@ PHP_METHOD(Phar, offsetGet)
/* {{{ add a file within the phar archive from a string or resource
*/
-static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, size_t cont_len, zval *zresource TSRMLS_DC)
+static void phar_add_file(phar_archive_data **pphar, char *filename, int filename_len, char *cont_str, size_t cont_len, zval *zresource)
{
char *error;
size_t contents_len;
@@ -3568,16 +3568,16 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
php_stream *contents_file;
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
return;
}
- if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, 1 TSRMLS_CC))) {
+ if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, filename, filename_len, "w+b", 0, &error, 1))) {
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be created: %s", filename, error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created: %s", filename, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s does not exist and cannot be created", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be created", filename);
}
return;
} else {
@@ -3589,12 +3589,12 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
if (cont_str) {
contents_len = php_stream_write(data->fp, cont_str, cont_len);
if (contents_len != cont_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s could not be written to", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename);
return;
}
} else {
if (!(php_stream_from_zval_no_verify(contents_file, zresource))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Entry %s could not be written to", filename);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s could not be written to", filename);
return;
}
php_stream_copy_to_stream_ex(contents_file, data->fp, PHP_STREAM_COPY_ALL, &contents_len);
@@ -3607,11 +3607,11 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
if (pphar[0] != data->phar) {
*pphar = data->phar;
}
- phar_entry_delref(data TSRMLS_CC);
- phar_flush(*pphar, 0, 0, 0, &error TSRMLS_CC);
+ phar_entry_delref(data);
+ phar_flush(*pphar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -3620,17 +3620,17 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
/* {{{ create a directory within the phar archive
*/
-static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len TSRMLS_DC)
+static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len)
{
char *error;
phar_entry_data *data;
- if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1 TSRMLS_CC))) {
+ if (!(data = phar_get_or_create_entry_data((*pphar)->fname, (*pphar)->fname_len, dirname, dirname_len, "w+b", 2, &error, 1))) {
if (error) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Directory %s does not exist and cannot be created: %s", dirname, error);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", dirname, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Directory %s does not exist and cannot be created", dirname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created", dirname);
}
return;
@@ -3643,11 +3643,11 @@ static void phar_mkdir(phar_archive_data **pphar, char *dirname, int dirname_len
if (data->phar != *pphar) {
*pphar = data->phar;
}
- phar_entry_delref(data TSRMLS_CC);
- phar_flush(*pphar, 0, 0, 0, &error TSRMLS_CC);
+ phar_entry_delref(data);
+ phar_flush(*pphar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -3665,31 +3665,31 @@ PHP_METHOD(Phar, offsetSet)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sr", &fname, &fname_len, &zresource) == FAILURE
- && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sr", &fname, &fname_len, &zresource) == FAILURE
+ && zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {
return;
}
if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname);
return;
}
if (fname_len == sizeof(".phar/alias.txt")-1 && !memcmp(fname, ".phar/alias.txt", sizeof(".phar/alias.txt")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname);
return;
}
if (fname_len >= sizeof(".phar")-1 && !memcmp(fname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot set any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set any files or directories in magic \".phar\" directory", phar_obj->archive->fname);
return;
}
- phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource);
}
/* }}} */
@@ -3704,11 +3704,11 @@ PHP_METHOD(Phar, offsetUnset)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
@@ -3720,8 +3720,8 @@ PHP_METHOD(Phar, offsetUnset)
}
if (phar_obj->archive->is_persistent) {
- if (FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
/* re-populate entry after copy on write */
@@ -3730,10 +3730,10 @@ PHP_METHOD(Phar, offsetUnset)
entry->is_modified = 0;
entry->is_deleted = 1;
/* we need to "flush" the stream to save the newly deleted file on disk */
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -3755,16 +3755,16 @@ PHP_METHOD(Phar, addEmptyDir)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dirname, &dirname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &dirname, &dirname_len) == FAILURE) {
return;
}
if (dirname_len >= sizeof(".phar")-1 && !memcmp(dirname, ".phar", sizeof(".phar")-1)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create a directory in magic \".phar\" directory");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create a directory in magic \".phar\" directory");
return;
}
- phar_mkdir(&phar_obj->archive, dirname, dirname_len TSRMLS_CC);
+ phar_mkdir(&phar_obj->archive, dirname, dirname_len);
}
/* }}} */
@@ -3780,24 +3780,24 @@ PHP_METHOD(Phar, addFile)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
return;
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive, safe_mode restrictions prevent this", fname);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, safe_mode restrictions prevent this", fname);
return;
}
#endif
- if (!strstr(fname, "://") && php_check_open_basedir(fname TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", fname);
+ if (!strstr(fname, "://") && php_check_open_basedir(fname)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", fname);
return;
}
if (!(resource = php_stream_open_wrapper(fname, "rb", 0, NULL))) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: unable to open file \"%s\" to add to phar archive", fname);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive", fname);
return;
}
@@ -3807,7 +3807,7 @@ PHP_METHOD(Phar, addFile)
}
php_stream_to_zval(resource, &zresource);
- phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource);
zval_ptr_dtor(&zresource);
}
/* }}} */
@@ -3822,11 +3822,11 @@ PHP_METHOD(Phar, addFromString)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) {
return;
}
- phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL TSRMLS_CC);
+ phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL);
}
/* }}} */
@@ -3854,19 +3854,19 @@ PHP_METHOD(Phar, getStub)
fp = phar_obj->archive->fp;
} else {
if (!(fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL))) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname);
return;
}
if (stub->flags & PHAR_ENT_COMPRESSION_MASK) {
char *filter_name;
if ((filter_name = phar_decompress_filter(stub, 0)) != NULL) {
- filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create(filter_name, NULL, php_stream_is_persistent(fp));
} else {
filter = NULL;
}
if (!filter) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, 1));
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_decompress_filter(stub, 1));
return;
}
php_stream_filter_append(&fp->readfilters, filter);
@@ -3874,7 +3874,7 @@ PHP_METHOD(Phar, getStub)
}
if (!fp) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
return;
}
@@ -3895,7 +3895,7 @@ PHP_METHOD(Phar, getStub)
}
if (!fp) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
return;
}
@@ -3908,7 +3908,7 @@ carry_on:
if (fp != phar_obj->archive->fp) {
php_stream_close(fp);
}
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to read stub");
zend_string_release(buf);
return;
@@ -3916,7 +3916,7 @@ carry_on:
if (filter) {
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
}
if (fp != phar_obj->archive->fp) {
@@ -3956,7 +3956,7 @@ PHP_METHOD(Phar, getMetadata)
zval ret;
char *buf = estrndup((char *) Z_PTR(phar_obj->archive->metadata), phar_obj->archive->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata(&buf, &ret, phar_obj->archive->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &ret, phar_obj->archive->metadata_len);
efree(buf);
RETURN_ZVAL(&ret, 0, 1);
}
@@ -3976,16 +3976,16 @@ PHP_METHOD(Phar, setMetadata)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &metadata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &metadata) == FAILURE) {
return;
}
- if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive) TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
+ if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname);
return;
}
if (Z_TYPE(phar_obj->archive->metadata) != IS_UNDEF) {
@@ -3995,10 +3995,10 @@ PHP_METHOD(Phar, setMetadata)
ZVAL_ZVAL(&phar_obj->archive->metadata, metadata, 1, 0);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4014,7 +4014,7 @@ PHP_METHOD(Phar, delMetadata)
PHAR_ARCHIVE_OBJECT();
if (PHAR_G(readonly) && !phar_obj->archive->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
@@ -4022,10 +4022,10 @@ PHP_METHOD(Phar, delMetadata)
zval_ptr_dtor(&phar_obj->archive->metadata);
ZVAL_UNDEF(&phar_obj->archive->metadata);
phar_obj->archive->is_modified = 1;
- phar_flush(phar_obj->archive, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar_obj->archive, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
} else {
@@ -4039,13 +4039,13 @@ PHP_METHOD(Phar, delMetadata)
/* }}} */
#if PHP_API_VERSION < 20100412
#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
-static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error TSRMLS_DC) /* {{{ */
+static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */
{
php_stream_statbuf ssb;
int len;
@@ -4148,8 +4148,8 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
return FAILURE;
}
- if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (!phar_get_efp(entry, 0)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
if (error) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", entry->filename, fullpath, *error);
} else {
@@ -4161,14 +4161,14 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
}
}
- if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", unable to seek internal file pointer", entry->filename, fullpath);
efree(fullpath);
php_stream_close(fp);
return FAILURE;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp, entry->uncompressed_filesize, NULL)) {
spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", entry->filename, fullpath);
efree(fullpath);
php_stream_close(fp);
@@ -4207,14 +4207,14 @@ PHP_METHOD(Phar, extractTo)
PHAR_ARCHIVE_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z!b", &pathto, &pathto_len, &zval_files, &overwrite) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z!b", &pathto, &pathto_len, &zval_files, &overwrite) == FAILURE) {
return;
}
fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, &actual);
if (!fp) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, %s cannot be found", phar_obj->archive->fname);
return;
}
@@ -4223,7 +4223,7 @@ PHP_METHOD(Phar, extractTo)
php_stream_close(fp);
if (pathto_len < 1) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, extraction path must be non-zero length");
return;
}
@@ -4231,7 +4231,7 @@ PHP_METHOD(Phar, extractTo)
if (pathto_len >= MAXPATHLEN) {
char *tmp = estrndup(pathto, 50);
/* truncate for error message */
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Cannot extract to \"%s...\", destination directory is too long for filesystem", tmp);
efree(tmp);
return;
}
@@ -4239,12 +4239,12 @@ PHP_METHOD(Phar, extractTo)
if (php_stream_stat_path(pathto, &ssb) < 0) {
ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
if (!ret) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to create path \"%s\" for extraction", pathto);
return;
}
} else if (!(ssb.sb.st_mode & S_IFDIR)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Unable to use path \"%s\" for extraction, it is a file, must be a directory", pathto);
return;
}
@@ -4269,16 +4269,16 @@ PHP_METHOD(Phar, extractTo)
case IS_STRING:
break;
default:
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, array of filenames to extract contains non-string value");
return;
}
if (NULL == (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, Z_STR_P(zval_file)))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", Z_STRVAL_P(zval_file), phar_obj->archive->fname);
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
return;
@@ -4287,19 +4287,19 @@ PHP_METHOD(Phar, extractTo)
}
RETURN_TRUE;
default:
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0,
"Invalid argument, expected a filename (string) or array of filenames");
return;
}
if (NULL == (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, filename, filename_len))) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", filename, phar_obj->archive->fname);
return;
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
return;
@@ -4314,8 +4314,8 @@ all_files:
}
ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC,
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar->fname, error);
efree(error);
return;
@@ -4340,39 +4340,39 @@ PHP_METHOD(PharFileInfo, __construct)
phar_archive_data *phar_data;
zval *zobj = getThis(), arg1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) {
return;
}
entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
if (entry_obj->entry) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot call constructor twice");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice");
return;
}
- if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC) == FAILURE) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ if (fname_len < 7 || memcmp(fname, "phar://", 7) || phar_split_fname(fname, (int)fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0) == FAILURE) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"'%s' is not a valid phar archive URL (must have at least phar://filename.phar)", fname);
return;
}
- if (phar_open_from_filename(arch, arch_len, NULL, 0, REPORT_ERRORS, &phar_data, &error TSRMLS_CC) == FAILURE) {
+ if (phar_open_from_filename(arch, arch_len, NULL, 0, REPORT_ERRORS, &phar_data, &error) == FAILURE) {
efree(arch);
efree(entry);
if (error) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot open phar file '%s': %s", fname, error);
efree(error);
} else {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot open phar file '%s'", fname);
}
return;
}
- if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1 TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC,
+ if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1)) == NULL) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0,
"Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? error : "");
efree(arch);
efree(entry);
@@ -4397,7 +4397,7 @@ PHP_METHOD(PharFileInfo, __construct)
zval *zobj = getThis(); \
phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!entry_obj->entry) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Cannot call method on an uninitialized PharFileInfo object"); \
return; \
}
@@ -4446,7 +4446,7 @@ PHP_METHOD(PharFileInfo, isCompressed)
zend_long method = 9021976;
PHAR_ENTRY_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &method) == FAILURE) {
return;
}
@@ -4458,7 +4458,7 @@ PHP_METHOD(PharFileInfo, isCompressed)
case PHAR_ENT_COMPRESSED_BZ2:
RETURN_BOOL(entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2);
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
}
}
@@ -4476,7 +4476,7 @@ PHP_METHOD(PharFileInfo, getCRC32)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, does not have a CRC"); \
return;
}
@@ -4484,7 +4484,7 @@ PHP_METHOD(PharFileInfo, getCRC32)
if (entry_obj->entry->is_crc_checked) {
RETURN_LONG(entry_obj->entry->crc32);
} else {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry was not CRC checked"); \
}
}
@@ -4530,25 +4530,25 @@ PHP_METHOD(PharFileInfo, chmod)
PHAR_ENTRY_OBJECT();
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry \"%s\" is a temporary directory (not an actual entry in the archive), cannot chmod", entry_obj->entry->filename); \
return;
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &perms) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &perms) == FAILURE) {
return;
}
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4574,10 +4574,10 @@ PHP_METHOD(PharFileInfo, chmod)
BG(CurrentLStatFile) = NULL;
BG(CurrentStatFile) = NULL;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4614,7 +4614,7 @@ PHP_METHOD(PharFileInfo, getMetadata)
zval ret;
char *buf = estrndup((char *) Z_PTR(entry_obj->entry->metadata), entry_obj->entry->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata(&buf, &ret, entry_obj->entry->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &ret, entry_obj->entry->metadata_len);
efree(buf);
RETURN_ZVAL(&ret, 0, 1);
}
@@ -4634,25 +4634,25 @@ PHP_METHOD(PharFileInfo, setMetadata)
PHAR_ENTRY_OBJECT();
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata"); \
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &metadata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &metadata) == FAILURE) {
return;
}
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4667,10 +4667,10 @@ PHP_METHOD(PharFileInfo, setMetadata)
entry_obj->entry->is_modified = 1;
entry_obj->entry->phar->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
}
@@ -4690,12 +4690,12 @@ PHP_METHOD(PharFileInfo, delMetadata)
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Write operations disabled by the php.ini setting phar.readonly");
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly");
return;
}
if (entry_obj->entry->is_temp_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata"); \
return;
}
@@ -4704,8 +4704,8 @@ PHP_METHOD(PharFileInfo, delMetadata)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4716,10 +4716,10 @@ PHP_METHOD(PharFileInfo, delMetadata)
entry_obj->entry->is_modified = 1;
entry_obj->entry->phar->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
RETURN_FALSE;
} else {
@@ -4749,31 +4749,31 @@ PHP_METHOD(PharFileInfo, getContent)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\" is a directory", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- link = phar_get_link_source(entry_obj->entry TSRMLS_CC);
+ link = phar_get_link_source(entry_obj->entry);
if (!link) {
link = entry_obj->entry;
}
- if (SUCCESS != phar_open_entry_fp(link, &error, 0 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(link, &error, 0)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\": %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
}
- if (!(fp = phar_get_efp(link, 0 TSRMLS_CC))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (!(fp = phar_get_efp(link, 0))) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
- phar_seek_efp(link, 0, SEEK_SET, 0, 0 TSRMLS_CC);
+ phar_seek_efp(link, 0, SEEK_SET, 0, 0);
str = php_stream_copy_to_mem(fp, link->uncompressed_filesize, 0);
if (str) {
RETURN_STR(str);
@@ -4792,30 +4792,30 @@ PHP_METHOD(PharFileInfo, compress)
char *error;
PHAR_ENTRY_OBJECT();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
return;
}
if (entry_obj->entry->is_tar) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with Gzip compression, not possible with tar-based phar archives");
return;
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, cannot set compression"); \
return;
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot change compression");
return;
}
if (entry_obj->entry->is_deleted) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress deleted file");
return;
}
@@ -4823,8 +4823,8 @@ PHP_METHOD(PharFileInfo, compress)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
@@ -4838,14 +4838,14 @@ PHP_METHOD(PharFileInfo, compress)
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0) {
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with gzip compression, file is already compressed with bzip2 compression and bz2 extension is not enabled, cannot decompress");
return;
}
/* decompress this file indirectly */
- if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot decompress bzip2-compressed file \"%s\" in phar \"%s\" in order to compress with gzip: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
@@ -4853,7 +4853,7 @@ PHP_METHOD(PharFileInfo, compress)
}
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with gzip compression, zlib extension is not enabled");
return;
}
@@ -4869,14 +4869,14 @@ PHP_METHOD(PharFileInfo, compress)
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0) {
if (!PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with bzip2 compression, file is already compressed with gzip compression and zlib extension is not enabled, cannot decompress");
return;
}
/* decompress this file indirectly */
- if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, 1)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar error: Cannot decompress gzip-compressed file \"%s\" in phar \"%s\" in order to compress with bzip2: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
efree(error);
return;
@@ -4884,7 +4884,7 @@ PHP_METHOD(PharFileInfo, compress)
}
if (!PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress with bzip2 compression, bz2 extension is not enabled");
return;
}
@@ -4893,16 +4893,16 @@ PHP_METHOD(PharFileInfo, compress)
entry_obj->entry->flags |= PHAR_ENT_COMPRESSED_BZ2;
break;
default:
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Unknown compression type specified"); \
}
entry_obj->entry->phar->is_modified = 1;
entry_obj->entry->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
@@ -4923,7 +4923,7 @@ PHP_METHOD(PharFileInfo, decompress)
}
if (entry_obj->entry->is_dir) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
"Phar entry is a directory, cannot set compression"); \
return;
}
@@ -4933,25 +4933,25 @@ PHP_METHOD(PharFileInfo, decompress)
}
if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Phar is readonly, cannot decompress");
return;
}
if (entry_obj->entry->is_deleted) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot compress deleted file");
return;
}
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0 && !PHAR_G(has_zlib)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress Gzip-compressed file, zlib extension is not enabled");
return;
}
if ((entry_obj->entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0 && !PHAR_G(has_bz2)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0,
"Cannot decompress Bzip2-compressed file, bz2 extension is not enabled");
return;
}
@@ -4959,16 +4959,16 @@ PHP_METHOD(PharFileInfo, decompress)
if (entry_obj->entry->is_persistent) {
phar_archive_data *phar = entry_obj->entry->phar;
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
+ if (FAILURE == phar_copy_on_write(&phar)) {
+ zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
return;
}
/* re-populate after copy-on-write */
entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
}
if (!entry_obj->entry->fp) {
- if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
+ if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar)) {
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
return;
}
entry_obj->entry->fp_type = PHAR_FP;
@@ -4978,10 +4978,10 @@ PHP_METHOD(PharFileInfo, decompress)
entry_obj->entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
entry_obj->entry->phar->is_modified = 1;
entry_obj->entry->is_modified = 1;
- phar_flush(entry_obj->entry->phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
if (error) {
- zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "%s", error);
+ zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error);
efree(error);
}
RETURN_TRUE;
@@ -5281,37 +5281,37 @@ zend_function_entry phar_exception_methods[] = {
/* }}} */
#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
-#define phar_exception_get_default() zend_exception_get_default(TSRMLS_C)
+#define phar_exception_get_default() zend_exception_get_default()
-void phar_object_init(TSRMLS_D) /* {{{ */
+void phar_object_init(void) /* {{{ */
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "PharException", phar_exception_methods);
- phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default() TSRMLS_CC);
+ phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default());
#if HAVE_SPL
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
- phar_ce_archive = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC);
+ phar_ce_archive = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
- zend_class_implements(phar_ce_archive TSRMLS_CC, 2, spl_ce_Countable, zend_ce_arrayaccess);
+ zend_class_implements(phar_ce_archive, 2, spl_ce_Countable, zend_ce_arrayaccess);
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
- phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC);
+ phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
- zend_class_implements(phar_ce_data TSRMLS_CC, 2, spl_ce_Countable, zend_ce_arrayaccess);
+ zend_class_implements(phar_ce_data, 2, spl_ce_Countable, zend_ce_arrayaccess);
INIT_CLASS_ENTRY(ce, "PharFileInfo", php_entry_methods);
- phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo TSRMLS_CC);
+ phar_ce_entry = zend_register_internal_class_ex(&ce, spl_ce_SplFileInfo);
#else
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
- phar_ce_archive = zend_register_internal_class(&ce TSRMLS_CC);
+ phar_ce_archive = zend_register_internal_class(&ce);
phar_ce_archive->ce_flags |= ZEND_ACC_FINAL;
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
- phar_ce_data = zend_register_internal_class(&ce TSRMLS_CC);
+ phar_ce_data = zend_register_internal_class(&ce);
phar_ce_data->ce_flags |= ZEND_ACC_FINAL;
#endif
diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h
index 41c379bfa9..cb1a08d83b 100644
--- a/ext/phar/php_phar.h
+++ b/ext/phar/php_phar.h
@@ -34,7 +34,7 @@ extern zend_module_entry phar_module_entry;
#define PHP_PHAR_API PHPAPI
#endif
-PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC);
+PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len);
#endif /* PHP_PHAR_H */
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index eb2fa607ee..5fb72522ad 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -56,7 +56,7 @@ php_stream_wrapper php_stream_phar_wrapper = {
/**
* Open a phar file for streams API
*/
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC) /* {{{ */
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options) /* {{{ */
{
php_url *resource;
char *arch = NULL, *entry = NULL, *error;
@@ -67,17 +67,17 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
}
if (mode[0] == 'a') {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: open mode append not supported");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: open mode append not supported");
}
return NULL;
}
- if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len, 2, (mode[0] == 'w' ? 2 : 0) TSRMLS_CC) == FAILURE) {
+ if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len, 2, (mode[0] == 'w' ? 2 : 0)) == FAILURE) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
if (arch && !entry) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", filename, arch);
arch = NULL;
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url or non-existent phar \"%s\"", filename);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url or non-existent phar \"%s\"", filename);
}
}
return NULL;
@@ -108,27 +108,27 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
}
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: write operations disabled by the php.ini setting phar.readonly");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: write operations disabled by the php.ini setting phar.readonly");
}
php_url_free(resource);
return NULL;
}
- if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error TSRMLS_CC) == FAILURE)
+ if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
php_url_free(resource);
return NULL;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(&error, 0, "Cannot open cached phar '%s' as writeable, copy on write failed", resource->host);
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
@@ -136,11 +136,11 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
return NULL;
}
} else {
- if (phar_open_from_filename(resource->host, arch_len, NULL, 0, options, NULL, &error TSRMLS_CC) == FAILURE)
+ if (phar_open_from_filename(resource->host, arch_len, NULL, 0, options, NULL, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
efree(error);
}
@@ -155,7 +155,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
/**
* used for fopen('phar://...') and company
*/
-static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
phar_archive_data *phar;
phar_entry_data *idata;
@@ -167,35 +167,35 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
zval *pzoption, *metadata;
uint host_len;
- if ((resource = phar_parse_url(wrapper, path, mode, options TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) {
return NULL;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", path);
return NULL;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", path);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", path);
return NULL;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
/* strip leading "/" */
internal_file = estrdup(resource->path + 1);
if (mode[0] == 'w' || (mode[0] == 'r' && mode[1] == '+')) {
- if (NULL == (idata = phar_get_or_create_entry_data(resource->host, host_len, internal_file, strlen(internal_file), mode, 0, &error, 1 TSRMLS_CC))) {
+ if (NULL == (idata = phar_get_or_create_entry_data(resource->host, host_len, internal_file, strlen(internal_file), mode, 0, &error, 1))) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, resource->host);
}
efree(internal_file);
php_url_free(resource);
@@ -237,14 +237,14 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
} else {
if (!*internal_file && (options & STREAM_OPEN_FOR_INCLUDE)) {
/* retrieve the stub */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL TSRMLS_CC)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "file %s is not a valid phar archive", resource->host);
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL)) {
+ php_stream_wrapper_log_error(wrapper, options, "file %s is not a valid phar archive", resource->host);
efree(internal_file);
php_url_free(resource);
return NULL;
}
if (phar->is_tar || phar->is_zip) {
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0 TSRMLS_CC)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0)) || !idata) {
goto idata_error;
}
efree(internal_file);
@@ -266,7 +266,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
entry->is_crc_checked = 1;
idata = (phar_entry_data *) ecalloc(1, sizeof(phar_entry_data));
- idata->fp = phar_get_pharfp(phar TSRMLS_CC);
+ idata->fp = phar_get_pharfp(phar);
idata->phar = phar;
idata->internal_file = entry;
if (!phar->is_persistent) {
@@ -282,13 +282,13 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
}
}
/* read-only access is allowed to magic files in .phar directory */
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, strlen(internal_file), "r", 0, &error, 0 TSRMLS_CC)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, strlen(internal_file), "r", 0, &error, 0)) || !idata) {
idata_error:
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, resource->host);
}
efree(internal_file);
php_url_free(resource);
@@ -307,10 +307,10 @@ idata_error:
#endif
/* check length, crc32 */
- if (!idata->internal_file->is_crc_checked && phar_postprocess_file(idata, idata->internal_file->crc32, &error, 2 TSRMLS_CC) != SUCCESS) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ if (!idata->internal_file->is_crc_checked && phar_postprocess_file(idata, idata->internal_file->crc32, &error, 2) != SUCCESS) {
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
efree(internal_file);
return NULL;
}
@@ -344,9 +344,9 @@ phar_stub:
/**
* Used for fclose($fp) where $fp is a phar archive
*/
-static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int phar_stream_close(php_stream *stream, int close_handle) /* {{{ */
{
- phar_entry_delref((phar_entry_data *)stream->abstract TSRMLS_CC);
+ phar_entry_delref((phar_entry_data *)stream->abstract);
return 0;
}
@@ -355,14 +355,14 @@ static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /*
/**
* used for fread($fp) and company on a fopen()ed phar file handle
*/
-static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_stream_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
size_t got;
phar_entry_info *entry;
if (data->internal_file->link) {
- entry = phar_get_link_source(data->internal_file TSRMLS_CC);
+ entry = phar_get_link_source(data->internal_file);
} else {
entry = data->internal_file;
}
@@ -386,7 +386,7 @@ static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRML
/**
* Used for fseek($fp) on a phar file handle
*/
-static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
phar_entry_info *entry;
@@ -394,7 +394,7 @@ static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, z
zend_off_t temp;
if (data->internal_file->link) {
- entry = phar_get_link_source(data->internal_file TSRMLS_CC);
+ entry = phar_get_link_source(data->internal_file);
} else {
entry = data->internal_file;
}
@@ -430,13 +430,13 @@ static int phar_stream_seek(php_stream *stream, zend_off_t offset, int whence, z
/**
* Used for writing to a phar file
*/
-static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *) stream->abstract;
php_stream_seek(data->fp, data->position, SEEK_SET);
if (count != php_stream_write(data->fp, buf, count)) {
- php_stream_wrapper_log_error(stream->wrapper, stream->flags TSRMLS_CC, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, data->internal_file->filename, data->phar->fname);
+ php_stream_wrapper_log_error(stream->wrapper, stream->flags, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, data->internal_file->filename, data->phar->fname);
return -1;
}
data->position = php_stream_tell(data->fp);
@@ -453,7 +453,7 @@ static size_t phar_stream_write(php_stream *stream, const char *buf, size_t coun
/**
* Used to save work done on a writeable phar
*/
-static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int phar_stream_flush(php_stream *stream) /* {{{ */
{
char *error;
int ret;
@@ -461,9 +461,9 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
if (data->internal_file->is_modified) {
data->internal_file->timestamp = time(0);
- ret = phar_flush(data->phar, 0, 0, 0, &error TSRMLS_CC);
+ ret = phar_flush(data->phar, 0, 0, 0, &error);
if (error) {
- php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS, "%s", error);
efree(error);
}
return ret;
@@ -477,7 +477,7 @@ static int phar_stream_flush(php_stream *stream TSRMLS_DC) /* {{{ */
/**
* stat an opened phar file handle stream, used by phar_stat()
*/
-void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir TSRMLS_DC)
+void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir)
{
memset(ssb, 0, sizeof(php_stream_statbuf));
@@ -545,7 +545,7 @@ void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_stat
/**
* Stat an opened phar file handle
*/
-static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
phar_entry_data *data = (phar_entry_data *)stream->abstract;
@@ -554,7 +554,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
return -1;
}
- phar_dostat(data->phar, data->internal_file, ssb, 0 TSRMLS_CC);
+ phar_dostat(data->phar, data->internal_file, ssb, 0);
return 0;
}
/* }}} */
@@ -563,7 +563,7 @@ static int phar_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
* Stream wrapper stat implementation of stat()
*/
static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags,
- php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC) /* {{{ */
+ php_stream_statbuf *ssb, php_stream_context *context) /* {{{ */
{
php_url *resource = NULL;
char *internal_file, *error;
@@ -572,7 +572,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
uint host_len;
int internal_file_len;
- if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
+ if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
return FAILURE;
}
@@ -588,11 +588,11 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
internal_file = resource->path + 1; /* strip leading "/" */
/* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
php_url_free(resource);
if (error) {
efree(error);
@@ -604,7 +604,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
}
if (*internal_file == '\0') {
/* root directory requested */
- phar_dostat(phar, NULL, ssb, 1 TSRMLS_CC);
+ phar_dostat(phar, NULL, ssb, 1);
php_url_free(resource);
return SUCCESS;
}
@@ -615,12 +615,12 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
internal_file_len = strlen(internal_file);
/* search through the manifest of files, and if we have an exact match, it's a file */
if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
- phar_dostat(phar, entry, ssb, 0 TSRMLS_CC);
+ phar_dostat(phar, entry, ssb, 0);
php_url_free(resource);
return SUCCESS;
}
if (zend_hash_str_exists(&(phar->virtual_dirs), internal_file, internal_file_len)) {
- phar_dostat(phar, NULL, ssb, 1 TSRMLS_CC);
+ phar_dostat(phar, NULL, ssb, 1);
php_url_free(resource);
return SUCCESS;
}
@@ -648,7 +648,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
continue;
}
/* mount the file/directory just in time */
- if (SUCCESS != phar_mount_entry(phar, test, test_len, internal_file, internal_file_len TSRMLS_CC)) {
+ if (SUCCESS != phar_mount_entry(phar, test, test_len, internal_file, internal_file_len)) {
efree(test);
goto free_resource;
}
@@ -656,7 +656,7 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
goto free_resource;
}
- phar_dostat(phar, entry, ssb, 0 TSRMLS_CC);
+ phar_dostat(phar, entry, ssb, 0);
php_url_free(resource);
return SUCCESS;
}
@@ -671,7 +671,7 @@ free_resource:
/**
* Unlink a file within a phar archive
*/
-static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context) /* {{{ */
{
php_url *resource;
char *internal_file, *error;
@@ -680,44 +680,44 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
phar_archive_data *pphar;
uint host_len;
- if ((resource = phar_parse_url(wrapper, url, "rb", options TSRMLS_CC)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: unlink failed");
+ if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: unlink failed");
return 0;
}
/* we must have at the very least phar://alias.phar/internalfile.php */
if (!resource->scheme || !resource->host || !resource->path) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: invalid url \"%s\"", url);
return 0;
}
if (strcasecmp("phar", resource->scheme)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: not a phar stream url \"%s\"", url);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
host_len = strlen(resource->host);
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
pphar = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_fname_map), resource->host, host_len);
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
php_url_free(resource);
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: write operations disabled by the php.ini setting phar.readonly");
+ php_stream_wrapper_log_error(wrapper, options, "phar error: write operations disabled by the php.ini setting phar.readonly");
return 0;
}
/* need to copy to strip leading "/", will get touched again */
internal_file = estrdup(resource->path + 1);
internal_file_len = strlen(internal_file);
- if (FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, internal_file_len, "r", 0, &error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, internal_file_len, "r", 0, &error, 1)) {
/* constraints of fp refcount were not met */
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "unlink of \"%s\" failed: %s", url, error);
+ php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed: %s", url, error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "unlink of \"%s\" failed, file does not exist", url);
+ php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed, file does not exist", url);
}
efree(internal_file);
php_url_free(resource);
@@ -728,24 +728,24 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
}
if (idata->internal_file->fp_refcount > 1) {
/* more than just our fp resource is open for this file */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);
efree(internal_file);
php_url_free(resource);
- phar_entry_delref(idata TSRMLS_CC);
+ phar_entry_delref(idata);
return 0;
}
php_url_free(resource);
efree(internal_file);
- phar_entry_remove(idata, &error TSRMLS_CC);
+ phar_entry_remove(idata, &error);
if (error) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", error);
+ php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
}
return 1;
}
/* }}} */
-static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC) /* {{{ */
+static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context) /* {{{ */
{
php_url *resource_from, *resource_to;
char *error;
@@ -757,11 +757,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
error = NULL;
- if ((resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from);
+ if ((resource_from = phar_parse_url(wrapper, url_from, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from);
return 0;
}
- if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error)) {
pfrom = NULL;
if (error) {
efree(error);
@@ -769,16 +769,16 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (PHAR_G(readonly) && (!pfrom || !pfrom->is_data)) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
+ php_error_docref(NULL, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
return 0;
}
- if ((resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET TSRMLS_CC)) == NULL) {
+ if ((resource_to = phar_parse_url(wrapper, url_to, "wb", options|PHP_STREAM_URL_STAT_QUIET)) == NULL) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to);
return 0;
}
- if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error)) {
if (error) {
efree(error);
}
@@ -786,14 +786,14 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (PHAR_G(readonly) && (!pto || !pto->is_data)) {
php_url_free(resource_from);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
+ php_error_docref(NULL, E_WARNING, "phar error: Write operations disabled by the php.ini setting phar.readonly");
return 0;
}
if (strcmp(resource_from->host, resource_to->host)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\", not within the same phar archive", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\", not within the same phar archive", url_from, url_to);
return 0;
}
@@ -801,45 +801,45 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
if (!resource_from->scheme || !resource_from->host || !resource_from->path) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_from);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_from);
return 0;
}
if (!resource_to->scheme || !resource_to->host || !resource_to->path) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid url \"%s\"", url_from, url_to, url_to);
return 0;
}
if (strcasecmp("phar", resource_from->scheme)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_from);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_from);
return 0;
}
if (strcasecmp("phar", resource_to->scheme)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_to);
return 0;
}
host_len = strlen(resource_from->host);
- if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error TSRMLS_CC)) {
+ if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
return 0;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": could not make cached phar writeable", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": could not make cached phar writeable", url_from, url_to);
return 0;
}
@@ -850,7 +850,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
if (entry->is_deleted) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source has been deleted", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source has been deleted", url_from, url_to);
return 0;
}
/* transfer all data over to the new entry */
@@ -866,10 +866,10 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
entry = zend_hash_str_add_mem(&(phar->manifest), resource_to->path+1, strlen(resource_to->path)-1, (void **)&new, sizeof(phar_entry_info));
entry->filename = estrdup(resource_to->path+1);
- if (FAILURE == phar_copy_entry_fp(source, entry, &error TSRMLS_CC)) {
+ if (FAILURE == phar_copy_entry_fp(source, entry, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
zend_hash_str_del(&(phar->manifest), entry->filename, strlen(entry->filename));
return 0;
@@ -884,7 +884,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
/* file does not exist */
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source does not exist", url_from, url_to);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\" from extracted phar archive, source does not exist", url_from, url_to);
return 0;
}
@@ -963,11 +963,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
}
if (is_modified) {
- phar_flush(phar, 0, 0, 0, &error TSRMLS_CC);
+ phar_flush(phar, 0, 0, 0, &error);
if (error) {
php_url_free(resource_from);
php_url_free(resource_to);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
+ php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
efree(error);
return 0;
}
diff --git a/ext/phar/stream.h b/ext/phar/stream.h
index 0171010179..16156f08fb 100644
--- a/ext/phar/stream.h
+++ b/ext/phar/stream.h
@@ -21,21 +21,21 @@
BEGIN_EXTERN_C()
-php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options TSRMLS_DC);
-void phar_entry_remove(phar_entry_data *idata, char **error TSRMLS_DC);
+php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const char *mode, int options);
+void phar_entry_remove(phar_entry_data *idata, char **error);
-static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC);
-static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC);
-static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC);
+static php_stream* phar_wrapper_open_url(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context);
+static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context);
+static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context);
/* file/stream handlers */
-static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC);
-static size_t phar_stream_read( php_stream *stream, char *buf, size_t count TSRMLS_DC);
-static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC);
-static int phar_stream_flush(php_stream *stream TSRMLS_DC);
-static int phar_stream_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC);
-static int phar_stream_stat( php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC);
+static size_t phar_stream_write(php_stream *stream, const char *buf, size_t count);
+static size_t phar_stream_read( php_stream *stream, char *buf, size_t count);
+static int phar_stream_close(php_stream *stream, int close_handle);
+static int phar_stream_flush(php_stream *stream);
+static int phar_stream_seek( php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset);
+static int phar_stream_stat( php_stream *stream, php_stream_statbuf *ssb);
END_EXTERN_C()
/*
diff --git a/ext/phar/stub.h b/ext/phar/stub.h
index 6d524c69d1..5a42883426 100644
--- a/ext/phar/stub.h
+++ b/ext/phar/stub.h
@@ -18,7 +18,7 @@
/* $Id$ */
-static inline void phar_get_stub(const char *index_php, const char *web, size_t *len, char **stub, const int name_len, const int web_len TSRMLS_DC)
+static inline void phar_get_stub(const char *index_php, const char *web, size_t *len, char **stub, const int name_len, const int web_len)
{
static const char newstub0[] = "<?php\n\n$web = '";
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 76862f7cdb..2d55e347f3 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -121,10 +121,10 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
}
/* }}} */
-int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
- int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error TSRMLS_CC);
+ int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
if (FAILURE == ret) {
return FAILURE;
@@ -155,7 +155,7 @@ int phar_open_or_create_tar(char *fname, int fname_len, char *alias, int alias_l
}
/* }}} */
-static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */
+static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp) /* {{{ */
{
char *metadata;
size_t save = php_stream_tell(fp), read;
@@ -170,7 +170,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
return FAILURE;
}
- if (phar_parse_metadata(&metadata, &entry->metadata, entry->uncompressed_filesize TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&metadata, &entry->metadata, entry->uncompressed_filesize) == FAILURE) {
/* if not valid serialized data, it is a regular string */
efree(metadata);
php_stream_seek(fp, save, SEEK_SET);
@@ -192,7 +192,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
}
/* }}} */
-int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */
+int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error) /* {{{ */
{
char buf[512], *actual_alias = NULL, *p;
phar_entry_info entry = {0};
@@ -264,7 +264,7 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
}
bail:
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
curloc = php_stream_tell(fp);
@@ -285,7 +285,7 @@ bail:
# define PHAR_GET_32(buffer) (php_uint32) *(buffer)
#endif
myphar->sig_flags = PHAR_GET_32(buf);
- if (FAILURE == phar_verify_signature(fp, php_stream_tell(fp) - size - 512, myphar->sig_flags, buf + 8, size - 8, fname, &myphar->signature, &myphar->sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(fp, php_stream_tell(fp) - size - 512, myphar->sig_flags, buf + 8, size - 8, fname, &myphar->signature, &myphar->sig_len, error)) {
if (error) {
char *save = *error;
spprintf(error, 4096, "phar error: tar-based phar \"%s\" signature cannot be verified: %s", fname, save);
@@ -303,7 +303,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -315,7 +315,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -344,7 +344,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
@@ -356,7 +356,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.filename[entry.filename_len] = '\0';
@@ -372,7 +372,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -384,7 +384,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
continue;
@@ -433,7 +433,7 @@ bail:
}
last_was_longlink = 0;
- phar_add_virtual_dirs(myphar, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(myphar, entry.filename, entry.filename_len);
if (sum1 != sum2) {
if (error) {
@@ -441,7 +441,7 @@ bail:
}
pefree(entry.filename, myphar->is_persistent);
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -473,14 +473,14 @@ bail:
}
pefree(entry.filename, entry.is_persistent);
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
entry.link = estrdup(hdr->linkname);
} else if (entry.tar_type == TAR_SYMLINK) {
entry.link = estrdup(hdr->linkname);
}
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
newentry = zend_hash_str_add_mem(&myphar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
if (entry.is_persistent) {
@@ -488,12 +488,12 @@ bail:
}
if (entry.filename_len >= sizeof(".phar/.metadata")-1 && !memcmp(entry.filename, ".phar/.metadata", sizeof(".phar/.metadata")-1)) {
- if (FAILURE == phar_tar_process_metadata(newentry, fp TSRMLS_CC)) {
+ if (FAILURE == phar_tar_process_metadata(newentry, fp)) {
if (error) {
spprintf(error, 4096, "phar error: tar-based phar \"%s\" has invalid metadata in magic file \"%s\"", fname, entry.filename);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -505,7 +505,7 @@ bail:
spprintf(error, 4096, "phar error: tar-based phar \"%s\" has alias that is larger than 511 bytes, cannot process", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -526,7 +526,7 @@ bail:
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -540,7 +540,7 @@ bail:
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -555,7 +555,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
}
@@ -567,7 +567,7 @@ bail:
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (truncated)", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
} while (!php_stream_eof(fp));
@@ -581,7 +581,7 @@ bail:
/* ensure signature set */
if (!myphar->is_data && PHAR_G(require_hash) && !myphar->signature) {
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
if (error) {
spprintf(error, 0, "tar-based phar \"%s\" does not have a signature", fname);
}
@@ -606,14 +606,14 @@ bail:
}
}
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (NULL == (actual = zend_hash_str_add_ptr(&(PHAR_GLOBALS->phar_fname_map), myphar->fname, fname_len, myphar))) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\" to phar registry", fname);
}
php_stream_close(fp);
- phar_destroy_phar_data(myphar TSRMLS_CC);
+ phar_destroy_phar_data(myphar);
return FAILURE;
}
@@ -625,7 +625,7 @@ bail:
myphar->is_temporary_alias = 0;
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), actual_alias, myphar->alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, myphar->alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, myphar->alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname);
}
@@ -640,7 +640,7 @@ bail:
if (alias_len) {
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add tar-based phar \"%s\", alias is already in use", fname);
}
@@ -675,7 +675,7 @@ struct _phar_pass_tar_info {
char **error;
};
-static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* {{{ */
{
tar_header header;
size_t pos;
@@ -695,7 +695,7 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
}
}
- phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
memset((char *) &header, 0, sizeof(header));
if (entry->filename_len > 100) {
@@ -771,18 +771,18 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
/* write contents */
if (entry->uncompressed_filesize) {
- if (FAILURE == phar_open_entry_fp(entry, fp->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, fp->error, 0)) {
return ZEND_HASH_APPLY_STOP;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
if (fp->error) {
spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written, seek failed", entry->phar->fname, entry->filename);
}
return ZEND_HASH_APPLY_STOP;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), fp->new, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), fp->new, entry->uncompressed_filesize, NULL)) {
if (fp->error) {
spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, entry->filename);
}
@@ -823,13 +823,13 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument TSRM
}
/* }}} */
-static int phar_tar_writeheaders(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_writeheaders(zval *zv, void *argument) /* {{{ */
{
- return phar_tar_writeheaders_int(Z_PTR_P(zv), argument TSRMLS_CC);
+ return phar_tar_writeheaders_int(Z_PTR_P(zv), argument);
}
/* }}} */
-int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error) /* {{{ */
{
php_serialize_data_t metadata_hash;
@@ -839,7 +839,7 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
entry->uncompressed_filesize = entry->compressed_filesize = entry->metadata_str.s ? entry->metadata_str.s->len : 0;
@@ -865,7 +865,7 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS
}
/* }}} */
-static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
+static int phar_tar_setupmetadata(zval *zv, void *argument) /* {{{ */
{
int lookfor_len;
struct _phar_pass_tar_info *i = (struct _phar_pass_tar_info *)argument;
@@ -874,7 +874,7 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
if (entry->filename_len >= sizeof(".phar/.metadata") && !memcmp(entry->filename, ".phar/.metadata", sizeof(".phar/.metadata")-1)) {
if (entry->filename_len == sizeof(".phar/.metadata.bin")-1 && !memcmp(entry->filename, ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1)) {
- return phar_tar_setmetadata(&entry->phar->metadata, entry, error TSRMLS_CC);
+ return phar_tar_setmetadata(&entry->phar->metadata, entry, error);
}
/* search for the file this metadata entry references */
if (entry->filename_len >= sizeof(".phar/.metadata/") + sizeof("/.metadata.bin") - 1 && !zend_hash_str_exists(&(entry->phar->manifest), entry->filename + sizeof(".phar/.metadata/") - 1, entry->filename_len - (sizeof("/.metadata.bin") - 1 + sizeof(".phar/.metadata/") - 1))) {
@@ -900,7 +900,7 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
if (NULL != (metadata = zend_hash_str_find_ptr(&(entry->phar->manifest), lookfor, lookfor_len))) {
int ret;
- ret = phar_tar_setmetadata(&entry->metadata, metadata, error TSRMLS_CC);
+ ret = phar_tar_setmetadata(&entry->metadata, metadata, error);
efree(lookfor);
return ret;
}
@@ -917,11 +917,11 @@ static int phar_tar_setupmetadata(zval *zv, void *argument TSRMLS_DC) /* {{{ */
return ZEND_HASH_APPLY_STOP;
}
- return phar_tar_setmetadata(&entry->metadata, metadata, error TSRMLS_CC);
+ return phar_tar_setmetadata(&entry->metadata, metadata, error);
}
/* }}} */
-int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC) /* {{{ */
+int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
{
phar_entry_info entry = {0};
static const char newstub[] = "<?php // tar-based phar archive stub file\n__HALT_COMPILER();";
@@ -1137,7 +1137,7 @@ nostub:
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar_entry_info *mentry;
if (NULL != (mentry = zend_hash_str_find_ptr(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1))) {
- if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error TSRMLS_CC)) {
+ if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
if (closeoldfile) {
php_stream_close(oldfile);
}
@@ -1160,7 +1160,7 @@ nostub:
return EOF;
}
- if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error TSRMLS_CC)) {
+ if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
zend_hash_str_del(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1);
if (closeoldfile) {
php_stream_close(oldfile);
@@ -1170,7 +1170,7 @@ nostub:
}
}
- zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass);
if (error && *error) {
if (closeoldfile) {
@@ -1182,11 +1182,11 @@ nostub:
return EOF;
}
- zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass);
/* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */
if (!phar->is_data || phar->sig_flags) {
- if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error)) {
if (error) {
char *save = *error;
spprintf(error, 0, "phar error: unable to write signature to tar-based phar: %s", save);
@@ -1236,7 +1236,7 @@ nostub:
efree(signature);
entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8;
/* throw out return value and write the signature */
- entry.filename_len = phar_tar_writeheaders_int(&entry, (void *)&pass TSRMLS_CC);
+ entry.filename_len = phar_tar_writeheaders_int(&entry, (void *)&pass);
if (error && *error) {
if (closeoldfile) {
@@ -1301,7 +1301,7 @@ nostub:
#define MAX_WBITS 15
#endif
add_assoc_long(&filterparams, "window", MAX_WBITS + 16);
- filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
zval_dtor(&filterparams);
if (!filter) {
@@ -1317,18 +1317,18 @@ nostub:
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
php_stream_filter *filter;
- filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
php_stream_filter_append(&phar->fp->writefilters, filter);
php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_close(phar->fp);
/* use the temp stream as our base */
phar->fp = newfile;
diff --git a/ext/phar/util.c b/ext/phar/util.c
index f131aa99a2..56d168b072 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -38,11 +38,11 @@
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#else
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC);
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len);
#endif
/* for links to relative location, prepend cwd of the entry */
-static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+static char *phar_get_link_location(phar_entry_info *entry) /* {{{ */
{
char *p, *ret = NULL;
if (!entry->link) {
@@ -61,7 +61,7 @@ static char *phar_get_link_location(phar_entry_info *entry TSRMLS_DC) /* {{{ */
}
/* }}} */
-phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_link_source(phar_entry_info *entry) /* {{{ */
{
phar_entry_info *link_entry;
char *link;
@@ -70,13 +70,13 @@ phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ *
return entry;
}
- link = phar_get_link_location(entry TSRMLS_CC);
+ link = phar_get_link_location(entry);
if (NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->link, strlen(entry->link))) ||
NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), link, strlen(link)))) {
if (link != entry->link) {
efree(link);
}
- return phar_get_link_source(link_entry TSRMLS_CC);
+ return phar_get_link_source(link_entry);
} else {
if (link != entry->link) {
efree(link);
@@ -87,24 +87,24 @@ phar_entry_info *phar_get_link_source(phar_entry_info *entry TSRMLS_DC) /* {{{ *
/* }}} */
/* retrieve a phar_entry_info's current file pointer for reading contents */
-php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /* {{{ */
+php_stream *phar_get_efp(phar_entry_info *entry, int follow_links) /* {{{ */
{
if (follow_links && entry->link) {
- phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
+ phar_entry_info *link_entry = phar_get_link_source(entry);
if (link_entry && link_entry != entry) {
- return phar_get_efp(link_entry, 1 TSRMLS_CC);
+ return phar_get_efp(link_entry, 1);
}
}
- if (phar_get_fp_type(entry TSRMLS_CC) == PHAR_FP) {
- if (!phar_get_entrypfp(entry TSRMLS_CC)) {
+ if (phar_get_fp_type(entry) == PHAR_FP) {
+ if (!phar_get_entrypfp(entry)) {
/* re-open just in time for cases where our refcount reached 0 on the phar archive */
- phar_open_archive_fp(entry->phar TSRMLS_CC);
+ phar_open_archive_fp(entry->phar);
}
- return phar_get_entrypfp(entry TSRMLS_CC);
- } else if (phar_get_fp_type(entry TSRMLS_CC) == PHAR_UFP) {
- return phar_get_entrypufp(entry TSRMLS_CC);
+ return phar_get_entrypfp(entry);
+ } else if (phar_get_fp_type(entry) == PHAR_UFP) {
+ return phar_get_entrypufp(entry);
} else if (entry->fp_type == PHAR_MOD) {
return entry->fp;
} else {
@@ -117,9 +117,9 @@ php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC) /*
}
/* }}} */
-int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links TSRMLS_DC) /* {{{ */
+int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_off_t position, int follow_links) /* {{{ */
{
- php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
+ php_stream *fp = phar_get_efp(entry, follow_links);
zend_off_t temp, eoffset;
if (!fp) {
@@ -128,7 +128,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
if (follow_links) {
phar_entry_info *t;
- t = phar_get_link_source(entry TSRMLS_CC);
+ t = phar_get_link_source(entry);
if (t) {
entry = t;
}
@@ -138,7 +138,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
return 0;
}
- eoffset = phar_get_fp_offset(entry TSRMLS_CC);
+ eoffset = phar_get_fp_offset(entry);
switch (whence) {
case SEEK_END:
@@ -167,7 +167,7 @@ int phar_seek_efp(phar_entry_info *entry, zend_off_t offset, int whence, zend_of
/* }}} */
/* mount an absolute path or uri to a path internal to the phar archive */
-int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len TSRMLS_DC) /* {{{ */
+int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len) /* {{{ */
{
phar_entry_info entry = {0};
php_stream_statbuf ssb;
@@ -194,7 +194,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
if (is_phar) {
entry.tmp = estrndup(filename, filename_len);
} else {
- entry.tmp = expand_filepath(filename, NULL TSRMLS_CC);
+ entry.tmp = expand_filepath(filename, NULL);
if (!entry.tmp) {
entry.tmp = estrndup(filename, filename_len);
}
@@ -209,7 +209,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
filename = entry.tmp;
/* only check openbasedir for files, not for phar streams */
- if (!is_phar && php_check_open_basedir(filename TSRMLS_CC)) {
+ if (!is_phar && php_check_open_basedir(filename)) {
efree(entry.tmp);
efree(entry.filename);
return FAILURE;
@@ -250,7 +250,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
}
/* }}} */
-char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_data **pphar) /* {{{ */
{
char *path, *fname, *arch, *entry, *ret, *test;
int arch_len, entry_len, fname_len, ret_len;
@@ -262,11 +262,11 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
pphar = &phar;
}
- if (!zend_is_executing(TSRMLS_C) || !PHAR_G(cwd)) {
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ if (!zend_is_executing() || !PHAR_G(cwd)) {
+ return phar_save_resolve_path(filename, filename_len);
}
- fname = (char*)zend_get_executed_filename(TSRMLS_C);
+ fname = (char*)zend_get_executed_filename();
fname_len = strlen(fname);
if (PHAR_G(last_phar) && !memcmp(fname, "phar://", 7) && fname_len - 7 >= PHAR_G(last_phar_name_len) && !memcmp(fname + 7, PHAR_G(last_phar_name), PHAR_G(last_phar_name_len))) {
@@ -276,8 +276,8 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
goto splitted;
}
- if (fname_len < 7 || memcmp(fname, "phar://", 7) || SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) {
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ if (fname_len < 7 || memcmp(fname, "phar://", 7) || SUCCESS != phar_split_fname(fname, strlen(fname), &arch, &arch_len, &entry, &entry_len, 1, 0)) {
+ return phar_save_resolve_path(filename, filename_len);
}
efree(entry);
@@ -285,9 +285,9 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d
if (*filename == '.') {
int try_len;
- if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
efree(arch);
- return phar_save_resolve_path(filename, filename_len TSRMLS_CC);
+ return phar_save_resolve_path(filename, filename_len);
}
splitted:
if (pphar) {
@@ -295,7 +295,7 @@ splitted:
}
try_len = filename_len;
- test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1 TSRMLS_CC);
+ test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1);
if (*test == '/') {
if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) {
@@ -317,14 +317,14 @@ splitted:
spprintf(&path, MAXPATHLEN, "phar://%s/%s%c%s", arch, PHAR_G(cwd), DEFAULT_DIR_SEPARATOR, PG(include_path));
efree(arch);
- ret = php_resolve_path(filename, filename_len, path TSRMLS_CC);
+ ret = php_resolve_path(filename, filename_len, path);
efree(path);
if (ret && strlen(ret) > 8 && !strncmp(ret, "phar://", 7)) {
ret_len = strlen(ret);
/* found phar:// */
- if (SUCCESS != phar_split_fname(ret, ret_len, &arch, &arch_len, &entry, &entry_len, 1, 0 TSRMLS_CC)) {
+ if (SUCCESS != phar_split_fname(ret, ret_len, &arch, &arch_len, &entry, &entry_len, 1, 0)) {
return ret;
}
@@ -350,7 +350,7 @@ splitted:
* appended, truncated, or read. For read, if the entry is marked unmodified, it is
* assumed that the file pointer, if present, is opened for reading
*/
-int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
+int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry;
@@ -369,7 +369,7 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char
*error = NULL;
}
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
return FAILURE;
}
@@ -388,14 +388,14 @@ int phar_get_entry_data(phar_entry_data **ret, char *fname, int fname_len, char
}
really_get_entry:
if (allow_dir) {
- if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security TSRMLS_CC)) == NULL) {
+ if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
return SUCCESS;
}
return FAILURE;
}
} else {
- if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security TSRMLS_CC)) == NULL) {
+ if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
return SUCCESS;
}
@@ -404,7 +404,7 @@ really_get_entry:
}
if (for_write && phar->is_persistent) {
- if (FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be opened for writing, could not make cached phar writeable", path, fname);
}
@@ -455,11 +455,11 @@ really_get_entry:
if (entry->fp_type == PHAR_MOD) {
if (for_trunc) {
- if (FAILURE == phar_create_writeable_entry(phar, entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
return FAILURE;
}
} else if (for_append) {
- phar_seek_efp(entry, 0, SEEK_END, 0, 0 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_END, 0, 0);
}
} else {
if (for_write) {
@@ -470,16 +470,16 @@ really_get_entry:
}
if (for_trunc) {
- if (FAILURE == phar_create_writeable_entry(phar, entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
return FAILURE;
}
} else {
- if (FAILURE == phar_separate_entry_fp(entry, error TSRMLS_CC)) {
+ if (FAILURE == phar_separate_entry_fp(entry, error)) {
return FAILURE;
}
}
} else {
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return FAILURE;
}
}
@@ -492,11 +492,11 @@ really_get_entry:
(*ret)->internal_file = entry;
(*ret)->is_zip = entry->is_zip;
(*ret)->is_tar = entry->is_tar;
- (*ret)->fp = phar_get_efp(entry, 1 TSRMLS_CC);
+ (*ret)->fp = phar_get_efp(entry, 1);
if (entry->link) {
- (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry TSRMLS_CC) TSRMLS_CC);
+ (*ret)->zero = phar_get_fp_offset(phar_get_link_source(entry));
} else {
- (*ret)->zero = phar_get_fp_offset(entry TSRMLS_CC);
+ (*ret)->zero = phar_get_fp_offset(entry);
}
if (!phar->is_persistent) {
@@ -511,7 +511,7 @@ really_get_entry:
/**
* Create a new dummy file slot within a writeable phar for a newly created file
*/
-phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char *path, int path_len, const char *mode, char allow_dir, char **error, int security) /* {{{ */
{
phar_archive_data *phar;
phar_entry_info *entry, etemp;
@@ -525,11 +525,11 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
is_dir = (path_len && path[path_len - 1] == '/') ? 1 : 0;
- if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
return NULL;
}
- if (FAILURE == phar_get_entry_data(&ret, fname, fname_len, path, path_len, mode, allow_dir, error, security TSRMLS_CC)) {
+ if (FAILURE == phar_get_entry_data(&ret, fname, fname_len, path, path_len, mode, allow_dir, error, security)) {
return NULL;
} else if (ret) {
return ret;
@@ -542,7 +542,7 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
return NULL;
}
- if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar TSRMLS_CC)) {
+ if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
if (error) {
spprintf(error, 4096, "phar error: file \"%s\" in phar \"%s\" cannot be created, could not make cached phar writeable", path, fname);
}
@@ -579,7 +579,7 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
path_len--;
}
- phar_add_virtual_dirs(phar, path, path_len TSRMLS_CC);
+ phar_add_virtual_dirs(phar, path, path_len);
etemp.is_modified = 1;
etemp.timestamp = time(0);
etemp.is_crc_checked = 1;
@@ -623,19 +623,19 @@ phar_entry_data *phar_get_or_create_entry_data(char *fname, int fname_len, char
/* }}} */
/* initialize a phar_archive_data's read-only fp for existing phar data */
-int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
+int phar_open_archive_fp(phar_archive_data *phar) /* {{{ */
{
- if (phar_get_pharfp(phar TSRMLS_CC)) {
+ if (phar_get_pharfp(phar)) {
return SUCCESS;
}
- if (php_check_open_basedir(phar->fname TSRMLS_CC)) {
+ if (php_check_open_basedir(phar->fname)) {
return FAILURE;
}
- phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL) TSRMLS_CC);
+ phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL));
- if (!phar_get_pharfp(phar TSRMLS_CC)) {
+ if (!phar_get_pharfp(phar)) {
return FAILURE;
}
@@ -644,11 +644,11 @@ int phar_open_archive_fp(phar_archive_data *phar TSRMLS_DC) /* {{{ */
/* }}} */
/* copy file data from an existing to a new phar_entry_info that is not in the manifest */
-int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error TSRMLS_DC) /* {{{ */
+int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **error) /* {{{ */
{
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(source, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(source, error, 1)) {
return FAILURE;
}
@@ -666,14 +666,14 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er
spprintf(error, 0, "phar error: unable to create temporary file");
return EOF;
}
- phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC);
- link = phar_get_link_source(source TSRMLS_CC);
+ phar_seek_efp(source, 0, SEEK_SET, 0, 1);
+ link = phar_get_link_source(source);
if (!link) {
link = source;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), dest->fp, link->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), dest->fp, link->uncompressed_filesize, NULL)) {
php_stream_close(dest->fp);
dest->fp_type = PHAR_FP;
if (error) {
@@ -688,7 +688,7 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er
/* open and decompress a compressed phar entry
*/
-int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TSRMLS_DC) /* {{{ */
+int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links) /* {{{ */
{
php_stream_filter *filter;
phar_archive_data *phar = entry->phar;
@@ -698,9 +698,9 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
phar_entry_data dummy;
if (follow_links && entry->link) {
- phar_entry_info *link_entry = phar_get_link_source(entry TSRMLS_CC);
+ phar_entry_info *link_entry = phar_get_link_source(entry);
if (link_entry && link_entry != entry) {
- return phar_open_entry_fp(link_entry, error, 1 TSRMLS_CC);
+ return phar_open_entry_fp(link_entry, error, 1);
}
}
@@ -720,8 +720,8 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
return SUCCESS;
}
- if (!phar_get_pharfp(phar TSRMLS_CC)) {
- if (FAILURE == phar_open_archive_fp(phar TSRMLS_CC)) {
+ if (!phar_get_pharfp(phar)) {
+ if (FAILURE == phar_open_archive_fp(phar)) {
spprintf(error, 4096, "phar error: Cannot open phar archive \"%s\" for reading", phar->fname);
return FAILURE;
}
@@ -731,16 +731,16 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
dummy.internal_file = entry;
dummy.phar = phar;
dummy.zero = entry->offset;
- dummy.fp = phar_get_pharfp(phar TSRMLS_CC);
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1 TSRMLS_CC)) {
+ dummy.fp = phar_get_pharfp(phar);
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1)) {
return FAILURE;
}
return SUCCESS;
}
- if (!phar_get_entrypufp(entry TSRMLS_CC)) {
- phar_set_entrypufp(entry, php_stream_fopen_tmpfile() TSRMLS_CC);
- if (!phar_get_entrypufp(entry TSRMLS_CC)) {
+ if (!phar_get_entrypufp(entry)) {
+ phar_set_entrypufp(entry, php_stream_fopen_tmpfile());
+ if (!phar_get_entrypufp(entry)) {
spprintf(error, 4096, "phar error: Cannot open temporary file for decompressing phar archive \"%s\" file \"%s\"", phar->fname, entry->filename);
return FAILURE;
}
@@ -749,15 +749,15 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
dummy.internal_file = entry;
dummy.phar = phar;
dummy.zero = entry->offset;
- dummy.fp = phar_get_pharfp(phar TSRMLS_CC);
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1 TSRMLS_CC)) {
+ dummy.fp = phar_get_pharfp(phar);
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 1)) {
return FAILURE;
}
- ufp = phar_get_entrypufp(entry TSRMLS_CC);
+ ufp = phar_get_entrypufp(entry);
if ((filtername = phar_decompress_filter(entry, 0)) != NULL) {
- filter = php_stream_filter_create(filtername, NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, NULL, 0);
} else {
filter = NULL;
}
@@ -772,19 +772,19 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
php_stream_seek(ufp, 0, SEEK_END);
loc = php_stream_tell(ufp);
php_stream_filter_append(&ufp->writefilters, filter);
- php_stream_seek(phar_get_entrypfp(entry TSRMLS_CC), phar_get_fp_offset(entry TSRMLS_CC), SEEK_SET);
+ php_stream_seek(phar_get_entrypfp(entry), phar_get_fp_offset(entry), SEEK_SET);
if (entry->uncompressed_filesize) {
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_entrypfp(entry TSRMLS_CC), ufp, entry->compressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_entrypfp(entry), ufp, entry->compressed_filesize, NULL)) {
spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
return FAILURE;
}
}
php_stream_filter_flush(filter, 1);
php_stream_flush(ufp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
if (php_stream_tell(ufp) - loc != (zend_off_t) entry->uncompressed_filesize) {
spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
@@ -794,17 +794,17 @@ int phar_open_entry_fp(phar_entry_info *entry, char **error, int follow_links TS
entry->old_flags = entry->flags;
/* this is now the new location of the file contents within this fp */
- phar_set_fp_type(entry, PHAR_UFP, loc TSRMLS_CC);
+ phar_set_fp_type(entry, PHAR_UFP, loc);
dummy.zero = entry->offset;
dummy.fp = ufp;
- if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_postprocess_file(&dummy, entry->crc32, error, 0)) {
return FAILURE;
}
return SUCCESS;
}
/* }}} */
-int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
{
if (entry->fp_type == PHAR_MOD) {
/* already newly created, truncate */
@@ -857,12 +857,12 @@ int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry,
}
/* }}} */
-int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+int phar_separate_entry_fp(phar_entry_info *entry, char **error) /* {{{ */
{
php_stream *fp;
phar_entry_info *link;
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return FAILURE;
}
@@ -875,14 +875,14 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{
spprintf(error, 0, "phar error: unable to create temporary file");
return FAILURE;
}
- phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
- link = phar_get_link_source(entry TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 1);
+ link = phar_get_link_source(entry);
if (!link) {
link = entry;
}
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0 TSRMLS_CC), fp, link->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(link, 0), fp, link->uncompressed_filesize, NULL)) {
if (error) {
spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname);
}
@@ -906,16 +906,16 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{
/**
* helper function to open an internal file's fp just-in-time
*/
-phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC) /* {{{ */
+phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
{
if (error) {
*error = NULL;
}
/* seek to start of internal file and read it */
- if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, error, 1)) {
return NULL;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 1)) {
spprintf(error, 4096, "phar error: cannot seek to start of file \"%s\" in phar \"%s\"", entry->filename, phar->fname);
return NULL;
}
@@ -923,7 +923,7 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry,
}
/* }}} */
-PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC) /* {{{ */ {
+PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len) /* {{{ */ {
phar_archive_data *fd_ptr;
if (PHAR_GLOBALS->phar_alias_map.arHash
&& NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
@@ -935,7 +935,7 @@ PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename,
}
/* }}} */
-int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */
+int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len) /* {{{ */
{
if (phar->refcount || phar->is_persistent) {
return FAILURE;
@@ -958,13 +958,13 @@ int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_D
* Looks up a phar archive in the filename map, connecting it to the alias
* (if any) or returns null
*/
-int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error TSRMLS_DC) /* {{{ */
+int phar_get_archive(phar_archive_data **archive, char *fname, int fname_len, char *alias, int alias_len, char **error) /* {{{ */
{
phar_archive_data *fd, *fd_ptr;
char *my_realpath, *save;
int save_len;
- phar_request_initialize(TSRMLS_C);
+ phar_request_initialize();
if (error) {
*error = NULL;
@@ -1009,7 +1009,7 @@ alias_success:
if (error) {
spprintf(error, 0, "alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"", alias, fd_ptr->fname, fname);
}
- if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
efree(*error);
*error = NULL;
@@ -1116,7 +1116,7 @@ alias_success:
}
/* not found, try converting \ to / */
- my_realpath = expand_filepath(fname, my_realpath TSRMLS_CC);
+ my_realpath = expand_filepath(fname, my_realpath);
if (my_realpath) {
fname_len = strlen(my_realpath);
@@ -1202,9 +1202,9 @@ char * phar_decompress_filter(phar_entry_info * entry, int return_unknown) /* {{
/**
* retrieve information on a file contained within a phar, or null if it ain't there
*/
-phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security) /* {{{ */
{
- return phar_get_entry_info_dir(phar, path, path_len, 0, error, security TSRMLS_CC);
+ return phar_get_entry_info_dir(phar, path, path_len, 0, error, security);
}
/* }}} */
/**
@@ -1212,7 +1212,7 @@ phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int pa
* allow_dir is 0 for none, 1 for both empty directories in the phar and temp directories, and 2 for only
* valid pre-existing empty directory entries
*/
-phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security TSRMLS_DC) /* {{{ */
+phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security) /* {{{ */
{
const char *pcr_error;
phar_entry_info *entry;
@@ -1344,7 +1344,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in
}
/* mount the file just in time */
- if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len TSRMLS_CC)) {
+ if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len)) {
efree(test);
if (error) {
spprintf(error, 4096, "phar error: path \"%s\" exists as file \"%s\" and could not be mounted", path, test);
@@ -1371,7 +1371,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, in
static const char hexChars[] = "0123456789ABCDEF";
-static int phar_hex_str(const char *digest, size_t digest_len, char **signature TSRMLS_DC) /* {{{ */
+static int phar_hex_str(const char *digest, size_t digest_len, char **signature) /* {{{ */
{
int pos = -1;
size_t len = 0;
@@ -1388,7 +1388,7 @@ static int phar_hex_str(const char *digest, size_t digest_len, char **signature
/* }}} */
#ifndef PHAR_HAVE_OPENSSL
-static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len TSRMLS_DC) /* {{{ */
+static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t end, char *key, int key_len, char **signature, int *signature_len) /* {{{ */
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
@@ -1414,7 +1414,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
return FAILURE;
}
- if (FAILURE == zend_fcall_info_init(&openssl, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) {
+ if (FAILURE == zend_fcall_info_init(&openssl, 0, &fci, &fcc, NULL, NULL)) {
zval_dtor(&zp[0]);
zval_dtor(&zp[1]);
zval_dtor(&zp[2]);
@@ -1434,7 +1434,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
fci.retval = &retval;
- if (FAILURE == zend_call_function(&fci, &fcc TSRMLS_CC)) {
+ if (FAILURE == zend_call_function(&fci, &fcc)) {
zval_dtor(&zp[0]);
zval_dtor(&zp[1]);
zval_dtor(&zp[2]);
@@ -1476,7 +1476,7 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
/* }}} */
#endif /* #ifndef PHAR_HAVE_OPENSSL */
-int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error TSRMLS_DC) /* {{{ */
+int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_type, char *sig, int sig_len, char *fname, char **signature, int *signature_len, char **error) /* {{{ */
{
int read_size, len;
zend_off_t read_len;
@@ -1524,7 +1524,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
#ifndef PHAR_HAVE_OPENSSL
tempsig = sig_len;
- if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, pubkey ? pubkey->val : NULL, pubkey ? pubkey->len : 0, &sig, &tempsig TSRMLS_CC)) {
+ if (FAILURE == phar_call_openssl_signverify(0, fp, end_of_phar, pubkey ? pubkey->val : NULL, pubkey ? pubkey->len : 0, &sig, &tempsig)) {
if (pubkey) {
zend_string_release(pubkey);
}
@@ -1597,7 +1597,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
EVP_MD_CTX_cleanup(&md_ctx);
#endif
- *signature_len = phar_hex_str((const char*)sig, sig_len, signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)sig, sig_len, signature);
}
break;
#ifdef PHAR_HASH_OK
@@ -1631,7 +1631,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
case PHAR_SIG_SHA256: {
@@ -1664,7 +1664,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
#else
@@ -1705,7 +1705,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
case PHAR_SIG_MD5: {
@@ -1738,7 +1738,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
- *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature TSRMLS_CC);
+ *signature_len = phar_hex_str((const char*)digest, sizeof(digest), signature);
break;
}
default:
@@ -1751,7 +1751,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
}
/* }}} */
-int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error TSRMLS_DC) /* {{{ */
+int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error) /* {{{ */
{
unsigned char buf[1024];
int sig_len;
@@ -1869,7 +1869,7 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat
siglen = 0;
php_stream_seek(fp, 0, SEEK_END);
- if (FAILURE == phar_call_openssl_signverify(1, fp, php_stream_tell(fp), PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len), (char **)&sigbuf, &siglen TSRMLS_CC)) {
+ if (FAILURE == phar_call_openssl_signverify(1, fp, php_stream_tell(fp), PHAR_G(openssl_privatekey), PHAR_G(openssl_privatekey_len), (char **)&sigbuf, &siglen)) {
if (error) {
spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
}
@@ -1914,12 +1914,12 @@ int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signat
}
}
- phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature TSRMLS_CC);
+ phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature);
return SUCCESS;
}
/* }}} */
-void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len TSRMLS_DC) /* {{{ */
+void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len) /* {{{ */
{
const char *s;
@@ -1932,7 +1932,7 @@ void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename
}
/* }}} */
-static int phar_update_cached_entry(zval *data, void *argument TSRMLS_DC) /* {{{ */
+static int phar_update_cached_entry(zval *data, void *argument) /* {{{ */
{
phar_entry_info *entry = (phar_entry_info *)Z_PTR_P(data);
@@ -1954,7 +1954,7 @@ static int phar_update_cached_entry(zval *data, void *argument TSRMLS_DC) /* {{{
if (entry->metadata_len) {
char *buf = estrndup((char *) Z_PTR(entry->metadata), entry->metadata_len);
/* assume success, we would have failed before */
- phar_parse_metadata((char **) &buf, &entry->metadata, entry->metadata_len TSRMLS_CC);
+ phar_parse_metadata((char **) &buf, &entry->metadata, entry->metadata_len);
efree(buf);
} else {
zval_copy_ctor(&entry->metadata);
@@ -1973,7 +1973,7 @@ static void phar_manifest_copy_ctor(zval *zv) /* {{{ */
}
/* }}} */
-static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+static void phar_copy_cached_phar(phar_archive_data **pphar) /* {{{ */
{
phar_archive_data *phar;
HashTable newmanifest;
@@ -1999,7 +1999,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
/* assume success, we would have failed before */
if (phar->metadata_len) {
char *buf = estrndup((char *) Z_PTR(phar->metadata), phar->metadata_len);
- phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len TSRMLS_CC);
+ phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len);
efree(buf);
} else {
zval_copy_ctor(&phar->metadata);
@@ -2009,7 +2009,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
zend_hash_init(&newmanifest, sizeof(phar_entry_info),
zend_get_hash_value, destroy_phar_manifest_entry, 0);
zend_hash_copy(&newmanifest, &(*pphar)->manifest, phar_manifest_copy_ctor);
- zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar TSRMLS_CC);
+ zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar);
phar->manifest = newmanifest;
zend_hash_init(&phar->mounted_dirs, sizeof(char *),
zend_get_hash_value, NULL, 0);
@@ -2027,7 +2027,7 @@ static void phar_copy_cached_phar(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
}
/* }}} */
-int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
+int phar_copy_on_write(phar_archive_data **pphar) /* {{{ */
{
zval zv, *pzv;
phar_archive_data *newpphar;
@@ -2037,7 +2037,7 @@ int phar_copy_on_write(phar_archive_data **pphar TSRMLS_DC) /* {{{ */
return FAILURE;
}
- phar_copy_cached_phar((phar_archive_data **)&Z_PTR_P(pzv) TSRMLS_CC);
+ phar_copy_cached_phar((phar_archive_data **)&Z_PTR_P(pzv));
newpphar = Z_PTR_P(pzv);
/* invalidate phar cache */
PHAR_G(last_phar) = NULL;
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 4fe0bf05c8..d5316452ab 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -39,7 +39,7 @@ static inline void phar_write_16(char buffer[2], php_uint32 value)
# define PHAR_SET_32(var, value) phar_write_32(var, (php_uint32) (value));
# define PHAR_SET_16(var, value) phar_write_16(var, (php_uint16) (value));
-static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len TSRMLS_DC) /* {{{ */
+static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len) /* {{{ */
{
union {
phar_zip_extra_field_header header;
@@ -163,7 +163,7 @@ static void phar_zip_u2d_time(time_t time, char *dtime, char *ddate) /* {{{ */
* This is used by phar_open_from_fp to process a zip-based phar, but can be called
* directly.
*/
-int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
@@ -237,7 +237,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
mydata->metadata_len = PHAR_GET_16(locator.comment_len);
- if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len) TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len)) == FAILURE) {
mydata->metadata_len = 0;
/* if not valid serialized data, it is a regular string */
@@ -422,7 +422,7 @@ foundit:
PHAR_ZIP_FAIL("signature cannot be read");
}
mydata->sig_flags = PHAR_GET_32(sig);
- if (FAILURE == phar_verify_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_filesize - 8, fname, &mydata->signature, &mydata->sig_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_verify_signature(sigfile, php_stream_tell(sigfile), mydata->sig_flags, sig + 8, entry.uncompressed_filesize - 8, fname, &mydata->signature, &mydata->sig_len, error)) {
efree(sig);
if (error) {
char *save;
@@ -445,11 +445,11 @@ foundit:
continue;
}
- phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(mydata, entry.filename, entry.filename_len);
if (PHAR_GET_16(zipentry.extra_len)) {
zend_off_t loc = php_stream_tell(fp);
- if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len) TSRMLS_CC)) {
+ if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) {
pefree(entry.filename, entry.is_persistent);
PHAR_ZIP_FAIL("Unable to process extra field header for file in central directory");
}
@@ -525,7 +525,7 @@ foundit:
p = buf;
entry.metadata_len = PHAR_GET_16(zipentry.comment_len);
- if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len) TSRMLS_CC) == FAILURE) {
+ if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len)) == FAILURE) {
entry.metadata_len = 0;
/* if not valid serialized data, it is a regular string */
@@ -570,7 +570,7 @@ foundit:
mydata->alias_len = entry.uncompressed_filesize;
if (entry.flags & PHAR_ENT_COMPRESSED_GZ) {
- filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp));
if (!filter) {
pefree(entry.filename, entry.is_persistent);
@@ -599,10 +599,10 @@ foundit:
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
} else if (entry.flags & PHAR_ENT_COMPRESSED_BZ2) {
- filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC);
+ filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp));
if (!filter) {
pefree(entry.filename, entry.is_persistent);
@@ -631,7 +631,7 @@ foundit:
}
php_stream_filter_flush(filter, 1);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
} else {
// TODO: refactor to avoid reallocation ???
//??? entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_filesize, 0)
@@ -657,7 +657,7 @@ foundit:
php_stream_seek(fp, saveloc, SEEK_SET);
}
- phar_set_inode(&entry TSRMLS_CC);
+ phar_set_inode(&entry);
zend_hash_str_add_mem(&mydata->manifest, entry.filename, entry.filename_len, (void *)&entry, sizeof(phar_entry_info));
}
@@ -686,7 +686,7 @@ foundit:
mydata->is_temporary_alias = 0;
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), actual_alias, mydata->alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, mydata->alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, actual_alias, mydata->alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with implicit alias, alias is already in use", fname);
}
@@ -708,7 +708,7 @@ foundit:
if (alias_len) {
if (NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_GLOBALS->phar_alias_map), alias, alias_len))) {
- if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len TSRMLS_CC)) {
+ if (SUCCESS != phar_free_alias(fd_ptr, alias, alias_len)) {
if (error) {
spprintf(error, 4096, "phar error: Unable to add zip-based phar \"%s\" with explicit alias, alias is already in use", fname);
}
@@ -739,10 +739,10 @@ foundit:
/**
* Create or open a zip-based phar for writing
*/
-int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
+int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error) /* {{{ */
{
phar_archive_data *phar;
- int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error TSRMLS_CC);
+ int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
if (FAILURE == ret) {
return FAILURE;
@@ -783,7 +783,7 @@ struct _phar_zip_pass {
char **error;
};
/* perform final modification of zip contents for each file in the manifest before saving */
-static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_DC) /* {{{ */
+static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ */
{
phar_zip_file_header local;
phar_zip_unix3 perms;
@@ -807,7 +807,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
}
}
- phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len TSRMLS_CC);
+ phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
memset(&local, 0, sizeof(local));
memset(&central, 0, sizeof(central));
memset(&perms, 0, sizeof(perms));
@@ -860,7 +860,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto continue_dir;
}
- if (FAILURE == phar_open_entry_fp(entry, p->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) {
spprintf(p->error, 0, "unable to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -871,12 +871,12 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto is_compressed;
}
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
- efp = phar_get_efp(entry, 0 TSRMLS_CC);
+ efp = phar_get_efp(entry, 0);
newcrc32 = ~0;
for (loc = 0;loc < entry->uncompressed_filesize; ++loc) {
@@ -895,7 +895,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
goto not_compressed;
}
- filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0 TSRMLS_CC);
+ filter = php_stream_filter_create(phar_compress_filter(entry, 0), NULL, 0);
if (!filter) {
if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
@@ -918,7 +918,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
php_stream_flush(efp);
- if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
+ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, 0)) {
spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -932,7 +932,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg TSRMLS_D
php_stream_filter_flush(filter, 1);
php_stream_flush(entry->cfp);
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
php_stream_seek(entry->cfp, 0, SEEK_END);
entry->compressed_filesize = (php_uint32) php_stream_tell(entry->cfp);
PHAR_SET_32(central.compsize, entry->compressed_filesize);
@@ -967,7 +967,7 @@ continue_dir:
}
entry->metadata_str.s = NULL;
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&entry->metadata_str, &entry->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
PHAR_SET_16(central.comment_len, entry->metadata_str.s->len);
}
@@ -1037,13 +1037,13 @@ continue_dir:
php_stream_close(entry->cfp);
entry->cfp = NULL;
} else {
- if (FAILURE == phar_open_entry_fp(entry, p->error, 0 TSRMLS_CC)) {
+ if (FAILURE == phar_open_entry_fp(entry, p->error, 0)) {
return ZEND_HASH_APPLY_STOP;
}
- phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC);
+ phar_seek_efp(entry, 0, SEEK_SET, 0, 0);
- if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0 TSRMLS_CC), p->filefp, entry->uncompressed_filesize, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, 0), p->filefp, entry->uncompressed_filesize, NULL)) {
spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
return ZEND_HASH_APPLY_STOP;
}
@@ -1093,14 +1093,14 @@ continue_dir:
}
/* }}} */
-static int phar_zip_changed_apply(zval *zv, void *arg TSRMLS_DC) /* {{{ */
+static int phar_zip_changed_apply(zval *zv, void *arg) /* {{{ */
{
- return phar_zip_changed_apply_int(Z_PTR_P(zv), arg TSRMLS_CC);
+ return phar_zip_changed_apply_int(Z_PTR_P(zv), arg);
}
/* }}} */
static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pass *pass,
- smart_str *metadata TSRMLS_DC) /* {{{ */
+ smart_str *metadata) /* {{{ */
{
/* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */
if (!phar->is_data || phar->sig_flags) {
@@ -1126,7 +1126,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
php_stream_write(newfile, metadata->s->val, metadata->s->len);
}
- if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error TSRMLS_CC)) {
+ if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error)) {
if (pass->error) {
char *save = *(pass->error);
spprintf(pass->error, 0, "phar error: unable to write signature to zip-based phar: %s", save);
@@ -1164,7 +1164,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
entry.uncompressed_filesize = entry.compressed_filesize = signature_length + 8;
entry.phar = phar;
/* throw out return value and write the signature */
- phar_zip_changed_apply_int(&entry, (void *)pass TSRMLS_CC);
+ phar_zip_changed_apply_int(&entry, (void *)pass);
php_stream_close(newfile);
if (pass->error && *(pass->error)) {
@@ -1177,7 +1177,7 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
}
/* }}} */
-int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error TSRMLS_DC) /* {{{ */
+int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
{
char *pos;
smart_str main_metadata_str = {0};
@@ -1243,7 +1243,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int
/* register alias */
if (phar->alias_len) {
- if (FAILURE == phar_get_archive(&phar, phar->fname, phar->fname_len, phar->alias, phar->alias_len, error TSRMLS_CC)) {
+ if (FAILURE == phar_get_archive(&phar, phar->fname, phar->fname_len, phar->alias, phar->alias_len, error)) {
return EOF;
}
}
@@ -1431,12 +1431,12 @@ fperror:
PHAR_SET_16(eocd.counthere, zend_hash_num_elements(&phar->manifest));
PHAR_SET_16(eocd.count, zend_hash_num_elements(&phar->manifest));
}
- zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass TSRMLS_CC);
+ zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass);
if (Z_TYPE(phar->metadata) != IS_UNDEF) {
/* set phar metadata */
PHP_VAR_SERIALIZE_INIT(metadata_hash);
- php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash TSRMLS_CC);
+ php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
PHP_VAR_SERIALIZE_DESTROY(metadata_hash);
}
if (temperr) {
@@ -1457,7 +1457,7 @@ nocentralerror:
return EOF;
}
- if (FAILURE == phar_zip_applysignature(phar, &pass, &main_metadata_str TSRMLS_CC)) {
+ if (FAILURE == phar_zip_applysignature(phar, &pass, &main_metadata_str)) {
goto temperror;
}
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index ca7d34c645..7cd4b56dd7 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -381,7 +381,7 @@ ZEND_GET_MODULE(posix)
#define PHP_POSIX_SINGLE_ARG_FUNC(func_name) \
zend_long val; \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) RETURN_FALSE; \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) RETURN_FALSE; \
if (func_name(val) < 0) { \
POSIX_G(last_error) = errno; \
RETURN_FALSE; \
@@ -395,7 +395,7 @@ PHP_FUNCTION(posix_kill)
{
zend_long pid, sig;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &sig) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &pid, &sig) == FAILURE) {
RETURN_FALSE;
}
@@ -560,7 +560,7 @@ PHP_FUNCTION(posix_setpgid)
{
zend_long pid, pgid;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &pid, &pgid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &pid, &pgid) == FAILURE) {
RETURN_FALSE;
}
@@ -579,7 +579,7 @@ PHP_FUNCTION(posix_setpgid)
PHP_FUNCTION(posix_getpgid)
{
zend_long val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) {
RETURN_FALSE;
}
@@ -598,7 +598,7 @@ PHP_FUNCTION(posix_getpgid)
PHP_FUNCTION(posix_getsid)
{
zend_long val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &val) == FAILURE) {
RETURN_FALSE;
}
@@ -693,14 +693,14 @@ PHP_FUNCTION(posix_ctermid)
/* }}} */
/* Checks if the provides resource is a stream and if it provides a file descriptor */
-static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) /* {{{ */
+static int php_posix_stream_get_fd(zval *zfp, int *fd) /* {{{ */
{
php_stream *stream;
php_stream_from_zval_no_verify(stream, zfp);
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 1 to be a valid stream resource");
+ php_error_docref(NULL, E_WARNING, "expects argument 1 to be a valid stream resource");
return 0;
}
if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) {
@@ -708,7 +708,7 @@ static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC) /* {{{ */
} else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) {
php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)fd, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not use stream of type '%s'",
+ php_error_docref(NULL, E_WARNING, "could not use stream of type '%s'",
stream->ops->label);
return 0;
}
@@ -727,13 +727,13 @@ PHP_FUNCTION(posix_ttyname)
zend_long buflen;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ if (!php_posix_stream_get_fd(z_fd, &fd)) {
RETURN_FALSE;
}
break;
@@ -772,13 +772,13 @@ PHP_FUNCTION(posix_isatty)
zval *z_fd;
int fd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &z_fd) == FAILURE) {
RETURN_FALSE;
}
switch (Z_TYPE_P(z_fd)) {
case IS_RESOURCE:
- if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+ if (!php_posix_stream_get_fd(z_fd, &fd)) {
RETURN_FALSE;
}
break;
@@ -839,11 +839,11 @@ PHP_FUNCTION(posix_mkfifo)
zend_long mode;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &path, &path_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &path, &path_len, &mode) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
RETURN_FALSE;
}
@@ -872,29 +872,29 @@ PHP_FUNCTION(posix_mknod)
php_dev = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl|ll", &path, &path_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl|ll", &path, &path_len,
&mode, &major, &minor) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
RETURN_FALSE;
}
if ((mode & S_IFCHR) || (mode & S_IFBLK)) {
if (ZEND_NUM_ARGS() == 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
+ php_error_docref(NULL, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
RETURN_FALSE;
}
if (major == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expects argument 3 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK");
RETURN_FALSE;
} else {
#if defined(HAVE_MAKEDEV) || defined(makedev)
php_dev = makedev(major, minor);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create a block or character device, creating a normal file instead");
+ php_error_docref(NULL, E_WARNING, "Cannot create a block or character device, creating a normal file instead");
#endif
}
}
@@ -951,17 +951,17 @@ PHP_FUNCTION(posix_access)
size_t filename_len, ret;
char *filename, *path;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &mode) == FAILURE) {
RETURN_FALSE;
}
- path = expand_filepath(filename, NULL TSRMLS_CC);
+ path = expand_filepath(filename, NULL);
if (!path) {
POSIX_G(last_error) = EIO;
RETURN_FALSE;
}
- if (php_check_open_basedir_ex(path, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(path, 0)) {
efree(path);
POSIX_G(last_error) = EPERM;
RETURN_FALSE;
@@ -999,7 +999,7 @@ PHP_FUNCTION(posix_getgrnam)
char *buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1026,7 +1026,7 @@ PHP_FUNCTION(posix_getgrnam)
if (!php_posix_group_to_array(g, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix group to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(posix_getgrgid)
#endif
struct group *g;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &gid) == FAILURE) {
RETURN_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1078,7 +1078,7 @@ PHP_FUNCTION(posix_getgrgid)
if (!php_posix_group_to_array(g, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix group struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
@@ -1118,7 +1118,7 @@ PHP_FUNCTION(posix_getpwnam)
char *buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(posix_getpwnam)
if (!php_posix_passwd_to_array(pw, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
@@ -1168,7 +1168,7 @@ PHP_FUNCTION(posix_getpwuid)
#endif
struct passwd *pw;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &uid) == FAILURE) {
RETURN_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
@@ -1195,7 +1195,7 @@ PHP_FUNCTION(posix_getpwuid)
if (!php_posix_passwd_to_array(pw, return_value)) {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
+ php_error_docref(NULL, E_WARNING, "unable to convert posix passwd struct to array");
RETVAL_FALSE;
}
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
@@ -1211,7 +1211,7 @@ PHP_FUNCTION(posix_getpwuid)
/* {{{ posix_addlimit
*/
-static int posix_addlimit(int limit, char *name, zval *return_value TSRMLS_DC) {
+static int posix_addlimit(int limit, char *name, zval *return_value) {
int result;
struct rlimit rl;
char hard[80];
@@ -1312,7 +1312,7 @@ PHP_FUNCTION(posix_getrlimit)
array_init(return_value);
for (l=limits; l->name; l++) {
- if (posix_addlimit(l->limit, l->name, return_value TSRMLS_CC) == FAILURE) {
+ if (posix_addlimit(l->limit, l->name, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1338,7 +1338,7 @@ PHP_FUNCTION(posix_strerror)
{
zend_long error;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &error) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &error) == FAILURE) {
RETURN_FALSE;
}
@@ -1357,7 +1357,7 @@ PHP_FUNCTION(posix_initgroups)
char *name;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &name, &name_len, &basegid) == FAILURE) {
RETURN_FALSE;
}
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index 72165ae78e..d9fad750fb 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -213,14 +213,14 @@ zend_module_entry pspell_module_entry = {
ZEND_GET_MODULE(pspell)
#endif
-static void php_pspell_close(zend_resource *rsrc TSRMLS_DC)
+static void php_pspell_close(zend_resource *rsrc)
{
PspellManager *manager = (PspellManager *)rsrc->ptr;
delete_pspell_manager(manager);
}
-static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
+static void php_pspell_close_config(zend_resource *rsrc)
{
PspellConfig *config = (PspellConfig *)rsrc->ptr;
@@ -230,7 +230,7 @@ static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
#define PSPELL_FETCH_CONFIG do { \
zval *res = zend_hash_index_find(&EG(regular_list), conf); \
if (res == NULL || Z_RES_P(res)->type != le_pspell_config) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL config index", conf); \
+ php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL config index", conf); \
RETURN_FALSE; \
} \
config = (PspellConfig *)Z_RES_P(res)->ptr; \
@@ -239,7 +239,7 @@ static void php_pspell_close_config(zend_resource *rsrc TSRMLS_DC)
#define PSPELL_FETCH_MANAGER do { \
zval *res = zend_hash_index_find(&EG(regular_list), scin); \
if (res == NULL || Z_RES_P(res)->type != le_pspell) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a PSPELL result index", scin); \
+ php_error_docref(NULL, E_WARNING, "%ld is not a PSPELL result index", scin); \
RETURN_FALSE; \
} \
manager = (PspellManager *)Z_RES_P(res)->ptr; \
@@ -281,7 +281,7 @@ static PHP_FUNCTION(pspell_new)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|sssl", &language, &language_len, &spelling, &spelling_len,
+ if (zend_parse_parameters(argc, "s|sssl", &language, &language_len, &spelling, &spelling_len,
&jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
return;
}
@@ -345,13 +345,13 @@ static PHP_FUNCTION(pspell_new)
delete_pspell_config(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -378,7 +378,7 @@ static PHP_FUNCTION(pspell_new_personal)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(argc TSRMLS_CC, "ps|sssl", &personal, &personal_len, &language, &language_len,
+ if (zend_parse_parameters(argc, "ps|sssl", &personal, &personal_len, &language, &language_len,
&spelling, &spelling_len, &jargon, &jargon_len, &encoding, &encoding_len, &mode) == FAILURE) {
return;
}
@@ -406,7 +406,7 @@ static PHP_FUNCTION(pspell_new_personal)
}
#endif
- if (php_check_open_basedir(personal TSRMLS_CC)) {
+ if (php_check_open_basedir(personal)) {
delete_pspell_config(config);
RETURN_FALSE;
}
@@ -450,13 +450,13 @@ static PHP_FUNCTION(pspell_new_personal)
delete_pspell_config(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -471,7 +471,7 @@ static PHP_FUNCTION(pspell_new_config)
PspellManager *manager;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &conf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &conf) == FAILURE) {
return;
}
@@ -480,13 +480,13 @@ static PHP_FUNCTION(pspell_new_config)
ret = new_pspell_manager(config);
if (pspell_error_number(ret) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
+ php_error_docref(NULL, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s", pspell_error_message(ret));
delete_pspell_can_have_error(ret);
RETURN_FALSE;
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
+ ind = zend_list_insert(manager, le_pspell);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -500,7 +500,7 @@ static PHP_FUNCTION(pspell_check)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -525,7 +525,7 @@ static PHP_FUNCTION(pspell_suggest)
const PspellWordList *wl;
const char *sug;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -541,7 +541,7 @@ static PHP_FUNCTION(pspell_suggest)
}
delete_pspell_string_emulation(els);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL had a problem. details: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "PSPELL had a problem. details: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -556,7 +556,7 @@ static PHP_FUNCTION(pspell_store_replacement)
char *miss, *corr;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lss", &scin, &miss, &miss_len, &corr, &corr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lss", &scin, &miss, &miss_len, &corr, &corr_len) == FAILURE) {
return;
}
@@ -566,7 +566,7 @@ static PHP_FUNCTION(pspell_store_replacement)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -581,7 +581,7 @@ static PHP_FUNCTION(pspell_add_to_personal)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -596,7 +596,7 @@ static PHP_FUNCTION(pspell_add_to_personal)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -611,7 +611,7 @@ static PHP_FUNCTION(pspell_add_to_session)
char *word;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &scin, &word, &word_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &scin, &word, &word_len) == FAILURE) {
return;
}
@@ -626,7 +626,7 @@ static PHP_FUNCTION(pspell_add_to_session)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -639,7 +639,7 @@ static PHP_FUNCTION(pspell_clear_session)
zend_long scin;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scin) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &scin) == FAILURE) {
return;
}
@@ -649,7 +649,7 @@ static PHP_FUNCTION(pspell_clear_session)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@@ -662,7 +662,7 @@ static PHP_FUNCTION(pspell_save_wordlist)
zend_long scin;
PspellManager *manager;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &scin) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &scin) == FAILURE) {
return;
}
@@ -673,7 +673,7 @@ static PHP_FUNCTION(pspell_save_wordlist)
if (pspell_manager_error_number(manager) == 0) {
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
+ php_error_docref(NULL, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
@@ -697,7 +697,7 @@ static PHP_FUNCTION(pspell_config_create)
DWORD dwType,dwLen;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sss", &language, &language_len, &spelling, &spelling_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sss", &language, &language_len, &spelling, &spelling_len,
&jargon, &jargon_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -743,7 +743,7 @@ static PHP_FUNCTION(pspell_config_create)
which is not what we want */
pspell_config_replace(config, "save-repl", "false");
- ind = zend_list_insert(config, le_pspell_config TSRMLS_CC);
+ ind = zend_list_insert(config, le_pspell_config);
RETURN_LONG(Z_RES_HANDLE_P(ind));
}
/* }}} */
@@ -756,7 +756,7 @@ static PHP_FUNCTION(pspell_config_runtogether)
zend_bool runtogether;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &conf, &runtogether) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &conf, &runtogether) == FAILURE) {
return;
}
@@ -775,7 +775,7 @@ static PHP_FUNCTION(pspell_config_mode)
zend_long conf, mode;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &conf, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &conf, &mode) == FAILURE) {
return;
}
@@ -802,7 +802,7 @@ static PHP_FUNCTION(pspell_config_ignore)
zend_long conf, ignore = 0L;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &conf, &ignore) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &conf, &ignore) == FAILURE) {
return;
}
@@ -822,13 +822,13 @@ static void pspell_config_path(INTERNAL_FUNCTION_PARAMETERS, char *option)
size_t value_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &value, &value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lp", &conf, &value, &value_len) == FAILURE) {
return;
}
PSPELL_FETCH_CONFIG;
- if (php_check_open_basedir(value TSRMLS_CC)) {
+ if (php_check_open_basedir(value)) {
RETURN_FALSE;
}
@@ -870,7 +870,7 @@ static PHP_FUNCTION(pspell_config_repl)
size_t repl_len;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lp", &conf, &repl, &repl_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lp", &conf, &repl, &repl_len) == FAILURE) {
return;
}
@@ -878,7 +878,7 @@ static PHP_FUNCTION(pspell_config_repl)
pspell_config_replace(config, "save-repl", "true");
- if (php_check_open_basedir(repl TSRMLS_CC)) {
+ if (php_check_open_basedir(repl)) {
RETURN_FALSE;
}
@@ -896,7 +896,7 @@ static PHP_FUNCTION(pspell_config_save_repl)
zend_bool save;
PspellConfig *config;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &conf, &save) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &conf, &save) == FAILURE) {
return;
}
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0e7b146174..b12a1e1504 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -216,7 +216,7 @@ PHP_FUNCTION(readline)
size_t prompt_len;
char *result;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &prompt, &prompt_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &prompt, &prompt_len)) {
RETURN_FALSE;
}
@@ -243,7 +243,7 @@ PHP_FUNCTION(readline_info)
size_t what_len, oldval;
char *oldstr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sz", &what, &what_len, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sz", &what, &what_len, &value) == FAILURE) {
return;
}
@@ -338,7 +338,7 @@ PHP_FUNCTION(readline_add_history)
char *arg;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -398,11 +398,11 @@ PHP_FUNCTION(readline_read_history)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &arg, &arg_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(arg TSRMLS_CC)) {
+ if (php_check_open_basedir(arg)) {
RETURN_FALSE;
}
@@ -422,11 +422,11 @@ PHP_FUNCTION(readline_write_history)
char *arg = NULL;
size_t arg_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|p", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|p", &arg, &arg_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(arg TSRMLS_CC)) {
+ if (php_check_open_basedir(arg)) {
RETURN_FALSE;
}
@@ -481,13 +481,12 @@ static char **_readline_completion_cb(const char *text, int start, int end)
zval params[3];
int i;
char **matches = NULL;
- TSRMLS_FETCH();
_readline_string_zval(&params[0], text);
_readline_long_zval(&params[1], start);
_readline_long_zval(&params[2], end);
- if (call_user_function(CG(function_table), NULL, &_readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
+ if (call_user_function(CG(function_table), NULL, &_readline_completion, &_readline_array, 3, params) == SUCCESS) {
if (Z_TYPE(_readline_array) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
matches = rl_completion_matches(text,_readline_command_generator);
@@ -515,12 +514,12 @@ PHP_FUNCTION(readline_completion_function)
zval *arg = NULL;
zend_string *name = NULL;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg)) {
RETURN_FALSE;
}
- if (!zend_is_callable(arg, 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name->val);
+ if (!zend_is_callable(arg, 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "%s is not callable", name->val);
zend_string_release(name);
RETURN_FALSE;
}
@@ -544,13 +543,12 @@ static void php_rl_callback_handler(char *the_line)
{
zval params[1];
zval dummy;
- TSRMLS_FETCH();
ZVAL_NULL(&dummy);
_readline_string_zval(&params[0], the_line);
- call_user_function(CG(function_table), NULL, &_prepped_callback, &dummy, 1, params TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &_prepped_callback, &dummy, 1, params);
zval_ptr_dtor(&params[0]);
zval_dtor(&dummy);
@@ -565,12 +563,12 @@ PHP_FUNCTION(readline_callback_handler_install)
char *prompt;
size_t prompt_len;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &prompt, &prompt_len, &callback)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz", &prompt, &prompt_len, &callback)) {
return;
}
- if (!zend_is_callable(callback, 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not callable", name->val);
+ if (!zend_is_callable(callback, 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "%s is not callable", name->val);
zend_string_release(name);
RETURN_FALSE;
}
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
index 48ab488763..b739fbfd4b 100644
--- a/ext/readline/readline_cli.c
+++ b/ext/readline/readline_cli.c
@@ -79,7 +79,7 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_readline);
static char php_last_char = '\0';
static FILE *pager_pipe = NULL;
-static size_t readline_shell_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_write(const char *str, size_t str_length) /* {{{ */
{
if (CLIR_G(prompt_str)) {
smart_str_appendl(CLIR_G(prompt_str), str, str_length);
@@ -97,7 +97,7 @@ static size_t readline_shell_write(const char *str, size_t str_length TSRMLS_DC)
}
/* }}} */
-static size_t readline_shell_ub_write(const char *str, size_t str_length TSRMLS_DC) /* {{{ */
+static size_t readline_shell_ub_write(const char *str, size_t str_length) /* {{{ */
{
/* We just store the last char here and then pass back to the
caller (sapi_cli_single_write in sapi/cli) which will actually
@@ -107,7 +107,7 @@ static size_t readline_shell_ub_write(const char *str, size_t str_length TSRMLS_
}
/* }}} */
-static void cli_readline_init_globals(zend_cli_readline_globals *rg TSRMLS_DC)
+static void cli_readline_init_globals(zend_cli_readline_globals *rg)
{
rg->pager = NULL;
rg->prompt = NULL;
@@ -134,7 +134,7 @@ typedef enum {
outside,
} php_code_type;
-static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
+static zend_string *cli_get_prompt(char *block, char prompt) /* {{{ */
{
smart_str retval = {0};
char *prompt_spec = CLIR_G(prompt) ? CLIR_G(prompt) : DEFAULT_PROMPT;
@@ -189,7 +189,7 @@ static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
CLIR_G(prompt_str) = &retval;
zend_try {
- zend_eval_stringl(code, prompt_end - prompt_spec - 1, NULL, "php prompt code" TSRMLS_CC);
+ zend_eval_stringl(code, prompt_end - prompt_spec - 1, NULL, "php prompt code");
} zend_end_try();
CLIR_G(prompt_str) = NULL;
efree(code);
@@ -204,7 +204,7 @@ static zend_string *cli_get_prompt(char *block, char prompt TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC) /* {{{ */
+static int cli_is_valid_code(char *code, int len, zend_string **prompt) /* {{{ */
{
int valid_end = 1, last_valid_end;
int brackets_count = 0;
@@ -365,29 +365,29 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
switch (code_type) {
default:
if (brace_count) {
- *prompt = cli_get_prompt("php", '(' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '(');
} else if (brackets_count) {
- *prompt = cli_get_prompt("php", '{' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '{');
} else {
- *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '>');
}
break;
case sstring:
case sstring_esc:
- *prompt = cli_get_prompt("php", '\'' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '\'');
break;
case dstring:
case dstring_esc:
- *prompt = cli_get_prompt("php", '"' TSRMLS_CC);
+ *prompt = cli_get_prompt("php", '"');
break;
case comment_block:
- *prompt = cli_get_prompt("/* ", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("/* ", '>');
break;
case heredoc:
- *prompt = cli_get_prompt("<<<", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt("<<<", '>');
break;
case outside:
- *prompt = cli_get_prompt(" ", '>' TSRMLS_CC);
+ *prompt = cli_get_prompt(" ", '>');
break;
}
@@ -399,7 +399,7 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC
}
/* }}} */
-static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_ht(const char *text, int textlen, int *state, HashTable *ht, void **pData) /* {{{ */
{
zend_string *name;
zend_ulong number;
@@ -425,12 +425,12 @@ static char *cli_completion_generator_ht(const char *text, int textlen, int *sta
return NULL;
} /* }}} */
-static char *cli_completion_generator_var(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_var(const char *text, int textlen, int *state) /* {{{ */
{
char *retval, *tmp;
zend_array *symbol_table = &EG(symbol_table);
- tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, symbol_table ? &symbol_table->ht : NULL, NULL TSRMLS_CC);
+ tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, symbol_table ? &symbol_table->ht : NULL, NULL);
if (retval) {
retval = malloc(strlen(tmp) + 2);
retval[0] = '$';
@@ -440,11 +440,11 @@ static char *cli_completion_generator_var(const char *text, int textlen, int *st
return retval;
} /* }}} */
-static char *cli_completion_generator_ini(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_ini(const char *text, int textlen, int *state) /* {{{ */
{
char *retval, *tmp;
- tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(ini_directives), NULL TSRMLS_CC);
+ tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1, state, EG(ini_directives), NULL);
if (retval) {
retval = malloc(strlen(tmp) + 2);
retval[0] = '#';
@@ -454,10 +454,10 @@ static char *cli_completion_generator_ini(const char *text, int textlen, int *st
return retval;
} /* }}} */
-static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_func(const char *text, int textlen, int *state, HashTable *ht) /* {{{ */
{
zend_function *func;
- char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&func);
if (retval) {
rl_completion_append_character = '(';
retval = strdup(func->common.function_name->val);
@@ -466,10 +466,10 @@ static char *cli_completion_generator_func(const char *text, int textlen, int *s
return retval;
} /* }}} */
-static char *cli_completion_generator_class(const char *text, int textlen, int *state TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_class(const char *text, int textlen, int *state) /* {{{ */
{
zend_class_entry *ce;
- char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&ce TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, EG(class_table), (void**)&ce);
if (retval) {
rl_completion_append_character = '\0';
retval = strdup(ce->name->val);
@@ -478,10 +478,10 @@ static char *cli_completion_generator_class(const char *text, int textlen, int *
return retval;
} /* }}} */
-static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht TSRMLS_DC) /* {{{ */
+static char *cli_completion_generator_define(const char *text, int textlen, int *state, HashTable *ht) /* {{{ */
{
zend_class_entry **pce;
- char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce TSRMLS_CC);
+ char *retval = cli_completion_generator_ht(text, textlen, state, ht, (void**)&pce);
if (retval) {
rl_completion_append_character = '\0';
retval = strdup(retval);
@@ -505,15 +505,14 @@ TODO:
*/
char *retval = NULL;
int textlen = strlen(text);
- TSRMLS_FETCH();
if (!index) {
cli_completion_state = 0;
}
if (text[0] == '$') {
- retval = cli_completion_generator_var(text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_var(text, textlen, &cli_completion_state);
} else if (text[0] == '#') {
- retval = cli_completion_generator_ini(text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_ini(text, textlen, &cli_completion_state);
} else {
char *lc_text, *class_name_end;
int class_name_len;
@@ -525,7 +524,7 @@ TODO:
class_name_len = class_name_end - text;
class_name = zend_string_alloc(class_name_len, 0);
zend_str_tolower_copy(class_name->val, text, class_name_len);
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
zend_string_release(class_name);
return NULL;
}
@@ -538,19 +537,19 @@ TODO:
switch (cli_completion_state) {
case 0:
case 1:
- retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, ce ? &ce->function_table : EG(function_table) TSRMLS_CC);
+ retval = cli_completion_generator_func(lc_text, textlen, &cli_completion_state, ce ? &ce->function_table : EG(function_table));
if (retval) {
break;
}
case 2:
case 3:
- retval = cli_completion_generator_define(text, textlen, &cli_completion_state, ce ? &ce->constants_table : EG(zend_constants) TSRMLS_CC);
+ retval = cli_completion_generator_define(text, textlen, &cli_completion_state, ce ? &ce->constants_table : EG(zend_constants));
if (retval || ce) {
break;
}
case 4:
case 5:
- retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state TSRMLS_CC);
+ retval = cli_completion_generator_class(lc_text, textlen, &cli_completion_state);
break;
default:
break;
@@ -578,12 +577,12 @@ static char **cli_code_completion(const char *text, int start, int end) /* {{{ *
}
/* }}} */
-static int readline_shell_run(TSRMLS_D) /* {{{ */
+static int readline_shell_run(void) /* {{{ */
{
char *line;
size_t size = 4096, pos = 0, len;
char *code = emalloc(size);
- zend_string *prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ zend_string *prompt = cli_get_prompt("php", '>');
char *history_file;
int history_lines_to_write = 0;
@@ -597,7 +596,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
prepend_file.type = ZEND_HANDLE_FILENAME;
prepend_file_p = &prepend_file;
- zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p);
+ zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p);
}
history_file = tilde_expand("~/.php_history");
@@ -626,13 +625,13 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
param++;
cmd = zend_string_init(&line[1], param - &line[1] - 1, 0);
- zend_alter_ini_entry_chars_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_chars_ex(cmd, param, strlen(param), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(cmd);
add_history(line);
zend_string_release(prompt);
/* TODO: This might be wrong! */
- prompt = cli_get_prompt("php", '>' TSRMLS_CC);
+ prompt = cli_get_prompt("php", '>');
continue;
}
}
@@ -654,7 +653,7 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
free(line);
zend_string_release(prompt);
- if (!cli_is_valid_code(code, pos, &prompt TSRMLS_CC)) {
+ if (!cli_is_valid_code(code, pos, &prompt)) {
continue;
}
@@ -668,17 +667,17 @@ static int readline_shell_run(TSRMLS_D) /* {{{ */
}
zend_try {
- zend_eval_stringl(code, pos, NULL, "php shell code" TSRMLS_CC);
+ zend_eval_stringl(code, pos, NULL, "php shell code");
} zend_end_try();
pos = 0;
if (!pager_pipe && php_last_char != '\0' && php_last_char != '\n') {
- php_write("\n", 1 TSRMLS_CC);
+ php_write("\n", 1);
}
if (EG(exception)) {
- zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+ zend_exception_error(EG(exception), E_WARNING);
}
if (pager_pipe) {
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index a70a4fcb2c..ea2374556f 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -149,25 +149,25 @@ PHP_FUNCTION(recode_string)
size_t req_len, str_len;
char *req, *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &req, &req_len, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &req, &req_len, &str, &str_len) == FAILURE) {
return;
}
request = recode_new_request(ReSG(outer));
if (request == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
+ php_error_docref(NULL, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
if (!recode_scan_request(request, req)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req);
+ php_error_docref(NULL, E_WARNING, "Illegal recode request '%s'", req);
goto error_exit;
}
recode_buffer_to_buffer(request, str, str_len, &r, &r_len, &r_alen);
if (!r) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
+ php_error_docref(NULL, E_WARNING, "Recoding failed.");
error_exit:
RETVAL_FALSE;
} else {
@@ -192,7 +192,7 @@ PHP_FUNCTION(recode_file)
php_stream *instream, *outstream;
FILE *in_fp, *out_fp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srr", &req, &req_len, &input, &output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "srr", &req, &req_len, &input, &output) == FAILURE) {
return;
}
@@ -209,17 +209,17 @@ PHP_FUNCTION(recode_file)
request = recode_new_request(ReSG(outer));
if (request == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
+ php_error_docref(NULL, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
if (!recode_scan_request(request, req)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", req);
+ php_error_docref(NULL, E_WARNING, "Illegal recode request '%s'", req);
goto error_exit;
}
if (!recode_file_to_file(request, in_fp, out_fp)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
+ php_error_docref(NULL, E_WARNING, "Recoding failed.");
goto error_exit;
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 3ff63b8d69..6a59a5ce37 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -44,7 +44,7 @@
#define reflection_update_property(object, name, value) do { \
zval member; \
ZVAL_STRINGL(&member, name, sizeof(name)-1); \
- zend_std_write_property(object, &member, value, NULL TSRMLS_CC); \
+ zend_std_write_property(object, &member, value, NULL); \
if (Z_REFCOUNTED_P(value)) Z_DELREF_P(value); \
zval_ptr_dtor(&member); \
} while (0)
@@ -83,14 +83,14 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Method macros */
#define METHOD_NOTSTATIC(ce) \
- if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C)); \
+ if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce)) { \
+ php_error_docref(NULL, E_ERROR, "%s() cannot be called statically", get_active_function_name()); \
return; \
} \
/* Exception throwing macro */
#define _DO_THROW(msg) \
- zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC); \
+ zend_throw_exception(reflection_exception_ptr, msg, 0); \
return; \
#define RETURN_ON_EXCEPTION \
@@ -102,7 +102,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
intern = Z_REFLECTION_P(getThis()); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
} \
#define GET_REFLECTION_OBJECT_PTR(target) \
@@ -111,7 +111,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* Class constants */
#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value);
/* {{{ Smart string functions */
typedef struct _string {
@@ -226,7 +226,7 @@ static inline reflection_object *reflection_object_from_obj(zend_object *obj) /*
static zend_object_handlers reflection_object_handlers;
-static zval *_default_load_entry(zval *object, char *name, size_t name_len TSRMLS_DC) /* {{{ */
+static zval *_default_load_entry(zval *object, char *name, size_t name_len) /* {{{ */
{
zval *value;
@@ -236,11 +236,11 @@ static zval *_default_load_entry(zval *object, char *name, size_t name_len TSRML
return value;
}
-static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */
+static void _default_get_entry(zval *object, char *name, int name_len, zval *return_value) /* {{{ */
{
zval *value;
- if ((value = _default_load_entry(object, name, name_len TSRMLS_CC)) == NULL) {
+ if ((value = _default_load_entry(object, name, name_len)) == NULL) {
RETURN_FALSE;
}
ZVAL_DUP(return_value, value);
@@ -248,7 +248,7 @@ static void _default_get_entry(zval *object, char *name, int name_len, zval *ret
/* }}} */
#ifdef ilia_0
-static void _default_lookup_entry(zval *object, char *name, int name_len, zval **return_value TSRMLS_DC) /* {{{ */
+static void _default_lookup_entry(zval *object, char *name, int name_len, zval **return_value) /* {{{ */
{
zval **value;
@@ -261,7 +261,7 @@ static void _default_lookup_entry(zval *object, char *name, int name_len, zval *
/* }}} */
#endif
-static zend_function *_copy_function(zend_function *fptr TSRMLS_DC) /* {{{ */
+static zend_function *_copy_function(zend_function *fptr) /* {{{ */
{
if (fptr
&& fptr->type == ZEND_INTERNAL_FUNCTION
@@ -279,7 +279,7 @@ static zend_function *_copy_function(zend_function *fptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void _free_function(zend_function *fptr TSRMLS_DC) /* {{{ */
+static void _free_function(zend_function *fptr) /* {{{ */
{
if (fptr
&& fptr->type == ZEND_INTERNAL_FUNCTION
@@ -291,7 +291,7 @@ static void _free_function(zend_function *fptr TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void reflection_free_objects_storage(zend_object *object) /* {{{ */
{
reflection_object *intern = reflection_object_from_obj(object);
parameter_reference *reference;
@@ -301,11 +301,11 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{
switch (intern->ref_type) {
case REF_TYPE_PARAMETER:
reference = (parameter_reference*)intern->ptr;
- _free_function(reference->fptr TSRMLS_CC);
+ _free_function(reference->fptr);
efree(intern->ptr);
break;
case REF_TYPE_FUNCTION:
- _free_function(intern->ptr TSRMLS_CC);
+ _free_function(intern->ptr);
break;
case REF_TYPE_PROPERTY:
efree(intern->ptr);
@@ -321,40 +321,40 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC) /* {{
}
intern->ptr = NULL;
zval_ptr_dtor(&intern->obj);
- zend_object_std_dtor(object TSRMLS_CC);
+ zend_object_std_dtor(object);
}
/* }}} */
-static zend_object *reflection_objects_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ */
{
reflection_object *intern;
intern = ecalloc(1, sizeof(reflection_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->zo.ce = class_type;
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &reflection_object_handlers;
return &intern->zo;
}
/* }}} */
-static zval *reflection_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* {{{ */
+static zval *reflection_instantiate(zend_class_entry *pce, zval *object) /* {{{ */
{
object_init_ex(object, pce);
return object;
}
/* }}} */
-static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC);
-static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC);
-static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC);
-static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC);
-static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC);
-static void _zend_extension_string(string *str, zend_extension *extension, char *indent TSRMLS_DC);
+static void _const_string(string *str, char *name, zval *value, char *indent);
+static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent);
+static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent);
+static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent);
+static void _extension_string(string *str, zend_module_entry *module, char *indent);
+static void _zend_extension_string(string *str, zend_extension *extension, char *indent);
/* {{{ _class_string */
-static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC)
+static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent)
{
int count, count_static_props = 0, count_static_funcs = 0, count_shadow_props = 0;
string sub_indent;
@@ -427,7 +427,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* Constants */
if (&ce->constants_table) {
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1);
string_printf(str, "\n");
count = zend_hash_num_elements(&ce->constants_table);
string_printf(str, "%s - Constants [%d] {\n", indent, count);
@@ -442,7 +442,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((value = zend_hash_get_current_data_ex(&ce->constants_table, &pos)) != NULL) {
zend_hash_get_current_key_ex(&ce->constants_table, &key, &num_index, 0, &pos);
- _const_string(str, key->val, value, indent TSRMLS_CC);
+ _const_string(str, key->val, value, indent);
zend_hash_move_forward_ex(&ce->constants_table, &pos);
}
}
@@ -479,7 +479,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((prop = zend_hash_get_current_data_ptr_ex(&ce->properties_info, &pos)) != NULL) {
if ((prop->flags & ZEND_ACC_STATIC) && !(prop->flags & ZEND_ACC_SHADOW)) {
- _property_string(str, prop, NULL, sub_indent.buf->val TSRMLS_CC);
+ _property_string(str, prop, NULL, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
@@ -521,7 +521,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
{
string_printf(str, "\n");
- _function_string(str, mptr, ce, sub_indent.buf->val TSRMLS_CC);
+ _function_string(str, mptr, ce, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
}
@@ -543,7 +543,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while ((prop = zend_hash_get_current_data_ptr_ex(&ce->properties_info, &pos)) != NULL) {
if (!(prop->flags & (ZEND_ACC_STATIC|ZEND_ACC_SHADOW))) {
- _property_string(str, prop, NULL, sub_indent.buf->val TSRMLS_CC);
+ _property_string(str, prop, NULL, sub_indent.buf->val);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
}
@@ -553,7 +553,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_properties) {
string dyn;
- HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj TSRMLS_CC);
+ HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj);
HashPosition pos;
zval **prop;
@@ -571,7 +571,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
if (prop_name->len && prop_name->val[0]) { /* skip all private and protected properties */
if (!zend_hash_exists(&ce->properties_info, prop_name)) {
count++;
- _property_string(&dyn, NULL, prop_name->val, sub_indent.buf->val TSRMLS_CC);
+ _property_string(&dyn, NULL, prop_name->val, sub_indent.buf->val);
}
}
}
@@ -615,16 +615,16 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* see if this is a closure */
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(mptr->common.function_name->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj) TSRMLS_CC)) != NULL)
+ && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
{
mptr = closure;
} else {
closure = NULL;
}
string_printf(&dyn, "\n");
- _function_string(&dyn, mptr, ce, sub_indent.buf->val TSRMLS_CC);
+ _function_string(&dyn, mptr, ce, sub_indent.buf->val);
count++;
- _free_function(closure TSRMLS_CC);
+ _free_function(closure);
}
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
@@ -647,7 +647,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* }}} */
/* {{{ _const_string */
-static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC)
+static void _const_string(string *str, char *name, zval *value, char *indent)
{
char *type = zend_zval_type_name(value);
zend_string *value_str = zval_get_string(value);
@@ -679,7 +679,7 @@ static zend_op* _get_recv_op(zend_op_array *op_array, uint32_t offset)
/* }}} */
/* {{{ _parameter_string */
-static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, char* indent TSRMLS_DC)
+static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, char* indent)
{
string_printf(str, "Parameter #%d [ ", offset);
if (offset >= required) {
@@ -725,7 +725,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
old_scope = EG(scope);
EG(scope) = fptr->common.scope;
- zval_update_constant_ex(&zv, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(&zv, 1, NULL);
EG(scope) = old_scope;
if (Z_TYPE(zv) == IS_TRUE) {
string_write(str, "true", sizeof("true")-1);
@@ -755,7 +755,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
/* }}} */
/* {{{ _function_parameter_string */
-static void _function_parameter_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)
+static void _function_parameter_string(string *str, zend_function *fptr, char* indent)
{
struct _zend_arg_info *arg_info = fptr->common.arg_info;
uint32_t i, required = fptr->common.required_num_args;
@@ -768,7 +768,7 @@ static void _function_parameter_string(string *str, zend_function *fptr, char* i
string_printf(str, "%s- Parameters [%d] {\n", indent, fptr->common.num_args);
for (i = 0; i < fptr->common.num_args; i++) {
string_printf(str, "%s ", indent);
- _parameter_string(str, fptr, arg_info, i, required, indent TSRMLS_CC);
+ _parameter_string(str, fptr, arg_info, i, required, indent);
string_write(str, "\n", sizeof("\n")-1);
arg_info++;
}
@@ -777,7 +777,7 @@ static void _function_parameter_string(string *str, zend_function *fptr, char* i
/* }}} */
/* {{{ _function_closure_string */
-static void _function_closure_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)
+static void _function_closure_string(string *str, zend_function *fptr, char* indent)
{
uint32_t i, count;
zend_ulong num_index;
@@ -810,7 +810,7 @@ static void _function_closure_string(string *str, zend_function *fptr, char* ind
/* }}} */
/* {{{ _function_string */
-static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent TSRMLS_DC)
+static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char* indent)
{
string param_indent;
zend_function *overwrites;
@@ -906,16 +906,16 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
string_init(&param_indent);
string_printf(&param_indent, "%s ", indent);
if (fptr->common.fn_flags & ZEND_ACC_CLOSURE) {
- _function_closure_string(str, fptr, param_indent.buf->val TSRMLS_CC);
+ _function_closure_string(str, fptr, param_indent.buf->val);
}
- _function_parameter_string(str, fptr, param_indent.buf->val TSRMLS_CC);
+ _function_parameter_string(str, fptr, param_indent.buf->val);
string_free(&param_indent);
string_printf(str, "%s}\n", indent);
}
/* }}} */
/* {{{ _property_string */
-static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC)
+static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent)
{
const char *class_name;
@@ -955,7 +955,7 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
}
/* }}} */
-static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_ini_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -992,7 +992,7 @@ static int _extension_ini_string(zval *el TSRMLS_DC, int num_args, va_list args,
}
/* }}} */
-static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_class_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_class_entry *ce = (zend_class_entry*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -1004,7 +1004,7 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg
/* dump class if it is not an alias */
if (!zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) {
string_printf(str, "\n");
- _class_string(str, ce, NULL, indent TSRMLS_CC);
+ _class_string(str, ce, NULL, indent);
(*num_classes)++;
}
}
@@ -1012,7 +1012,7 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg
}
/* }}} */
-static int _extension_const_string(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _extension_const_string(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_constant *constant = (zend_constant*)Z_PTR_P(el);
string *str = va_arg(args, string *);
@@ -1021,14 +1021,14 @@ static int _extension_const_string(zval *el TSRMLS_DC, int num_args, va_list arg
int *num_classes = va_arg(args, int*);
if (constant->module_number == module->module_number) {
- _const_string(str, constant->name->val, &constant->value, indent TSRMLS_CC);
+ _const_string(str, constant->name->val, &constant->value, indent);
(*num_classes)++;
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC) /* {{{ */
+static void _extension_string(string *str, zend_module_entry *module, char *indent) /* {{{ */
{
string_printf(str, "%sExtension [ ", indent);
if (module->type == MODULE_PERSISTENT) {
@@ -1079,7 +1079,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
{
string str_ini;
string_init(&str_ini);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number);
+ zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number);
if (str_ini.buf->len > 0) {
string_printf(str, "\n - INI {\n");
string_append(str, &str_ini);
@@ -1093,7 +1093,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
int num_constants = 0;
string_init(&str_constants);
- zend_hash_apply_with_arguments(EG(zend_constants) TSRMLS_CC, (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants);
+ zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _extension_const_string, 4, &str_constants, indent, module, &num_constants);
if (num_constants) {
string_printf(str, "\n - Constants [%d] {\n", num_constants);
string_append(str, &str_constants);
@@ -1115,7 +1115,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_printf(str, "\n - Functions {\n");
first = 0;
}
- _function_string(str, fptr, NULL, " " TSRMLS_CC);
+ _function_string(str, fptr, NULL, " ");
}
zend_hash_move_forward_ex(CG(function_table), &iterator);
}
@@ -1132,7 +1132,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_init(&sub_indent);
string_printf(&sub_indent, "%s ", indent);
string_init(&str_classes);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.buf->val, module, &num_classes);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.buf->val, module, &num_classes);
if (num_classes) {
string_printf(str, "\n - Classes [%d] {", num_classes);
string_append(str, &str_classes);
@@ -1146,7 +1146,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
}
/* }}} */
-static void _zend_extension_string(string *str, zend_extension *extension, char *indent TSRMLS_DC) /* {{{ */
+static void _zend_extension_string(string *str, zend_extension *extension, char *indent) /* {{{ */
{
string_printf(str, "%sZend Extension [ %s ", indent, extension->name);
@@ -1182,13 +1182,13 @@ static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask)
/* }}} */
/* {{{ zend_reflection_class_factory */
-PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC)
+PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object)
{
reflection_object *intern;
zval name;
ZVAL_STR_COPY(&name, ce->name);
- reflection_instantiate(reflection_class_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_class_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = ce;
intern->ref_type = REF_TYPE_OTHER;
@@ -1198,7 +1198,7 @@ PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSR
/* }}} */
/* {{{ reflection_extension_factory */
-static void reflection_extension_factory(zval *object, const char *name_str TSRMLS_DC)
+static void reflection_extension_factory(zval *object, const char *name_str)
{
reflection_object *intern;
zval name;
@@ -1214,7 +1214,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM
return;
}
- reflection_instantiate(reflection_extension_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_extension_ptr, object);
intern = Z_REFLECTION_P(object);
ZVAL_STRINGL(&name, module->name, name_len);
intern->ptr = module;
@@ -1225,7 +1225,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM
/* }}} */
/* {{{ reflection_parameter_factory */
-static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, zval *object TSRMLS_DC)
+static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, zval *object)
{
reflection_object *intern;
parameter_reference *reference;
@@ -1240,7 +1240,7 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
} else {
ZVAL_NULL(&name);
}
- reflection_instantiate(reflection_parameter_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_parameter_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (parameter_reference*) emalloc(sizeof(parameter_reference));
reference->arg_info = arg_info;
@@ -1259,14 +1259,14 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
/* }}} */
/* {{{ reflection_function_factory */
-static void reflection_function_factory(zend_function *function, zval *closure_object, zval *object TSRMLS_DC)
+static void reflection_function_factory(zend_function *function, zval *closure_object, zval *object)
{
reflection_object *intern;
zval name;
ZVAL_STR_COPY(&name, function->common.function_name);
- reflection_instantiate(reflection_function_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_function_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = function;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -1280,7 +1280,7 @@ static void reflection_function_factory(zend_function *function, zval *closure_o
/* }}} */
/* {{{ reflection_method_factory */
-static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_object, zval *object TSRMLS_DC)
+static void reflection_method_factory(zend_class_entry *ce, zend_function *method, zval *closure_object, zval *object)
{
reflection_object *intern;
zval name;
@@ -1289,7 +1289,7 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
ZVAL_STR_COPY(&name, (method->common.scope && method->common.scope->trait_aliases)?
zend_resolve_method_name(ce, method) : method->common.function_name);
ZVAL_STR_COPY(&classname, method->common.scope->name);
- reflection_instantiate(reflection_method_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_method_ptr, object);
intern = Z_REFLECTION_P(object);
intern->ptr = method;
intern->ref_type = REF_TYPE_FUNCTION;
@@ -1304,7 +1304,7 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
/* }}} */
/* {{{ reflection_property_factory */
-static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object TSRMLS_DC)
+static void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop, zval *object)
{
reflection_object *intern;
zval name;
@@ -1335,7 +1335,7 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
ZVAL_STRINGL(&name, prop_name, prop_name_len);
ZVAL_STR_COPY(&classname, prop->ce->name);
- reflection_instantiate(reflection_property_ptr, object TSRMLS_CC);
+ reflection_instantiate(reflection_property_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (property_reference*) emalloc(sizeof(property_reference));
reference->ce = ce;
@@ -1362,13 +1362,13 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
zend_fcall_info_cache fcc;
if (ctor_argc == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &argument_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &argument_ptr, &return_output) == FAILURE) {
return;
}
ZVAL_COPY_VALUE(&params[0], argument_ptr);
ZVAL_NULL(&params[1]);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|b", &argument_ptr, &argument2_ptr, &return_output) == FAILURE) {
return;
}
ZVAL_COPY_VALUE(&params[0], argument_ptr);
@@ -1398,7 +1398,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
fcc.called_scope = Z_OBJCE(reflector);
fcc.object = Z_OBJ(reflector);
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
@@ -1424,7 +1424,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
fci.params = params;
fci.no_separation = 1;
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
zval_ptr_dtor(&fci.function_name);
@@ -1456,12 +1456,12 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) {
return NULL;
}
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object");
}
param = intern->ptr;
if (param->fptr->type != ZEND_USER_FUNCTION) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Cannot determine default value for internal functions");
return NULL;
}
@@ -1480,7 +1480,7 @@ static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value");
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Internal error: Failed to retrieve the default value");
return NULL;
}
@@ -1505,7 +1505,7 @@ ZEND_METHOD(reflection, export)
zend_bool return_output = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
return;
}
#else
@@ -1518,7 +1518,7 @@ ZEND_METHOD(reflection, export)
/* Invoke the __toString() method */
ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1);
- result= call_user_function_ex(NULL, object, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC);
+ result= call_user_function_ex(NULL, object, &fname, &retval, 0, NULL, 0, NULL);
zval_dtor(&fname);
if (result == FAILURE) {
@@ -1527,7 +1527,7 @@ ZEND_METHOD(reflection, export)
}
if (Z_TYPE(retval) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name->val);
+ php_error_docref(NULL, E_WARNING, "%s::__toString() did not return anything", Z_OBJCE_P(object)->name->val);
RETURN_FALSE;
}
@@ -1535,7 +1535,7 @@ ZEND_METHOD(reflection, export)
ZVAL_COPY_VALUE(return_value, &retval);
} else {
/* No need for _r variant, return of __toString should always be a string */
- zend_print_zval(&retval, 0 TSRMLS_CC);
+ zend_print_zval(&retval, 0);
zend_printf("\n");
zval_ptr_dtor(&retval);
}
@@ -1548,7 +1548,7 @@ ZEND_METHOD(reflection, getModifierNames)
{
zend_long modifiers;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &modifiers) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &modifiers) == FAILURE) {
return;
}
@@ -1610,10 +1610,10 @@ ZEND_METHOD(reflection_function, __construct)
return;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &closure, zend_ce_closure) == SUCCESS) {
- fptr = (zend_function*)zend_get_closure_method_def(closure TSRMLS_CC);
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &closure, zend_ce_closure) == SUCCESS) {
+ fptr = (zend_function*)zend_get_closure_method_def(closure);
Z_ADDREF_P(closure);
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == SUCCESS) {
+ } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == SUCCESS) {
char *nsname;
lcname = zend_str_tolower_dup(name_str, name_len);
@@ -1627,7 +1627,7 @@ ZEND_METHOD(reflection_function, __construct)
if ((fptr = zend_hash_str_find_ptr(EG(function_table), nsname, name_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Function %s() does not exist", name_str);
return;
}
@@ -1662,7 +1662,7 @@ ZEND_METHOD(reflection_function, __toString)
}
GET_REFLECTION_OBJECT_PTR(fptr);
string_init(&str);
- _function_string(&str, fptr, intern->ce, "" TSRMLS_CC);
+ _function_string(&str, fptr, intern->ce, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -1674,7 +1674,7 @@ ZEND_METHOD(reflection_function, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -1705,7 +1705,7 @@ ZEND_METHOD(reflection_function, getClosureThis)
}
GET_REFLECTION_OBJECT();
if (!Z_ISUNDEF(intern->obj)) {
- closure_this = zend_get_closure_this_ptr(&intern->obj TSRMLS_CC);
+ closure_this = zend_get_closure_this_ptr(&intern->obj);
if (!Z_ISUNDEF_P(closure_this)) {
RETURN_ZVAL(closure_this, 1, 0);
}
@@ -1725,9 +1725,9 @@ ZEND_METHOD(reflection_function, getClosureScopeClass)
}
GET_REFLECTION_OBJECT();
if (!Z_ISUNDEF(intern->obj)) {
- closure_func = zend_get_closure_method_def(&intern->obj TSRMLS_CC);
+ closure_func = zend_get_closure_method_def(&intern->obj);
if (closure_func && closure_func->common.scope) {
- zend_reflection_class_factory(closure_func->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(closure_func->common.scope, return_value);
}
}
}
@@ -1745,7 +1745,7 @@ ZEND_METHOD(reflection_function, getClosure)
}
GET_REFLECTION_OBJECT_PTR(fptr);
- zend_create_closure(return_value, fptr, NULL, NULL TSRMLS_CC);
+ zend_create_closure(return_value, fptr, NULL, NULL);
}
/* }}} */
@@ -1879,7 +1879,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
- zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC);
+ zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope);
zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, zval_add_ref);
}
}
@@ -1900,7 +1900,7 @@ ZEND_METHOD(reflection_function, invoke)
METHOD_NOTSTATIC(reflection_function_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &params, &num_args) == FAILURE) {
return;
}
@@ -1920,10 +1920,10 @@ ZEND_METHOD(reflection_function, invoke)
fcc.called_scope = NULL;
fcc.object = NULL;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of function %s() failed", fptr->common.function_name->val);
return;
}
@@ -1951,7 +1951,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
METHOD_NOTSTATIC(reflection_function_ptr);
GET_REFLECTION_OBJECT_PTR(fptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &param_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &param_array) == FAILURE) {
return;
}
@@ -1980,7 +1980,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
fcc.called_scope = NULL;
fcc.object = NULL;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
for (i = 0; i < argc; i++) {
zval_ptr_dtor(&params[i]);
@@ -1988,7 +1988,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
efree(params);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of function %s() failed", fptr->common.function_name->val);
return;
}
@@ -2059,7 +2059,7 @@ ZEND_METHOD(reflection_function, getParameters)
for (i = 0; i < fptr->common.num_args; i++) {
zval parameter;
- reflection_parameter_factory(_copy_function(fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, arg_info, i, fptr->common.required_num_args, &parameter TSRMLS_CC);
+ reflection_parameter_factory(_copy_function(fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, arg_info, i, fptr->common.required_num_args, &parameter);
add_next_index_zval(return_value, &parameter);
arg_info++;
@@ -2084,7 +2084,7 @@ ZEND_METHOD(reflection_function, getExtension)
internal = (zend_internal_function *)fptr;
if (internal->module) {
- reflection_extension_factory(return_value, internal->module->name TSRMLS_CC);
+ reflection_extension_factory(return_value, internal->module->name);
} else {
RETURN_NULL();
}
@@ -2139,7 +2139,7 @@ ZEND_METHOD(reflection_parameter, __construct)
zend_bool is_closure = 0;
zend_bool is_invoke = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, &parameter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &reference, &parameter) == FAILURE) {
return;
}
@@ -2159,7 +2159,7 @@ ZEND_METHOD(reflection_parameter, __construct)
lcname = zend_str_tolower_dup(Z_STRVAL_P(reference), lcname_len);
if ((fptr = zend_hash_str_find_ptr(EG(function_table), lcname, lcname_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Function %s() does not exist", Z_STRVAL_P(reference));
return;
}
@@ -2185,8 +2185,8 @@ ZEND_METHOD(reflection_parameter, __construct)
ce = Z_OBJCE_P(classref);
} else {
convert_to_string_ex(classref);
- if ((ce = zend_lookup_class(Z_STR_P(classref) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classref))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classref));
return;
}
@@ -2198,14 +2198,14 @@ ZEND_METHOD(reflection_parameter, __construct)
if (ce == zend_ce_closure && Z_TYPE_P(classref) == IS_OBJECT
&& (lcname_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (fptr = zend_get_closure_invoke_method(Z_OBJ_P(classref) TSRMLS_CC)) != NULL)
+ && (fptr = zend_get_closure_invoke_method(Z_OBJ_P(classref))) != NULL)
{
/* nothing to do. don't set is_closure since is the invoke handler,
not the closure itself */
is_invoke = 1;
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, lcname, lcname_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, Z_STRVAL_P(method));
return;
}
@@ -2216,12 +2216,12 @@ ZEND_METHOD(reflection_parameter, __construct)
case IS_OBJECT: {
ce = Z_OBJCE_P(reference);
- if (instanceof_function(ce, zend_ce_closure TSRMLS_CC)) {
- fptr = (zend_function *)zend_get_closure_method_def(reference TSRMLS_CC);
+ if (instanceof_function(ce, zend_ce_closure)) {
+ fptr = (zend_function *)zend_get_closure_method_def(reference);
Z_ADDREF_P(reference);
is_closure = 1;
} else if ((fptr = zend_hash_str_find_ptr(&ce->function_table, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME))) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, ZEND_INVOKE_FUNC_NAME);
return;
}
@@ -2329,7 +2329,7 @@ ZEND_METHOD(reflection_parameter, __toString)
}
GET_REFLECTION_OBJECT_PTR(param);
string_init(&str);
- _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "" TSRMLS_CC);
+ _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -2341,7 +2341,7 @@ ZEND_METHOD(reflection_parameter, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -2358,9 +2358,9 @@ ZEND_METHOD(reflection_parameter, getDeclaringFunction)
GET_REFLECTION_OBJECT_PTR(param);
if (!param->fptr->common.scope) {
- reflection_function_factory(_copy_function(param->fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value TSRMLS_CC);
+ reflection_function_factory(_copy_function(param->fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value);
} else {
- reflection_method_factory(param->fptr->common.scope, _copy_function(param->fptr TSRMLS_CC), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value TSRMLS_CC);
+ reflection_method_factory(param->fptr->common.scope, _copy_function(param->fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, return_value);
}
}
/* }}} */
@@ -2378,7 +2378,7 @@ ZEND_METHOD(reflection_parameter, getDeclaringClass)
GET_REFLECTION_OBJECT_PTR(param);
if (param->fptr->common.scope) {
- zend_reflection_class_factory(param->fptr->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(param->fptr->common.scope, return_value);
}
}
/* }}} */
@@ -2422,19 +2422,19 @@ ZEND_METHOD(reflection_parameter, getClass)
if (0 == zend_binary_strcasecmp(class_name, class_name_len, "self", sizeof("self")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'self' as type hint but function is not a class member!");
return;
}
} else if (0 == zend_binary_strcasecmp(class_name, class_name_len, "parent", sizeof("parent")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'parent' as type hint but function is not a class member!");
return;
}
if (!ce->parent) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter uses 'parent' as type hint although class does not have a parent!");
return;
}
@@ -2442,18 +2442,18 @@ ZEND_METHOD(reflection_parameter, getClass)
} else {
if (param->fptr->type == ZEND_INTERNAL_FUNCTION) {
zend_string *name = zend_string_init(class_name, class_name_len, 0);
- ce = zend_lookup_class(name TSRMLS_CC);
+ ce = zend_lookup_class(name);
zend_string_release(name);
} else {
- ce = zend_lookup_class(param->arg_info->class_name TSRMLS_CC);
+ ce = zend_lookup_class(param->arg_info->class_name);
}
if (!ce) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", class_name);
return;
}
}
- zend_reflection_class_factory(ce, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce, return_value);
}
}
/* }}} */
@@ -2623,7 +2623,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
zend_class_entry *old_scope = EG(scope);
EG(scope) = param->fptr->common.scope;
- zval_update_constant_ex(return_value, 0, NULL TSRMLS_CC);
+ zval_update_constant_ex(return_value, 0, NULL);
EG(scope) = old_scope;
} else {
zval_copy_ctor(return_value);
@@ -2717,12 +2717,12 @@ ZEND_METHOD(reflection_method, __construct)
size_t name_len, tmp_len;
zval ztmp;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "zs", &classname, &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
if ((tmp = strstr(name_str, "::")) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Invalid method name %s", name_str);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Invalid method name %s", name_str);
return;
}
classname = &ztmp;
@@ -2746,8 +2746,8 @@ ZEND_METHOD(reflection_method, __construct)
/* Find the class entry */
switch (Z_TYPE_P(classname)) {
case IS_STRING:
- if ((ce = zend_lookup_class(Z_STR_P(classname) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classname));
if (classname == &ztmp) {
zval_dtor(&ztmp);
@@ -2776,12 +2776,12 @@ ZEND_METHOD(reflection_method, __construct)
if (ce == zend_ce_closure && orig_obj && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lcname, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj) TSRMLS_CC)) != NULL)
+ && (mptr = zend_get_closure_invoke_method(Z_OBJ_P(orig_obj))) != NULL)
{
/* do nothing, mptr already set */
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lcname, name_len)) == NULL) {
efree(lcname);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s() does not exist", ce->name->val, name_str);
return;
}
@@ -2810,7 +2810,7 @@ ZEND_METHOD(reflection_method, __toString)
}
GET_REFLECTION_OBJECT_PTR(mptr);
string_init(&str);
- _function_string(&str, mptr, intern->ce, "" TSRMLS_CC);
+ _function_string(&str, mptr, intern->ce, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -2827,13 +2827,13 @@ ZEND_METHOD(reflection_method, getClosure)
GET_REFLECTION_OBJECT_PTR(mptr);
if (mptr->common.fn_flags & ZEND_ACC_STATIC) {
- zend_create_closure(return_value, mptr, mptr->common.scope, NULL TSRMLS_CC);
+ zend_create_closure(return_value, mptr, mptr->common.scope, NULL);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(Z_OBJCE_P(obj), mptr->common.scope)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
@@ -2844,7 +2844,7 @@ ZEND_METHOD(reflection_method, getClosure)
{
RETURN_ZVAL(obj, 1, 0);
} else {
- zend_create_closure(return_value, mptr, mptr->common.scope, obj TSRMLS_CC);
+ zend_create_closure(return_value, mptr, mptr->common.scope, obj);
}
}
}
@@ -2873,11 +2873,11 @@ ZEND_METHOD(reflection_method, invoke)
&& intern->ignore_visibility == 0)
{
if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke abstract method %s::%s()",
mptr->common.scope->name->val, mptr->common.function_name->val);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke %s method %s::%s() from scope %s",
mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
mptr->common.scope->name->val, mptr->common.function_name->val,
@@ -2886,7 +2886,7 @@ ZEND_METHOD(reflection_method, invoke)
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &params, &num_args) == FAILURE) {
return;
}
@@ -2907,7 +2907,7 @@ ZEND_METHOD(reflection_method, invoke)
obj_ce = Z_OBJCE(params[0]);
- if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(obj_ce, mptr->common.scope)) {
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
@@ -2931,10 +2931,10 @@ ZEND_METHOD(reflection_method, invoke)
fcc.called_scope = intern->ce;
fcc.object = object;
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of method %s::%s() failed", mptr->common.scope->name->val, mptr->common.function_name->val);
return;
}
@@ -2964,7 +2964,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
GET_REFLECTION_OBJECT_PTR(mptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a", &object, &param_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a", &object, &param_array) == FAILURE) {
return;
}
@@ -2973,11 +2973,11 @@ ZEND_METHOD(reflection_method, invokeArgs)
&& intern->ignore_visibility == 0)
{
if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke abstract method %s::%s()",
mptr->common.scope->name->val, mptr->common.function_name->val);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke %s method %s::%s() from scope %s",
mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
mptr->common.scope->name->val, mptr->common.function_name->val,
@@ -3007,7 +3007,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
} else {
if (!object) {
efree(params);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Trying to invoke non static method %s::%s() without an object",
mptr->common.scope->name->val, mptr->common.function_name->val);
return;
@@ -3015,7 +3015,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
obj_ce = Z_OBJCE_P(object);
- if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
+ if (!instanceof_function(obj_ce, mptr->common.scope)) {
efree(params);
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
@@ -3043,10 +3043,10 @@ ZEND_METHOD(reflection_method, invokeArgs)
*/
if (mptr->type == ZEND_INTERNAL_FUNCTION &&
(mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
- fcc.function_handler = _copy_function(mptr TSRMLS_CC);
+ fcc.function_handler = _copy_function(mptr);
}
- result = zend_call_function(&fci, &fcc TSRMLS_CC);
+ result = zend_call_function(&fci, &fcc);
for (i = 0; i < argc; i++) {
zval_ptr_dtor(&params[i]);
@@ -3054,7 +3054,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
efree(params);
if (result == FAILURE) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Invocation of method %s::%s() failed", mptr->common.scope->name->val, mptr->common.function_name->val);
return;
}
@@ -3147,7 +3147,7 @@ ZEND_METHOD(reflection_function, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3170,7 +3170,7 @@ ZEND_METHOD(reflection_function, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3193,7 +3193,7 @@ ZEND_METHOD(reflection_function, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3269,7 +3269,7 @@ ZEND_METHOD(reflection_method, getDeclaringClass)
return;
}
- zend_reflection_class_factory(mptr->common.scope, return_value TSRMLS_CC);
+ zend_reflection_class_factory(mptr->common.scope, return_value);
}
/* }}} */
@@ -3288,12 +3288,12 @@ ZEND_METHOD(reflection_method, getPrototype)
}
if (!mptr->common.prototype) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s::%s does not have a prototype", intern->ce->name->val, mptr->common.function_name->val);
return;
}
- reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(mptr->common.prototype->common.scope, mptr->common.prototype, NULL, return_value);
}
/* }}} */
@@ -3304,7 +3304,7 @@ ZEND_METHOD(reflection_method, setAccessible)
reflection_object *intern;
zend_bool visible;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &visible) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
return;
}
@@ -3336,11 +3336,11 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
zend_class_entry *ce;
if (is_object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &argument) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &argument) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &argument) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &argument) == FAILURE) {
return;
}
}
@@ -3361,9 +3361,9 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
}
} else {
convert_to_string_ex(argument);
- if ((ce = zend_lookup_class(Z_STR_P(argument) TSRMLS_CC)) == NULL) {
+ if ((ce = zend_lookup_class(Z_STR_P(argument))) == NULL) {
if (!EG(exception)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument));
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Class %s does not exist", Z_STRVAL_P(argument));
}
return;
}
@@ -3386,7 +3386,7 @@ ZEND_METHOD(reflection_class, __construct)
/* }}} */
/* {{{ add_class_vars */
-static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value TSRMLS_DC)
+static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value)
{
zend_property_info *prop_info;
zval *prop, prop_copy;
@@ -3418,7 +3418,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
/* this is necessary to make it able to work with default array
* properties, returned to user */
if (Z_CONSTANT(prop_copy)) {
- zval_update_constant(&prop_copy, 1 TSRMLS_CC);
+ zval_update_constant(&prop_copy, 1);
}
zend_hash_update(Z_ARRVAL_P(return_value), key, &prop_copy);
@@ -3439,10 +3439,10 @@ ZEND_METHOD(reflection_class, getStaticProperties)
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
array_init(return_value);
- add_class_vars(ce, 1, return_value TSRMLS_CC);
+ add_class_vars(ce, 1, return_value);
}
/* }}} */
@@ -3455,19 +3455,19 @@ ZEND_METHOD(reflection_class, getStaticPropertyValue)
zend_string *name;
zval *prop, *def_value = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|z", &name, &def_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &name, &def_value) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
- prop = zend_std_get_static_property(ce, name, 1, NULL TSRMLS_CC);
+ zend_update_class_constants(ce);
+ prop = zend_std_get_static_property(ce, name, 1, NULL);
if (!prop) {
if (def_value) {
RETURN_ZVAL(def_value, 1, 0);
} else {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not have a property named %s", ce->name->val, name->val);
}
return;
@@ -3486,16 +3486,16 @@ ZEND_METHOD(reflection_class, setStaticPropertyValue)
zend_string *name;
zval *variable_ptr, *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &name, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &name, &value) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_update_class_constants(ce TSRMLS_CC);
- variable_ptr = zend_std_get_static_property(ce, name, 1, NULL TSRMLS_CC);
+ zend_update_class_constants(ce);
+ variable_ptr = zend_std_get_static_property(ce, name, 1, NULL);
if (!variable_ptr) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not have a property named %s", ce->name->val, name->val);
return;
}
@@ -3516,9 +3516,9 @@ ZEND_METHOD(reflection_class, getDefaultProperties)
}
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_update_class_constants(ce TSRMLS_CC);
- add_class_vars(ce, 1, return_value TSRMLS_CC);
- add_class_vars(ce, 0, return_value TSRMLS_CC);
+ zend_update_class_constants(ce);
+ add_class_vars(ce, 1, return_value);
+ add_class_vars(ce, 0, return_value);
}
/* }}} */
@@ -3535,7 +3535,7 @@ ZEND_METHOD(reflection_class, __toString)
}
GET_REFLECTION_OBJECT_PTR(ce);
string_init(&str);
- _class_string(&str, ce, &intern->obj, "" TSRMLS_CC);
+ _class_string(&str, ce, &intern->obj, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -3547,7 +3547,7 @@ ZEND_METHOD(reflection_class, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -3666,7 +3666,7 @@ ZEND_METHOD(reflection_class, getConstructor)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->constructor) {
- reflection_method_factory(ce, ce->constructor, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, ce->constructor, NULL, return_value);
} else {
RETURN_NULL();
}
@@ -3683,7 +3683,7 @@ ZEND_METHOD(reflection_class, hasMethod)
size_t name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -3713,7 +3713,7 @@ ZEND_METHOD(reflection_class, getMethod)
size_t name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -3721,26 +3721,26 @@ ZEND_METHOD(reflection_class, getMethod)
lc_name = zend_str_tolower_dup(name, name_len);
if (ce == zend_ce_closure && !Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj) TSRMLS_CC)) != NULL)
+ && (mptr = zend_get_closure_invoke_method(Z_OBJ(intern->obj))) != NULL)
{
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself */
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
efree(lc_name);
} else if (ce == zend_ce_closure && Z_ISUNDEF(intern->obj) && (name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp) TSRMLS_CC)) != NULL) {
+ && object_init_ex(&obj_tmp, ce) == SUCCESS && (mptr = zend_get_closure_invoke_method(Z_OBJ(obj_tmp))) != NULL) {
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself */
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
zval_dtor(&obj_tmp);
efree(lc_name);
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) {
- reflection_method_factory(ce, mptr, NULL, return_value TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, return_value);
efree(lc_name);
} else {
efree(lc_name);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Method %s does not exist", name);
return;
}
@@ -3748,7 +3748,7 @@ ZEND_METHOD(reflection_class, getMethod)
/* }}} */
/* {{{ _addmethod */
-static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj TSRMLS_DC)
+static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj)
{
zval method;
size_t len = mptr->common.function_name->len;
@@ -3756,21 +3756,21 @@ static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval,
if (mptr->common.fn_flags & filter) {
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(mptr->common.function_name->val, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
- && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj) TSRMLS_CC)) != NULL)
+ && (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
{
mptr = closure;
}
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself, even if we have a
closure */
- reflection_method_factory(ce, mptr, NULL, &method TSRMLS_CC);
+ reflection_method_factory(ce, mptr, NULL, &method);
add_next_index_zval(retval, &method);
}
}
/* }}} */
/* {{{ _addmethod */
-static int _addmethod_va(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addmethod_va(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_function *mptr = (zend_function*)Z_PTR_P(el);
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -3778,7 +3778,7 @@ static int _addmethod_va(zval *el TSRMLS_DC, int num_args, va_list args, zend_ha
long filter = va_arg(args, long);
zval *obj = va_arg(args, zval *);
- _addmethod(mptr, ce, retval, filter, obj TSRMLS_CC);
+ _addmethod(mptr, ce, retval, filter, obj);
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -3794,7 +3794,7 @@ ZEND_METHOD(reflection_class, getMethods)
METHOD_NOTSTATIC(reflection_class_ptr);
if (argc) {
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) {
return;
}
} else {
@@ -3805,12 +3805,12 @@ ZEND_METHOD(reflection_class, getMethods)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_arguments(&ce->function_table TSRMLS_CC, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter, intern->obj);
- if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure TSRMLS_CC)) {
- zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj) TSRMLS_CC);
+ zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter, intern->obj);
+ if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure)) {
+ zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj));
if (closure) {
- _addmethod(closure, ce, return_value, filter, &intern->obj TSRMLS_CC);
- _free_function(closure TSRMLS_CC);
+ _addmethod(closure, ce, return_value, filter, &intern->obj);
+ _free_function(closure);
}
}
}
@@ -3827,7 +3827,7 @@ ZEND_METHOD(reflection_class, hasProperty)
zval property;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
@@ -3840,7 +3840,7 @@ ZEND_METHOD(reflection_class, hasProperty)
} else {
if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) {
ZVAL_STR_COPY(&property, name);
- if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL TSRMLS_CC)) {
+ if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL)) {
zval_ptr_dtor(&property);
RETURN_TRUE;
}
@@ -3863,26 +3863,26 @@ ZEND_METHOD(reflection_class, getProperty)
size_t classname_len, str_name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
if ((property_info = zend_hash_find_ptr(&ce->properties_info, name)) != NULL) {
if ((property_info->flags & ZEND_ACC_SHADOW) == 0) {
- reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
+ reflection_property_factory(ce, property_info, return_value);
return;
}
} else if (Z_TYPE(intern->obj) != IS_UNDEF) {
/* Check for dynamic properties */
- if (zend_hash_exists(Z_OBJ_HT(intern->obj)->get_properties(&intern->obj TSRMLS_CC), name)) {
+ if (zend_hash_exists(Z_OBJ_HT(intern->obj)->get_properties(&intern->obj), name)) {
zend_property_info property_info_tmp;
property_info_tmp.flags = ZEND_ACC_IMPLICIT_PUBLIC;
property_info_tmp.name = zend_string_copy(name);
property_info_tmp.doc_comment = NULL;
property_info_tmp.ce = ce;
- reflection_property_factory(ce, &property_info_tmp, return_value TSRMLS_CC);
+ reflection_property_factory(ce, &property_info_tmp, return_value);
intern = Z_REFLECTION_P(return_value);
intern->ref_type = REF_TYPE_DYNAMIC_PROPERTY;
return;
@@ -3898,34 +3898,34 @@ ZEND_METHOD(reflection_class, getProperty)
str_name_len = name->len - (classname_len + 2);
str_name = tmp + 2;
- ce2 = zend_lookup_class(classname TSRMLS_CC);
+ ce2 = zend_lookup_class(classname);
if (!ce2) {
if (!EG(exception)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", classname->val);
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Class %s does not exist", classname->val);
}
zend_string_release(classname);
return;
}
zend_string_release(classname);
- if (!instanceof_function(ce, ce2 TSRMLS_CC)) {
- zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Fully qualified property name %s::%s does not specify a base class of %s", ce2->name->val, str_name, ce->name->val);
+ if (!instanceof_function(ce, ce2)) {
+ zend_throw_exception_ex(reflection_exception_ptr, -1, "Fully qualified property name %s::%s does not specify a base class of %s", ce2->name->val, str_name, ce->name->val);
return;
}
ce = ce2;
if ((property_info = zend_hash_str_find_ptr(&ce->properties_info, str_name, str_name_len)) != NULL && (property_info->flags & ZEND_ACC_SHADOW) == 0) {
- reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
+ reflection_property_factory(ce, property_info, return_value);
return;
}
}
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Property %s does not exist", str_name);
}
/* }}} */
/* {{{ _addproperty */
-static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addproperty(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zval property;
zend_property_info *pptr = (zend_property_info*)Z_PTR_P(el);
@@ -3938,7 +3938,7 @@ static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_has
}
if (pptr->flags & filter) {
- reflection_property_factory(ce, pptr, &property TSRMLS_CC);
+ reflection_property_factory(ce, pptr, &property);
add_next_index_zval(retval, &property);
}
return 0;
@@ -3946,7 +3946,7 @@ static int _addproperty(zval *el TSRMLS_DC, int num_args, va_list args, zend_has
/* }}} */
/* {{{ _adddynproperty */
-static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _adddynproperty(zval *ptr, int num_args, va_list args, zend_hash_key *hash_key)
{
zval property;
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
@@ -3963,14 +3963,14 @@ static int _adddynproperty(zval *ptr TSRMLS_DC, int num_args, va_list args, zend
return 0; /* non public cannot be dynamic */
}
- if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == NULL) {
+ if (zend_get_property_info(ce, hash_key->key, 1) == NULL) {
zend_property_info property_info;
property_info.flags = ZEND_ACC_IMPLICIT_PUBLIC;
property_info.name = hash_key->key;
property_info.ce = ce;
property_info.offset = -1;
- reflection_property_factory(ce, &property_info, &property TSRMLS_CC);
+ reflection_property_factory(ce, &property_info, &property);
add_next_index_zval(retval, &property);
}
return 0;
@@ -3988,7 +3988,7 @@ ZEND_METHOD(reflection_class, getProperties)
METHOD_NOTSTATIC(reflection_class_ptr);
if (argc) {
- if (zend_parse_parameters(argc TSRMLS_CC, "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) {
return;
}
} else {
@@ -3999,11 +3999,11 @@ ZEND_METHOD(reflection_class, getProperties)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_arguments(&ce->properties_info TSRMLS_CC, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter);
+ zend_hash_apply_with_arguments(&ce->properties_info, (apply_func_args_t) _addproperty, 3, &ce, return_value, filter);
if (Z_TYPE(intern->obj) != IS_UNDEF && (filter & ZEND_ACC_PUBLIC) != 0 && Z_OBJ_HT(intern->obj)->get_properties) {
- HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(&intern->obj TSRMLS_CC);
- zend_hash_apply_with_arguments(properties TSRMLS_CC, (apply_func_args_t) _adddynproperty, 2, &ce, return_value);
+ HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(&intern->obj);
+ zend_hash_apply_with_arguments(properties, (apply_func_args_t) _adddynproperty, 2, &ce, return_value);
}
}
/* }}} */
@@ -4017,7 +4017,7 @@ ZEND_METHOD(reflection_class, hasConstant)
zend_string *name;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
@@ -4042,7 +4042,7 @@ ZEND_METHOD(reflection_class, getConstants)
}
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce);
zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, zval_add_ref_unref);
}
/* }}} */
@@ -4057,12 +4057,12 @@ ZEND_METHOD(reflection_class, getConstant)
zend_string *name;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce TSRMLS_CC);
+ zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t)zval_update_constant_inline_change, ce);
if ((value = zend_hash_find(&ce->constants_table, name)) == NULL) {
RETURN_FALSE;
}
@@ -4199,11 +4199,11 @@ ZEND_METHOD(reflection_class, isInstance)
zval *object;
METHOD_NOTSTATIC(reflection_class_ptr);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object) == FAILURE) {
return;
}
GET_REFLECTION_OBJECT_PTR(ce);
- RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC));
+ RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce));
}
/* }}} */
@@ -4223,7 +4223,7 @@ ZEND_METHOD(reflection_class, newInstance)
old_scope = EG(scope);
EG(scope) = ce;
- constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value) TSRMLS_CC);
+ constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value));
EG(scope) = old_scope;
/* Run the constructor if there is one */
@@ -4234,12 +4234,12 @@ ZEND_METHOD(reflection_class, newInstance)
zend_fcall_info_cache fcc;
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &params, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &params, &num_args) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -4264,18 +4264,18 @@ ZEND_METHOD(reflection_class, newInstance)
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- ret = zend_call_function(&fci, &fcc TSRMLS_CC);
+ ret = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
for (i = 0; i < num_args; i++) {
zval_ptr_dtor(&params[i]);
}
if (ret == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
} else if (ZEND_NUM_ARGS()) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
}
}
/* }}} */
@@ -4291,7 +4291,7 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
}
object_init_ex(return_value, ce);
@@ -4313,7 +4313,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|h", &args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|h", &args) == FAILURE) {
return;
}
@@ -4325,7 +4325,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
old_scope = EG(scope);
EG(scope) = ce;
- constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value) TSRMLS_CC);
+ constructor = Z_OBJ_HT_P(return_value)->get_constructor(Z_OBJ_P(return_value));
EG(scope) = old_scope;
/* Run the constructor if there is one */
@@ -4335,7 +4335,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
zend_fcall_info_cache fcc;
if (!(constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Access to non-public constructor of class %s", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Access to non-public constructor of class %s", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
@@ -4365,7 +4365,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);
- ret = zend_call_function(&fci, &fcc TSRMLS_CC);
+ ret = zend_call_function(&fci, &fcc);
zval_ptr_dtor(&retval);
if (params) {
for (i = 0; i < argc; i++) {
@@ -4375,12 +4375,12 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
}
if (ret == FAILURE) {
zval_ptr_dtor(&retval);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
+ php_error_docref(NULL, E_WARNING, "Invocation of %s's constructor failed", ce->name->val);
zval_dtor(return_value);
RETURN_NULL();
}
} else if (argc) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
}
}
/* }}} */
@@ -4405,7 +4405,7 @@ ZEND_METHOD(reflection_class, getInterfaces)
for (i=0; i < ce->num_interfaces; i++) {
zval interface;
- zend_reflection_class_factory(ce->interfaces[i], &interface TSRMLS_CC);
+ zend_reflection_class_factory(ce->interfaces[i], &interface);
zend_hash_update(Z_ARRVAL_P(return_value), ce->interfaces[i]->name, &interface);
}
}
@@ -4451,7 +4451,7 @@ ZEND_METHOD(reflection_class, getTraits)
for (i=0; i < ce->num_traits; i++) {
zval trait;
- zend_reflection_class_factory(ce->traits[i], &trait TSRMLS_CC);
+ zend_reflection_class_factory(ce->traits[i], &trait);
zend_hash_update(Z_ARRVAL_P(return_value), ce->traits[i]->name, &trait);
}
}
@@ -4523,7 +4523,7 @@ ZEND_METHOD(reflection_class, getParentClass)
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->parent) {
- zend_reflection_class_factory(ce->parent, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce->parent, return_value);
} else {
RETURN_FALSE;
}
@@ -4541,23 +4541,23 @@ ZEND_METHOD(reflection_class, isSubclassOf)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &class_name) == FAILURE) {
return;
}
switch (Z_TYPE_P(class_name)) {
case IS_STRING:
- if ((class_ce = zend_lookup_class(Z_STR_P(class_name) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((class_ce = zend_lookup_class(Z_STR_P(class_name))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(class_name));
return;
}
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) {
argument = Z_REFLECTION_P(class_name);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
class_ce = argument->ptr;
@@ -4565,12 +4565,12 @@ ZEND_METHOD(reflection_class, isSubclassOf)
}
/* no break */
default:
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter one must either be a string or a ReflectionClass object");
return;
}
- RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce TSRMLS_CC)));
+ RETURN_BOOL((ce != class_ce && instanceof_function(ce, class_ce)));
}
/* }}} */
@@ -4585,23 +4585,23 @@ ZEND_METHOD(reflection_class, implementsInterface)
METHOD_NOTSTATIC(reflection_class_ptr);
GET_REFLECTION_OBJECT_PTR(ce);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &interface) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &interface) == FAILURE) {
return;
}
switch (Z_TYPE_P(interface)) {
case IS_STRING:
- if ((interface_ce = zend_lookup_class(Z_STR_P(interface) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((interface_ce = zend_lookup_class(Z_STR_P(interface))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Interface %s does not exist", Z_STRVAL_P(interface));
return;
}
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) {
argument = Z_REFLECTION_P(interface);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
+ php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
/* Bails out */
}
interface_ce = argument->ptr;
@@ -4609,17 +4609,17 @@ ZEND_METHOD(reflection_class, implementsInterface)
}
/* no break */
default:
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Parameter one must either be a string or a ReflectionClass object");
return;
}
if (!(interface_ce->ce_flags & ZEND_ACC_INTERFACE)) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Interface %s is a Class", interface_ce->name->val);
return;
}
- RETURN_BOOL(instanceof_function(ce, interface_ce TSRMLS_CC));
+ RETURN_BOOL(instanceof_function(ce, interface_ce));
}
/* }}} */
@@ -4656,7 +4656,7 @@ ZEND_METHOD(reflection_class, getExtension)
GET_REFLECTION_OBJECT_PTR(ce);
if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module) {
- reflection_extension_factory(return_value, ce->info.internal.module->name TSRMLS_CC);
+ reflection_extension_factory(return_value, ce->info.internal.module->name);
}
}
/* }}} */
@@ -4693,7 +4693,7 @@ ZEND_METHOD(reflection_class, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4716,7 +4716,7 @@ ZEND_METHOD(reflection_class, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4739,7 +4739,7 @@ ZEND_METHOD(reflection_class, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4790,7 +4790,7 @@ ZEND_METHOD(reflection_property, __construct)
zend_property_info *property_info = NULL;
property_reference *reference;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &classname, &name_str, &name_len) == FAILURE) {
return;
}
@@ -4803,8 +4803,8 @@ ZEND_METHOD(reflection_property, __construct)
/* Find the class entry */
switch (Z_TYPE_P(classname)) {
case IS_STRING:
- if ((ce = zend_lookup_class(Z_STR_P(classname) TSRMLS_CC)) == NULL) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ if ((ce = zend_lookup_class(Z_STR_P(classname))) == NULL) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Class %s does not exist", Z_STRVAL_P(classname));
return;
}
@@ -4822,12 +4822,12 @@ ZEND_METHOD(reflection_property, __construct)
if ((property_info = zend_hash_str_find_ptr(&ce->properties_info, name_str, name_len)) == NULL || (property_info->flags & ZEND_ACC_SHADOW)) {
/* Check for dynamic properties */
if (property_info == NULL && Z_TYPE_P(classname) == IS_OBJECT && Z_OBJ_HT_P(classname)->get_properties) {
- if (zend_hash_str_exists(Z_OBJ_HT_P(classname)->get_properties(classname TSRMLS_CC), name_str, name_len)) {
+ if (zend_hash_str_exists(Z_OBJ_HT_P(classname)->get_properties(classname), name_str, name_len)) {
dynam_prop = 1;
}
}
if (dynam_prop == 0) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Property %s::$%s does not exist", ce->name->val, name_str);
+ zend_throw_exception_ex(reflection_exception_ptr, 0, "Property %s::$%s does not exist", ce->name->val, name_str);
return;
}
}
@@ -4887,7 +4887,7 @@ ZEND_METHOD(reflection_property, __toString)
}
GET_REFLECTION_OBJECT_PTR(ref);
string_init(&str);
- _property_string(&str, &ref->prop, NULL, "" TSRMLS_CC);
+ _property_string(&str, &ref->prop, NULL, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -4899,7 +4899,7 @@ ZEND_METHOD(reflection_property, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -4985,16 +4985,16 @@ ZEND_METHOD(reflection_property, getValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & (ZEND_ACC_PUBLIC | ZEND_ACC_IMPLICIT_PUBLIC)) && intern->ignore_visibility == 0) {
- name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ name = _default_load_entry(getThis(), "name", sizeof("name")-1);
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::%s", intern->ce->name->val, Z_STRVAL_P(name));
return;
}
if ((ref->prop.flags & ZEND_ACC_STATIC)) {
- zend_update_class_constants(intern->ce TSRMLS_CC);
+ zend_update_class_constants(intern->ce);
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
+ php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
/* Bails out */
}
ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]);
@@ -5002,12 +5002,12 @@ ZEND_METHOD(reflection_property, getValue)
const char *class_name, *prop_name;
size_t prop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object) == FAILURE) {
return;
}
zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
- member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1 TSRMLS_CC);
+ member_p = zend_read_property(ref->ce, object, prop_name, prop_name_len, 1);
ZVAL_DUP(return_value, member_p);
}
}
@@ -5028,22 +5028,22 @@ ZEND_METHOD(reflection_property, setValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & ZEND_ACC_PUBLIC) && intern->ignore_visibility == 0) {
- name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ name = _default_load_entry(getThis(), "name", sizeof("name")-1);
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::%s", intern->ce->name->val, Z_STRVAL_P(name));
return;
}
if ((ref->prop.flags & ZEND_ACC_STATIC)) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &tmp, &value) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &tmp, &value) == FAILURE) {
return;
}
}
- zend_update_class_constants(intern->ce TSRMLS_CC);
+ zend_update_class_constants(intern->ce);
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
+ php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", intern->ce->name->val, ref->prop.name->val);
/* Bails out */
}
variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
@@ -5078,12 +5078,12 @@ ZEND_METHOD(reflection_property, setValue)
const char *class_name, *prop_name;
size_t prop_name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "oz", &object, &value) == FAILURE) {
return;
}
zend_unmangle_property_name_ex(ref->prop.name, &class_name, &prop_name, &prop_name_len);
- zend_update_property(ref->ce, object, prop_name, prop_name_len, value TSRMLS_CC);
+ zend_update_property(ref->ce, object, prop_name, prop_name_len, value);
}
}
/* }}} */
@@ -5122,7 +5122,7 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
tmp_ce = tmp_ce->parent;
}
- zend_reflection_class_factory(ce, return_value TSRMLS_CC);
+ zend_reflection_class_factory(ce, return_value);
}
/* }}} */
@@ -5151,7 +5151,7 @@ ZEND_METHOD(reflection_property, setAccessible)
reflection_object *intern;
zend_bool visible;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &visible) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &visible) == FAILURE) {
return;
}
@@ -5186,7 +5186,7 @@ ZEND_METHOD(reflection_extension, __construct)
size_t name_len;
ALLOCA_FLAG(use_heap)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
@@ -5199,7 +5199,7 @@ ZEND_METHOD(reflection_extension, __construct)
zend_str_tolower_copy(lcname, name_str, name_len);
if ((module = zend_hash_str_find_ptr(&module_registry, lcname, name_len)) == NULL) {
free_alloca(lcname, use_heap);
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Extension %s does not exist", name_str);
return;
}
@@ -5225,7 +5225,7 @@ ZEND_METHOD(reflection_extension, __toString)
}
GET_REFLECTION_OBJECT_PTR(module);
string_init(&str);
- _extension_string(&str, module, "" TSRMLS_CC);
+ _extension_string(&str, module, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -5237,7 +5237,7 @@ ZEND_METHOD(reflection_extension, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- _default_get_entry(getThis(), "name", sizeof("name")-1, return_value TSRMLS_CC);
+ _default_get_entry(getThis(), "name", sizeof("name")-1, return_value);
}
/* }}} */
@@ -5282,7 +5282,7 @@ ZEND_METHOD(reflection_extension, getFunctions)
while ((fptr = zend_hash_get_current_data_ptr_ex(CG(function_table), &iterator)) != NULL) {
if (fptr->common.type==ZEND_INTERNAL_FUNCTION
&& fptr->internal_function.module == module) {
- reflection_function_factory(fptr, NULL, &function TSRMLS_CC);
+ reflection_function_factory(fptr, NULL, &function);
zend_hash_update(Z_ARRVAL_P(return_value), fptr->common.function_name, &function);
}
zend_hash_move_forward_ex(CG(function_table), &iterator);
@@ -5290,7 +5290,7 @@ ZEND_METHOD(reflection_extension, getFunctions)
}
/* }}} */
-static int _addconstant(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _addconstant(zval *el, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zval const_val;
zend_constant *constant = (zend_constant*)Z_PTR_P(el);
@@ -5318,12 +5318,12 @@ ZEND_METHOD(reflection_extension, getConstants)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(zend_constants) TSRMLS_CC, (apply_func_args_t) _addconstant, 2, return_value, module->module_number);
+ zend_hash_apply_with_arguments(EG(zend_constants), (apply_func_args_t) _addconstant, 2, return_value, module->module_number);
}
/* }}} */
/* {{{ _addinientry */
-static int _addinientry(zval *el TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int _addinientry(zval *el, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_ini_entry *ini_entry = (zend_ini_entry*)Z_PTR_P(el);
zval *retval = va_arg(args, zval*);
@@ -5356,12 +5356,12 @@ ZEND_METHOD(reflection_extension, getINIEntries)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) _addinientry, 2, return_value, module->module_number);
+ zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _addinientry, 2, return_value, module->module_number);
}
/* }}} */
/* {{{ add_extension_class */
-static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int add_extension_class(zval *zv, int num_args, va_list args, zend_hash_key *hash_key)
{
zend_class_entry *ce = Z_PTR_P(zv);
zval *class_array = va_arg(args, zval*), zclass;
@@ -5379,7 +5379,7 @@ static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, z
name = ce->name;
}
if (add_reflection_class) {
- zend_reflection_class_factory(ce, &zclass TSRMLS_CC);
+ zend_reflection_class_factory(ce, &zclass);
zend_hash_update(Z_ARRVAL_P(class_array), name, &zclass);
} else {
add_next_index_str(class_array, zend_string_copy(name));
@@ -5402,7 +5402,7 @@ ZEND_METHOD(reflection_extension, getClasses)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) add_extension_class, 3, return_value, module, 1);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 1);
}
/* }}} */
@@ -5419,7 +5419,7 @@ ZEND_METHOD(reflection_extension, getClassNames)
GET_REFLECTION_OBJECT_PTR(module);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) add_extension_class, 3, return_value, module, 0);
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) add_extension_class, 3, return_value, module, 0);
}
/* }}} */
@@ -5502,7 +5502,7 @@ ZEND_METHOD(reflection_extension, info)
}
GET_REFLECTION_OBJECT_PTR(module);
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
/* }}} */
@@ -5557,7 +5557,7 @@ ZEND_METHOD(reflection_zend_extension, __construct)
char *name_str;
size_t name_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name_str, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) {
return;
}
@@ -5569,7 +5569,7 @@ ZEND_METHOD(reflection_zend_extension, __construct)
extension = zend_get_extension(name_str);
if (!extension) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Zend Extension %s does not exist", name_str);
return;
}
@@ -5594,7 +5594,7 @@ ZEND_METHOD(reflection_zend_extension, __toString)
}
GET_REFLECTION_OBJECT_PTR(extension);
string_init(&str);
- _zend_extension_string(&str, extension, "" TSRMLS_CC);
+ _zend_extension_string(&str, extension, "");
RETURN_STR(str.buf);
}
/* }}} */
@@ -6110,19 +6110,19 @@ const zend_function_entry reflection_ext_functions[] = { /* {{{ */
static zend_object_handlers *zend_std_obj_handlers;
/* {{{ _reflection_write_property */
-static void _reflection_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void _reflection_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
if ((Z_TYPE_P(member) == IS_STRING)
&& zend_hash_exists(&Z_OBJCE_P(object)->properties_info, Z_STR_P(member))
&& ((Z_STRLEN_P(member) == sizeof("name") - 1 && !memcmp(Z_STRVAL_P(member), "name", sizeof("name")))
|| (Z_STRLEN_P(member) == sizeof("class") - 1 && !memcmp(Z_STRVAL_P(member), "class", sizeof("class")))))
{
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
+ zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot set read-only property %s::$%s", Z_OBJCE_P(object)->name->val, Z_STRVAL_P(member));
}
else
{
- zend_std_obj_handlers->write_property(object, member, value, cache_slot TSRMLS_CC);
+ zend_std_obj_handlers->write_property(object, member, value, cache_slot);
}
}
/* }}} */
@@ -6139,38 +6139,38 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
reflection_object_handlers.write_property = _reflection_write_property;
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions);
- reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default());
INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions);
- reflection_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
+ reflection_ptr = zend_register_internal_class(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "Reflector", reflector_functions);
- reflector_ptr = zend_register_internal_interface(&_reflection_entry TSRMLS_CC);
+ reflector_ptr = zend_register_internal_interface(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunctionAbstract", reflection_function_abstract_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_function_abstract_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT TSRMLS_CC);
+ reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_function_abstract_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr TSRMLS_CC);
- zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
+ zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_parameter_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_parameter_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr TSRMLS_CC);
- zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
+ zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_STATIC", ZEND_ACC_STATIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_PUBLIC", ZEND_ACC_PUBLIC);
@@ -6181,9 +6181,9 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_class_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_class_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_class_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
@@ -6191,14 +6191,14 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr TSRMLS_CC);
+ reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_property_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_property_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_property_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_property_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_STATIC", ZEND_ACC_STATIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_PUBLIC", ZEND_ACC_PUBLIC);
@@ -6207,15 +6207,15 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_extension_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_extension_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_extension_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionZendExtension", reflection_zend_extension_functions);
_reflection_entry.create_object = reflection_objects_new;
- reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
- zend_class_implements(reflection_zend_extension_ptr TSRMLS_CC, 1, reflector_ptr);
- zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry);
+ zend_class_implements(reflection_zend_extension_ptr, 1, reflector_ptr);
+ zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
return SUCCESS;
} /* }}} */
diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h
index 1c436d7dcc..bf8a5d2854 100644
--- a/ext/reflection/php_reflection.h
+++ b/ext/reflection/php_reflection.h
@@ -42,7 +42,7 @@ extern PHPAPI zend_class_entry *reflection_property_ptr;
extern PHPAPI zend_class_entry *reflection_extension_ptr;
extern PHPAPI zend_class_entry *reflection_zend_extension_ptr;
-PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object TSRMLS_DC);
+PHPAPI void zend_reflection_class_factory(zend_class_entry *ce, zval *object);
END_EXTERN_C()
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index cb61c8a221..64aa0ce145 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -118,7 +118,7 @@ static void ps_files_close(ps_files *data)
}
}
-static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
+static void ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
#if !defined(O_NOFOLLOW) || !defined(PHP_WIN32)
@@ -134,7 +134,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
ps_files_close(data);
if (php_session_valid_key(key) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
+ php_error_docref(NULL, E_WARNING, "The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
return;
}
@@ -150,7 +150,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
#else
/* Check to make sure that the opened file is not outside of allowable dirs.
This is not 100% safe but it's hard to do something better without O_NOFOLLOW */
- if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
+ if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf)) {
return;
}
data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode);
@@ -173,16 +173,16 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
# define FD_CLOEXEC 1
# endif
if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno);
}
}
}
-static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
+static int ps_files_cleanup_dir(const char *dirname, int maxlifetime)
{
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
@@ -195,7 +195,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
dir = opendir(dirname);
if (!dir) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
+ php_error_docref(NULL, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
return (0);
}
@@ -235,7 +235,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
return (nrdels);
}
-static int ps_files_key_exists(ps_files *data, const char *key TSRMLS_DC)
+static int ps_files_key_exists(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
zend_stat_t sbuf;
@@ -263,9 +263,9 @@ PS_OPEN_FUNC(files)
if (*save_path == '\0') {
/* if save path is an empty string, determine the temporary dir */
- save_path = php_get_temporary_directory(TSRMLS_C);
+ save_path = php_get_temporary_directory();
- if (php_check_open_basedir(save_path TSRMLS_CC)) {
+ if (php_check_open_basedir(save_path)) {
return FAILURE;
}
}
@@ -309,7 +309,7 @@ PS_OPEN_FUNC(files)
data->basedir = estrndup(save_path, data->basedir_len);
if (PS_GET_MOD_DATA()) {
- ps_close_files(mod_data TSRMLS_CC);
+ ps_close_files(mod_data);
}
PS_SET_MOD_DATA(data);
@@ -341,24 +341,24 @@ PS_READ_FUNC(files)
/* If strict mode, check session id existence */
if (PS(use_strict_mode) &&
- ps_files_key_exists(data, key? key->val : NULL TSRMLS_CC) == FAILURE) {
+ ps_files_key_exists(data, key? key->val : NULL) == FAILURE) {
/* key points to PS(id), but cannot change here. */
if (key) {
zend_string_release(PS(id));
PS(id) = NULL;
}
- PS(id) = PS(mod)->s_create_sid((void **)&data TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid((void **)&data);
if (!PS(id)) {
return FAILURE;
}
if (PS(use_cookies)) {
PS(send_cookie) = 1;
}
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
- ps_files_open(data, PS(id)->val TSRMLS_CC);
+ ps_files_open(data, PS(id)->val);
if (data->fd < 0) {
return FAILURE;
}
@@ -385,9 +385,9 @@ PS_READ_FUNC(files)
if (n != sbuf.st_size) {
if (n == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested");
+ php_error_docref(NULL, E_WARNING, "read returned less bytes than requested");
}
zend_string_release(*val);
return FAILURE;
@@ -401,7 +401,7 @@ PS_WRITE_FUNC(files)
zend_long n;
PS_FILES_DATA;
- ps_files_open(data, key->val TSRMLS_CC);
+ ps_files_open(data, key->val);
if (data->fd < 0) {
return FAILURE;
}
@@ -421,9 +421,9 @@ PS_WRITE_FUNC(files)
if (n != val->len) {
if (n == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested");
+ php_error_docref(NULL, E_WARNING, "write wrote less bytes than requested");
}
return FAILURE;
}
@@ -464,7 +464,7 @@ PS_GC_FUNC(files)
an external entity (i.e. find -ctime x | xargs rm) */
if (data->dirdepth == 0) {
- *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime TSRMLS_CC);
+ *nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime);
}
return SUCCESS;
@@ -477,9 +477,9 @@ PS_CREATE_SID_FUNC(files)
PS_FILES_DATA;
do {
- sid = php_session_create_id((void**)&data TSRMLS_CC);
+ sid = php_session_create_id((void**)&data);
/* Check collision */
- if (data && ps_files_key_exists(data, sid? sid->val : NULL TSRMLS_CC) == SUCCESS) {
+ if (data && ps_files_key_exists(data, sid? sid->val : NULL) == SUCCESS) {
if (sid) {
zend_string_release(sid);
sid = NULL;
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index bf48436a7e..d267dd0e1f 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -122,9 +122,8 @@ static ps_sd *ps_sd_new(ps_mm *data, const char *key)
sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen);
if (!sd) {
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %ld, err %s", mm_available(data->mm), mm_error());
+
+ php_error_docref(NULL, E_WARNING, "mm_malloc failed, avail %ld, err %s", mm_available(data->mm), mm_error());
return NULL;
}
@@ -208,7 +207,7 @@ static ps_sd *ps_sd_lookup(ps_mm *data, const char *key, int rw)
return ret;
}
-static int ps_mm_key_exists(ps_mm *data, const char *key TSRMLS_DC)
+static int ps_mm_key_exists(ps_mm *data, const char *key)
{
ps_sd *sd;
@@ -357,20 +356,20 @@ PS_READ_FUNC(mm)
/* If there is an ID and strict mode, verify existence */
if (PS(use_strict_mode)
- && ps_mm_key_exists(data, key TSRMLS_CC) == FAILURE) {
+ && ps_mm_key_exists(data, key) == FAILURE) {
/* key points to PS(id), but cannot change here. */
if (key) {
efree(PS(id));
PS(id) = NULL;
}
- PS(id) = PS(mod)->s_create_sid((void **)&data, NULL TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid((void **)&data, NULL);
if (!PS(id)) {
return FAILURE;
}
if (PS(use_cookies)) {
PS(send_cookie) = 1;
}
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
@@ -411,7 +410,7 @@ PS_WRITE_FUNC(mm)
if (!sd->data) {
ps_sd_destroy(data, sd);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot allocate new data segment");
+ php_error_docref(NULL, E_WARNING, "cannot allocate new data segment");
sd = NULL;
}
}
@@ -484,9 +483,9 @@ PS_CREATE_SID_FUNC(mm)
PS_MM_DATA;
do {
- sid = php_session_create_id((void **)&data, newlen TSRMLS_CC);
+ sid = php_session_create_id((void **)&data, newlen);
/* Check collision */
- if (ps_mm_key_exists(data, sid TSRMLS_CC) == SUCCESS) {
+ if (ps_mm_key_exists(data, sid) == SUCCESS) {
if (sid) {
efree(sid);
sid = NULL;
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index 5d474deab5..0e6e00eb32 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -47,10 +47,10 @@ ps_module ps_mod_user = {
ZVAL_STR_COPY(a, vl); \
}
-static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRMLS_DC)
+static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval)
{
int i;
- if (call_user_function(EG(function_table), NULL, func, retval, argc, argv TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, func, retval, argc, argv) == FAILURE) {
zval_ptr_dtor(retval);
ZVAL_UNDEF(retval);
} else if (Z_ISUNDEF_P(retval)) {
@@ -81,7 +81,7 @@ static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval TSRML
ret = SUCCESS; \
} else { \
if (!EG(exception)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, \
+ php_error_docref(NULL, E_WARNING, \
"Session callback expects true/false return value"); \
} \
ret = FAILURE; \
@@ -96,7 +96,7 @@ PS_OPEN_FUNC(user)
STDVARS;
if (Z_ISUNDEF(PSF(open))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"user session functions not defined");
return FAILURE;
@@ -105,7 +105,7 @@ PS_OPEN_FUNC(user)
SESS_ZVAL_STRING((char*)save_path, &args[0]);
SESS_ZVAL_STRING((char*)session_name, &args[1]);
- ps_call_handler(&PSF(open), 2, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(open), 2, args, &retval);
PS(mod_user_implemented) = 1;
FINISH;
@@ -122,7 +122,7 @@ PS_CLOSE_FUNC(user)
}
zend_try {
- ps_call_handler(&PSF(close), 0, NULL, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(close), 0, NULL, &retval);
} zend_catch {
bailout = 1;
} zend_end_try();
@@ -146,7 +146,7 @@ PS_READ_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
- ps_call_handler(&PSF(read), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(read), 1, args, &retval);
if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) == IS_STRING) {
@@ -167,7 +167,7 @@ PS_WRITE_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
SESS_ZVAL_STR(val, &args[1]);
- ps_call_handler(&PSF(write), 2, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(write), 2, args, &retval);
FINISH;
}
@@ -179,7 +179,7 @@ PS_DESTROY_FUNC(user)
SESS_ZVAL_STR(key, &args[0]);
- ps_call_handler(&PSF(destroy), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(destroy), 1, args, &retval);
FINISH;
}
@@ -191,7 +191,7 @@ PS_GC_FUNC(user)
SESS_ZVAL_LONG(maxlifetime, &args[0]);
- ps_call_handler(&PSF(gc), 1, args, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(gc), 1, args, &retval);
FINISH;
}
@@ -203,7 +203,7 @@ PS_CREATE_SID_FUNC(user)
zend_string *id = NULL;
zval retval;
- ps_call_handler(&PSF(create_sid), 0, NULL, &retval TSRMLS_CC);
+ ps_call_handler(&PSF(create_sid), 0, NULL, &retval);
if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) == IS_STRING) {
@@ -211,12 +211,12 @@ PS_CREATE_SID_FUNC(user)
}
zval_ptr_dtor(&retval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "No session id returned by function");
+ php_error_docref(NULL, E_ERROR, "No session id returned by function");
return NULL;
}
if (!id) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Session id must be a string");
+ php_error_docref(NULL, E_ERROR, "Session id must be a string");
return NULL;
}
@@ -224,7 +224,7 @@ PS_CREATE_SID_FUNC(user)
}
/* function as defined by PS_MOD */
- return php_session_create_id(mod_data TSRMLS_CC);
+ return php_session_create_id(mod_data);
}
/*
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 7e2960cc32..0c8fb2c701 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -23,14 +23,14 @@
#define PS_SANITY_CHECK \
if (PS(default_mod) == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Cannot call default session handler"); \
+ php_error_docref(NULL, E_CORE_ERROR, "Cannot call default session handler"); \
RETURN_FALSE; \
}
#define PS_SANITY_CHECK_IS_OPEN \
PS_SANITY_CHECK; \
if (!PS(mod_user_is_open)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parent session handler is not open"); \
+ php_error_docref(NULL, E_WARNING, "Parent session handler is not open"); \
RETURN_FALSE; \
}
@@ -43,12 +43,12 @@ PHP_METHOD(SessionHandler, open)
PS_SANITY_CHECK;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &save_path, &save_path_len, &session_name, &session_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &save_path, &save_path_len, &session_name, &session_name_len) == FAILURE) {
return;
}
PS(mod_user_is_open) = 1;
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_open(&PS(mod_data), save_path, session_name TSRMLS_CC));
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_open(&PS(mod_data), save_path, session_name));
}
/* }}} */
@@ -63,7 +63,7 @@ PHP_METHOD(SessionHandler, close)
zend_parse_parameters_none();
PS(mod_user_is_open) = 0;
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_close(&PS(mod_data) TSRMLS_CC));
+ RETVAL_BOOL(SUCCESS == PS(default_mod)->s_close(&PS(mod_data)));
}
/* }}} */
@@ -76,11 +76,11 @@ PHP_METHOD(SessionHandler, read)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
- if (PS(default_mod)->s_read(&PS(mod_data), key, &val TSRMLS_CC) == FAILURE) {
+ if (PS(default_mod)->s_read(&PS(mod_data), key, &val) == FAILURE) {
RETVAL_FALSE;
return;
}
@@ -97,11 +97,11 @@ PHP_METHOD(SessionHandler, write)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &key, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &key, &val) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val));
}
/* }}} */
@@ -113,11 +113,11 @@ PHP_METHOD(SessionHandler, destroy)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key));
}
/* }}} */
@@ -130,11 +130,11 @@ PHP_METHOD(SessionHandler, gc)
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &maxlifetime) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &maxlifetime) == FAILURE) {
return;
}
- RETURN_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels));
}
/* }}} */
@@ -150,7 +150,7 @@ PHP_METHOD(SessionHandler, create_sid)
return;
}
- id = PS(default_mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ id = PS(default_mod)->s_create_sid(&PS(mod_data));
RETURN_STR(id);
}
diff --git a/ext/session/php_session.h b/ext/session/php_session.h
index 1bd6d561b7..961a3bcd91 100644
--- a/ext/session/php_session.h
+++ b/ext/session/php_session.h
@@ -221,11 +221,11 @@ typedef struct ps_serializer_struct {
#define PS_SERIALIZER_ENTRY(x) \
{ #x, PS_SERIALIZER_ENCODE_NAME(x), PS_SERIALIZER_DECODE_NAME(x) }
-PHPAPI void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC);
+PHPAPI void session_adapt_url(const char *, size_t, char **, size_t *);
-PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC);
-PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI zval *php_get_session_var(zend_string *name TSRMLS_DC);
+PHPAPI void php_add_session_var(zend_string *name);
+PHPAPI zval *php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash);
+PHPAPI zval *php_get_session_var(zend_string *name);
PHPAPI int php_session_register_module(ps_module *);
@@ -233,17 +233,17 @@ PHPAPI int php_session_register_serializer(const char *name,
zend_string *(*encode)(PS_SERIALIZER_ENCODE_ARGS),
int (*decode)(PS_SERIALIZER_DECODE_ARGS));
-PHPAPI void php_session_set_id(char *id TSRMLS_DC);
-PHPAPI void php_session_start(TSRMLS_D);
+PHPAPI void php_session_set_id(char *id);
+PHPAPI void php_session_start(void);
-PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC);
-PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC);
+PHPAPI ps_module *_php_find_ps_module(char *name);
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name);
PHPAPI int php_session_valid_key(const char *key);
-PHPAPI void php_session_reset_id(TSRMLS_D);
+PHPAPI void php_session_reset_id(void);
#define PS_ADD_VARL(name) do { \
- php_add_session_var(name TSRMLS_CC); \
+ php_add_session_var(name); \
} while (0)
#define PS_ADD_VAR(name) PS_ADD_VARL(name)
@@ -264,11 +264,11 @@ PHPAPI void php_session_reset_id(TSRMLS_D);
HashTable *_ht = Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))); \
ZEND_HASH_FOREACH_KEY(_ht, num_key, key) { \
if (key == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, \
+ php_error_docref(NULL, E_NOTICE, \
"Skipping numeric key %pd", num_key); \
continue; \
} \
- if ((struc = php_get_session_var(key TSRMLS_CC))) { \
+ if ((struc = php_get_session_var(key))) { \
code; \
} \
} ZEND_HASH_FOREACH_END(); \
diff --git a/ext/session/session.c b/ext/session/session.c
index 12564fa5b9..31f944df69 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -62,8 +62,8 @@
PHPAPI ZEND_DECLARE_MODULE_GLOBALS(ps)
-static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC);
-static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra TSRMLS_DC);
+static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra);
+static int (*php_session_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra);
/* SessionHandler class */
zend_class_entry *php_session_class_entry;
@@ -83,14 +83,14 @@ zend_class_entry *php_session_id_iface_entry;
#define SESSION_CHECK_ACTIVE_STATE \
if (PS(session_status) == php_session_active) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time"); \
+ php_error_docref(NULL, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time"); \
return FAILURE; \
}
-static void php_session_send_cookie(TSRMLS_D);
+static void php_session_send_cookie(void);
/* Dispatched by RINIT and by php_session_destroy */
-static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */
+static inline void php_rinit_session_globals(void) /* {{{ */
{
PS(id) = NULL;
PS(session_status) = php_session_none;
@@ -102,7 +102,7 @@ static inline void php_rinit_session_globals(TSRMLS_D) /* {{{ */
/* }}} */
/* Dispatched by RSHUTDOWN and by php_session_destroy */
-static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
+static inline void php_rshutdown_session_globals(void) /* {{{ */
{
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -111,7 +111,7 @@ static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
/* Do NOT destroy PS(mod_user_names) here! */
if (PS(mod_data) || PS(mod_user_implemented)) {
zend_try {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
} zend_end_try();
}
if (PS(id)) {
@@ -120,28 +120,28 @@ static inline void php_rshutdown_session_globals(TSRMLS_D) /* {{{ */
}
/* }}} */
-static int php_session_destroy(TSRMLS_D) /* {{{ */
+static int php_session_destroy(void) /* {{{ */
{
int retval = SUCCESS;
if (PS(session_status) != php_session_active) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session");
+ php_error_docref(NULL, E_WARNING, "Trying to destroy uninitialized session");
return FAILURE;
}
- if (PS(id) && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
+ if (PS(id) && PS(mod)->s_destroy(&PS(mod_data), PS(id)) == FAILURE) {
retval = FAILURE;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
+ php_error_docref(NULL, E_WARNING, "Session object destruction failed");
}
- php_rshutdown_session_globals(TSRMLS_C);
- php_rinit_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
+ php_rinit_session_globals();
return retval;
}
/* }}} */
-PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC) /* {{{ */
+PHPAPI void php_add_session_var(zend_string *name) /* {{{ */
{
zval *sym_track = NULL;
@@ -160,7 +160,7 @@ PHPAPI void php_add_session_var(zend_string *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC) /* {{{ */
+PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unserialize_data_t *var_hash) /* {{{ */
{
IF_SESSION_VARS() {
return zend_hash_update(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), name, state_val);
@@ -169,7 +169,7 @@ PHPAPI zval* php_set_session_var(zend_string *name, zval *state_val, php_unseria
}
/* }}} */
-PHPAPI zval* php_get_session_var(zend_string *name TSRMLS_DC) /* {{{ */
+PHPAPI zval* php_get_session_var(zend_string *name) /* {{{ */
{
IF_SESSION_VARS() {
return zend_hash_find(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), name);
@@ -178,12 +178,12 @@ PHPAPI zval* php_get_session_var(zend_string *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void php_session_track_init(TSRMLS_D) /* {{{ */
+static void php_session_track_init(void) /* {{{ */
{
zval session_vars;
zend_string *var_name = zend_string_init("_SESSION", sizeof("_SESSION") - 1, 0);
/* Unconditionally destroy existing array -- possible dirty data */
- zend_delete_global_variable(var_name TSRMLS_CC);
+ zend_delete_global_variable(var_name);
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -197,30 +197,30 @@ static void php_session_track_init(TSRMLS_D) /* {{{ */
}
/* }}} */
-static zend_string *php_session_encode(TSRMLS_D) /* {{{ */
+static zend_string *php_session_encode(void) /* {{{ */
{
IF_SESSION_VARS() {
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object");
+ php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to encode session object");
return NULL;
}
- return PS(serializer)->encode(TSRMLS_C);
+ return PS(serializer)->encode();
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot encode non-existent session");
+ php_error_docref(NULL, E_WARNING, "Cannot encode non-existent session");
}
return NULL;
}
/* }}} */
-static void php_session_decode(const char *val, int vallen TSRMLS_DC) /* {{{ */
+static void php_session_decode(const char *val, int vallen) /* {{{ */
{
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
+ php_error_docref(NULL, E_WARNING, "Unknown session.serialize_handler. Failed to decode session object");
return;
}
- if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
- php_session_destroy(TSRMLS_C);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed");
+ if (PS(serializer)->decode(val, vallen) == FAILURE) {
+ php_session_destroy();
+ php_error_docref(NULL, E_WARNING, "Failed to decode session object. Session has been destroyed");
}
}
/* }}} */
@@ -305,7 +305,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
}
/* maximum 15+19+19+10 bytes */
- spprintf(&buf, 0, "%.15s%ld" ZEND_LONG_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg(TSRMLS_C) * 10);
+ spprintf(&buf, 0, "%.15s%ld" ZEND_LONG_FMT "%0.8F", remote_addr ? remote_addr : "", tv.tv_sec, (zend_long)tv.tv_usec, php_combined_lcg() * 10);
switch (PS(hash_func)) {
case PS_HASH_FUNC_MD5:
@@ -321,7 +321,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
case PS_HASH_FUNC_OTHER:
if (!PS(hash_ops)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
+ php_error_docref(NULL, E_ERROR, "Invalid session hash function");
efree(buf);
return NULL;
}
@@ -333,7 +333,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
break;
#endif /* HAVE_HASH_EXT */
default:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
+ php_error_docref(NULL, E_ERROR, "Invalid session hash function");
efree(buf);
return NULL;
}
@@ -413,7 +413,7 @@ PHPAPI zend_string *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
|| PS(hash_bits_per_character) > 6) {
PS(hash_bits_per_character) = 4;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
+ php_error_docref(NULL, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
}
outid = zend_string_alloc((digest_len + 2) * ((8.0f / PS(hash_bits_per_character) + 0.5)), 0);
@@ -458,26 +458,26 @@ PHPAPI int php_session_valid_key(const char *key) /* {{{ */
}
/* }}} */
-static void php_session_initialize(TSRMLS_D) /* {{{ */
+static void php_session_initialize(void) /* {{{ */
{
zend_string *val = NULL;
if (!PS(mod)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "No storage module chosen - failed to initialize session");
+ php_error_docref(NULL, E_ERROR, "No storage module chosen - failed to initialize session");
return;
}
/* Open session handler first */
- if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Failed to initialize storage module: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
/* If there is no ID, use session module to create one */
if (!PS(id)) {
- PS(id) = PS(mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (!PS(id)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ php_error_docref(NULL, E_ERROR, "Failed to create session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
return;
}
if (PS(use_cookies)) {
@@ -487,26 +487,26 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
/* Set session ID for compatibility for older/3rd party save handlers */
if (!PS(use_strict_mode)) {
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
/* Read data */
- php_session_track_init(TSRMLS_C);
- if (PS(mod)->s_read(&PS(mod_data), PS(id), &val TSRMLS_CC) == FAILURE) {
+ php_session_track_init();
+ if (PS(mod)->s_read(&PS(mod_data), PS(id), &val) == FAILURE) {
/* Some broken save handler implementation returns FAILURE for non-existent session ID */
/* It's better to raise error for this, but disabled error for better compatibility */
/*
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
+ php_error_docref(NULL, E_NOTICE, "Failed to read session data: %s (path: %s)", PS(mod)->s_name, PS(save_path));
*/
}
/* Set session ID if session read didn't activated session */
if (PS(use_strict_mode) && PS(session_status) != php_session_active) {
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
PS(session_status) = php_session_active;
}
if (val) {
- php_session_decode(val->val, val->len TSRMLS_CC);
+ php_session_decode(val->val, val->len);
zend_string_release(val);
}
@@ -519,7 +519,7 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void php_session_save_current_state(TSRMLS_D) /* {{{ */
+static void php_session_save_current_state(void) /* {{{ */
{
int ret = FAILURE;
@@ -527,17 +527,17 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
if (PS(mod_data) || PS(mod_user_implemented)) {
zend_string *val;
- val = php_session_encode(TSRMLS_C);
+ val = php_session_encode();
if (val) {
- ret = PS(mod)->s_write(&PS(mod_data), PS(id), val TSRMLS_CC);
+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), val);
zend_string_release(val);
} else {
- ret = PS(mod)->s_write(&PS(mod_data), PS(id), STR_EMPTY_ALLOC() TSRMLS_CC);
+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), STR_EMPTY_ALLOC());
}
}
if ((ret == FAILURE) && !EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please "
+ php_error_docref(NULL, E_WARNING, "Failed to write session data (%s). Please "
"verify that the current setting of session.save_path "
"is correct (%s)",
PS(mod)->s_name,
@@ -546,7 +546,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
}
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
}
/* }}} */
@@ -560,7 +560,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
ps_module *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_module(new_value->val TSRMLS_CC);
+ tmp = _php_find_ps_module(new_value->val);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -573,7 +573,7 @@ static PHP_INI_MH(OnUpdateSaveHandler) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find save handler '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "Cannot find save handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -590,7 +590,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
const ps_serializer *tmp;
SESSION_CHECK_ACTIVE_STATE;
- tmp = _php_find_ps_serializer(new_value->val TSRMLS_CC);
+ tmp = _php_find_ps_serializer(new_value->val);
if (PG(modules_activated) && !tmp) {
int err_type;
@@ -603,7 +603,7 @@ static PHP_INI_MH(OnUpdateSerializer) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "Cannot find serialization handler '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "Cannot find serialization handler '%s'", new_value->val);
}
return FAILURE;
}
@@ -648,12 +648,12 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
p = new_value->val;
}
- if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
+ if (PG(open_basedir) && *p && php_check_open_basedir(p)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -672,12 +672,12 @@ static PHP_INI_MH(OnUpdateName) /* {{{ */
/* Do not output error when restoring ini options. */
if (stage != ZEND_INI_STAGE_DEACTIVATE) {
- php_error_docref(NULL TSRMLS_CC, err_type, "session.name cannot be a numeric or empty '%s'", new_value->val);
+ php_error_docref(NULL, err_type, "session.name cannot be a numeric or empty '%s'", new_value->val);
}
return FAILURE;
}
- OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateStringUnempty(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
/* }}} */
@@ -726,7 +726,7 @@ static PHP_INI_MH(OnUpdateHashFunc) /* {{{ */
}
#endif /* HAVE_HASH_EXT }}} */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value->val);
+ php_error_docref(NULL, E_WARNING, "session.configuration 'session.hash_function' must be existing hash function. %s does not exist.", new_value->val);
return FAILURE;
}
/* }}} */
@@ -736,12 +736,12 @@ static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
int tmp;
tmp = zend_atoi(new_value->val, new_value->len);
if(tmp < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
return FAILURE;
}
if(new_value->len > 0 && new_value->val[new_value->len-1] == '%') {
if(tmp > 100) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "session.upload_progress.freq cannot be over 100%%");
+ php_error_docref(NULL, E_WARNING, "session.upload_progress.freq cannot be over 100%%");
return FAILURE;
}
PS(rfc1867_freq) = -tmp;
@@ -814,7 +814,7 @@ PS_SERIALIZER_ENCODE_FUNC(php_serialize) /* {{{ */
php_serialize_data_t var_hash;
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, Z_REFVAL(PS(http_session_vars)), &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, Z_REFVAL(PS(http_session_vars)), &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
return buf.s;
}
@@ -829,7 +829,7 @@ PS_SERIALIZER_DECODE_FUNC(php_serialize) /* {{{ */
ZVAL_NULL(&session_vars);
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- php_var_unserialize(&session_vars, (const unsigned char **)&val, endptr, &var_hash TSRMLS_CC);
+ php_var_unserialize(&session_vars, (const unsigned char **)&val, endptr, &var_hash);
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if (!Z_ISUNDEF(PS(http_session_vars))) {
zval_ptr_dtor(&PS(http_session_vars));
@@ -861,7 +861,7 @@ PS_SERIALIZER_ENCODE_FUNC(php_binary) /* {{{ */
if (key->len > PS_BIN_MAX) continue;
smart_str_appendc(&buf, (unsigned char)key->len);
smart_str_appendl(&buf, key->val, key->len);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
} else {
if (key->len > PS_BIN_MAX) continue;
smart_str_appendc(&buf, (unsigned char) (key->len & PS_BIN_UNDEF));
@@ -910,8 +910,8 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */
if (has_value) {
ZVAL_UNDEF(&current);
- if (php_var_unserialize(&current, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
- zval *zv = php_set_session_var(name, &current, &var_hash TSRMLS_CC);
+ if (php_var_unserialize(&current, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash)) {
+ zval *zv = php_set_session_var(name, &current, &var_hash );
var_replace(&var_hash, &current, zv);
} else {
zval_ptr_dtor(&current);
@@ -947,7 +947,7 @@ PS_SERIALIZER_ENCODE_FUNC(php) /* {{{ */
}
smart_str_appendc(&buf, PS_DELIMITER);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
} else {
smart_str_appendc(&buf, PS_UNDEF_MARKER);
smart_str_appendl(&buf, key->val, key->len);
@@ -1000,8 +1000,8 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */
if (has_value) {
ZVAL_UNDEF(&current);
- if (php_var_unserialize(&current, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) {
- zval *zv = php_set_session_var(name, &current, &var_hash TSRMLS_CC);
+ if (php_var_unserialize(&current, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash)) {
+ zval *zv = php_set_session_var(name, &current, &var_hash);
var_replace(&var_hash, &current, zv);
} else {
zval_ptr_dtor(&current);
@@ -1083,11 +1083,11 @@ PHPAPI int php_session_register_module(ps_module *ptr) /* {{{ */
typedef struct {
char *name;
- void (*func)(TSRMLS_D);
+ void (*func)(void);
} php_session_cache_limiter_t;
#define CACHE_LIMITER(name) _php_cache_limiter_##name
-#define CACHE_LIMITER_FUNC(name) static void CACHE_LIMITER(name)(TSRMLS_D)
+#define CACHE_LIMITER_FUNC(name) static void CACHE_LIMITER(name)(void)
#define CACHE_LIMITER_ENTRY(name) { #name, CACHE_LIMITER(name) },
#define ADD_HEADER(a) sapi_add_header(a, strlen(a), 1);
#define MAX_STR 512
@@ -1124,7 +1124,7 @@ static inline void strcpy_gmt(char *ubuf, time_t *when) /* {{{ */
}
/* }}} */
-static inline void last_modified(TSRMLS_D) /* {{{ */
+static inline void last_modified(void) /* {{{ */
{
const char *path;
zend_stat_t sb;
@@ -1160,7 +1160,7 @@ CACHE_LIMITER_FUNC(public) /* {{{ */
snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_LONG_FMT, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
- last_modified(TSRMLS_C);
+ last_modified();
}
/* }}} */
@@ -1171,14 +1171,14 @@ CACHE_LIMITER_FUNC(private_no_expire) /* {{{ */
snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=" ZEND_LONG_FMT ", pre-check=" ZEND_LONG_FMT, PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */
ADD_HEADER(buf);
- last_modified(TSRMLS_C);
+ last_modified();
}
/* }}} */
CACHE_LIMITER_FUNC(private) /* {{{ */
{
ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
- CACHE_LIMITER(private_no_expire)(TSRMLS_C);
+ CACHE_LIMITER(private_no_expire)();
}
/* }}} */
@@ -1202,27 +1202,27 @@ static php_session_cache_limiter_t php_session_cache_limiters[] = {
{0}
};
-static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
+static int php_session_cache_limiter(void) /* {{{ */
{
php_session_cache_limiter_t *lim;
if (PS(cache_limiter)[0] == '\0') return 0;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
- int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
if (output_start_filename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno);
+ php_error_docref(NULL, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", output_start_filename, output_start_lineno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot send session cache limiter - headers already sent");
}
return -2;
}
for (lim = php_session_cache_limiters; lim->name; lim++) {
if (!strcasecmp(lim->name, PS(cache_limiter))) {
- lim->func(TSRMLS_C);
+ lim->func();
return 0;
}
}
@@ -1240,7 +1240,7 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
* It must be directly removed from SG(sapi_header) because sapi_add_header_ex()
* removes all of matching cookie. i.e. It deletes all of Set-Cookie headers.
*/
-static void php_session_remove_cookie(TSRMLS_D) {
+static void php_session_remove_cookie(void) {
sapi_header_struct *header;
zend_llist *l = &SG(sapi_headers).headers;
zend_llist_element *next;
@@ -1280,20 +1280,20 @@ static void php_session_remove_cookie(TSRMLS_D) {
efree(session_cookie);
}
-static void php_session_send_cookie(TSRMLS_D) /* {{{ */
+static void php_session_send_cookie(void) /* {{{ */
{
smart_str ncookie = {0};
zend_string *date_fmt = NULL;
zend_string *e_session_name, *e_id;
if (SG(headers_sent)) {
- const char *output_start_filename = php_output_get_start_filename(TSRMLS_C);
- int output_start_lineno = php_output_get_start_lineno(TSRMLS_C);
+ const char *output_start_filename = php_output_get_start_filename();
+ int output_start_lineno = php_output_get_start_lineno();
if (output_start_filename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", output_start_filename, output_start_lineno);
+ php_error_docref(NULL, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", output_start_filename, output_start_lineno);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot send session cookie - headers already sent");
}
return;
}
@@ -1318,7 +1318,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
t = tv.tv_sec + PS(cookie_lifetime);
if (t > 0) {
- date_fmt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0 TSRMLS_CC);
+ date_fmt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, t, 0);
smart_str_appends(&ncookie, COOKIE_EXPIRES);
smart_str_appendl(&ncookie, date_fmt->val, date_fmt->len);
zend_string_release(date_fmt);
@@ -1348,15 +1348,15 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
smart_str_0(&ncookie);
- php_session_remove_cookie(TSRMLS_C); /* remove already sent session ID cookie */
+ php_session_remove_cookie(); /* remove already sent session ID cookie */
/* 'replace' must be 0 here, else a previous Set-Cookie
header, probably sent with setcookie() will be replaced! */
- sapi_add_header_ex(estrndup(ncookie.s->val, ncookie.s->len), ncookie.s->len, 0, 0 TSRMLS_CC);
+ sapi_add_header_ex(estrndup(ncookie.s->val, ncookie.s->len), ncookie.s->len, 0, 0);
smart_str_free(&ncookie);
}
/* }}} */
-PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
+PHPAPI ps_module *_php_find_ps_module(char *name) /* {{{ */
{
ps_module *ret = NULL;
ps_module **mod;
@@ -1372,7 +1372,7 @@ PHPAPI ps_module *_php_find_ps_module(char *name TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{ */
+PHPAPI const ps_serializer *_php_find_ps_serializer(char *name) /* {{{ */
{
const ps_serializer *ret = NULL;
const ps_serializer *mod;
@@ -1387,7 +1387,7 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{
}
/* }}} */
-static void ppid2sid(zval *ppid TSRMLS_DC) {
+static void ppid2sid(zval *ppid) {
if (Z_TYPE_P(ppid) != IS_STRING) {
PS(id) = NULL;
PS(send_cookie) = 1;
@@ -1398,17 +1398,17 @@ static void ppid2sid(zval *ppid TSRMLS_DC) {
}
}
-PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
+PHPAPI void php_session_reset_id(void) /* {{{ */
{
int module_number = PS(module_number);
if (!PS(id)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set session ID - session ID is not initialized");
+ php_error_docref(NULL, E_WARNING, "Cannot set session ID - session ID is not initialized");
return;
}
if (PS(use_cookies) && PS(send_cookie)) {
- php_session_send_cookie(TSRMLS_C);
+ php_session_send_cookie();
PS(send_cookie) = 0;
}
@@ -1429,13 +1429,13 @@ PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */
}
if (PS(apply_trans_sid)) {
- php_url_scanner_reset_vars(TSRMLS_C);
- php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id)->val, PS(id)->len, 1 TSRMLS_CC);
+ php_url_scanner_reset_vars();
+ php_url_scanner_add_var(PS(session_name), strlen(PS(session_name)), PS(id)->val, PS(id)->len, 1);
}
}
/* }}} */
-PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
+PHPAPI void php_session_start(void) /* {{{ */
{
zval *ppid;
zval *data;
@@ -1458,17 +1458,17 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
case php_session_disabled:
value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0);
if (!PS(mod) && value) {
- PS(mod) = _php_find_ps_module(value TSRMLS_CC);
+ PS(mod) = _php_find_ps_module(value);
if (!PS(mod)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find save handler '%s' - session startup failed", value);
+ php_error_docref(NULL, E_WARNING, "Cannot find save handler '%s' - session startup failed", value);
return;
}
}
value = zend_ini_string("session.serialize_handler", sizeof("session.serialize_handler") - 1, 0);
if (!PS(serializer) && value) {
- PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
+ PS(serializer) = _php_find_ps_serializer(value);
if (!PS(serializer)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find serialization handler '%s' - session startup failed", value);
+ php_error_docref(NULL, E_WARNING, "Cannot find serialization handler '%s' - session startup failed", value);
return;
}
}
@@ -1491,7 +1491,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
PS(apply_trans_sid) = 0;
PS(define_sid) = 0;
}
@@ -1501,7 +1501,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
}
if (!PS(use_only_cookies) && !PS(id) &&
@@ -1509,7 +1509,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
Z_TYPE_P(data) == IS_ARRAY &&
(ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess))
) {
- ppid2sid(ppid TSRMLS_CC);
+ ppid2sid(ppid);
}
}
@@ -1558,18 +1558,18 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
PS(id) = NULL;
}
- php_session_initialize(TSRMLS_C);
- php_session_cache_limiter(TSRMLS_C);
+ php_session_initialize();
+ php_session_cache_limiter();
if ((PS(mod_data) || PS(mod_user_implemented)) && PS(gc_probability) > 0) {
int nrdels = -1;
- nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C));
+ nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg());
if (nrand < PS(gc_probability)) {
- PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC);
+ PS(mod)->s_gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels);
#ifdef SESSION_DEBUG
if (nrdels != -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects", nrdels);
+ php_error_docref(NULL, E_NOTICE, "purged %d expired session objects", nrdels);
}
#endif
}
@@ -1577,39 +1577,39 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void php_session_flush(TSRMLS_D) /* {{{ */
+static void php_session_flush(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
- php_session_save_current_state(TSRMLS_C);
+ php_session_save_current_state();
}
}
/* }}} */
-static void php_session_abort(TSRMLS_D) /* {{{ */
+static void php_session_abort(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
}
}
/* }}} */
-static void php_session_reset(TSRMLS_D) /* {{{ */
+static void php_session_reset(void) /* {{{ */
{
if (PS(session_status) == php_session_active) {
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
}
}
/* }}} */
-PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen TSRMLS_DC) /* {{{ */
+PHPAPI void session_adapt_url(const char *url, size_t urllen, char **new, size_t *newlen) /* {{{ */
{
if (PS(apply_trans_sid) && (PS(session_status) == php_session_active)) {
- *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id)->val, newlen TSRMLS_CC);
+ *new = php_url_scanner_adapt_single_url(url, urllen, PS(session_name), PS(id)->val, newlen);
}
}
/* }}} */
@@ -1629,7 +1629,7 @@ static PHP_FUNCTION(session_set_cookie_params)
zend_string *ini_name;
if (!PS(use_cookies) ||
- zend_parse_parameters(argc TSRMLS_CC, "z|SSbb", &lifetime, &path, &domain, &secure, &httponly) == FAILURE) {
+ zend_parse_parameters(argc, "z|SSbb", &lifetime, &path, &domain, &secure, &httponly) == FAILURE) {
return;
}
@@ -1688,7 +1688,7 @@ static PHP_FUNCTION(session_name)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1709,7 +1709,7 @@ static PHP_FUNCTION(session_module_name)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1721,14 +1721,14 @@ static PHP_FUNCTION(session_module_name)
}
if (name) {
- if (!_php_find_ps_module(name->val TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot find named PHP session module (%s)", name->val);
+ if (!_php_find_ps_module(name->val)) {
+ php_error_docref(NULL, E_WARNING, "Cannot find named PHP session module (%s)", name->val);
zval_dtor(return_value);
RETURN_FALSE;
}
if (PS(mod_data) || PS(mod_user_implemented)) {
- PS(mod)->s_close(&PS(mod_data) TSRMLS_CC);
+ PS(mod)->s_close(&PS(mod_data));
}
PS(mod_data) = NULL;
@@ -1758,7 +1758,7 @@ static PHP_FUNCTION(session_set_save_handler)
zend_function *current_mptr;
zend_bool register_shutdown = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &obj, php_session_iface_entry, &register_shutdown) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, php_session_iface_entry, &register_shutdown) == FAILURE) {
RETURN_FALSE;
}
@@ -1775,7 +1775,7 @@ static PHP_FUNCTION(session_set_save_handler)
add_next_index_zval(&PS(mod_user_names).names[i], obj);
add_next_index_str(&PS(mod_user_names).names[i], zend_string_copy(func_name));
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Session handler's function table is corrupt");
+ php_error_docref(NULL, E_ERROR, "Session handler's function table is corrupt");
RETURN_FALSE;
}
@@ -1807,15 +1807,15 @@ static PHP_FUNCTION(session_set_save_handler)
ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_register_shutdown");
/* add shutdown function, removing the old one if it exists */
- if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry TSRMLS_CC)) {
+ if (!register_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1, &shutdown_function_entry)) {
zval_ptr_dtor(&shutdown_function_entry.arguments[0]);
efree(shutdown_function_entry.arguments);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to register session shutdown function");
+ php_error_docref(NULL, E_WARNING, "Unable to register session shutdown function");
RETURN_FALSE;
}
} else {
/* remove shutdown function */
- remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1 TSRMLS_CC);
+ remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1);
}
if (PS(mod) && PS(session_status) == php_session_none && PS(mod) != &ps_mod_user) {
@@ -1833,17 +1833,17 @@ static PHP_FUNCTION(session_set_save_handler)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(argc TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(argc, "+", &args, &num_args) == FAILURE) {
return;
}
/* remove shutdown function */
- remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1 TSRMLS_CC);
+ remove_user_shutdown_function("session_shutdown", sizeof("session_shutdown") - 1);
/* at this point argc can only be 6 or 7 */
for (i = 0; i < argc; i++) {
- if (!zend_is_callable(&args[i], 0, &name TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1);
+ if (!zend_is_callable(&args[i], 0, &name)) {
+ php_error_docref(NULL, E_WARNING, "Argument %d is not a valid callback", i+1);
zend_string_release(name);
RETURN_FALSE;
}
@@ -1876,7 +1876,7 @@ static PHP_FUNCTION(session_save_path)
zend_string *name = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &name) == FAILURE) {
return;
}
@@ -1884,7 +1884,7 @@ static PHP_FUNCTION(session_save_path)
if (name) {
if (memchr(name->val, '\0', name->len) != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The save_path cannot contain NULL characters");
+ php_error_docref(NULL, E_WARNING, "The save_path cannot contain NULL characters");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1902,7 +1902,7 @@ static PHP_FUNCTION(session_id)
zend_string *name = NULL;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "|S", &name) == FAILURE) {
+ if (zend_parse_parameters(argc, "|S", &name) == FAILURE) {
return;
}
@@ -1934,28 +1934,28 @@ static PHP_FUNCTION(session_regenerate_id)
{
zend_bool del_ses = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &del_ses) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &del_ses) == FAILURE) {
return;
}
if (SG(headers_sent) && PS(use_cookies)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot regenerate session id - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot regenerate session id - headers already sent");
RETURN_FALSE;
}
if (PS(session_status) == php_session_active) {
if (PS(id)) {
- if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
+ if (del_ses && PS(mod)->s_destroy(&PS(mod_data), PS(id)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Session object destruction failed");
RETURN_FALSE;
}
zend_string_release(PS(id));
}
- PS(id) = PS(mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
+ PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
if (PS(id)) {
PS(send_cookie) = 1;
- php_session_reset_id(TSRMLS_C);
+ php_session_reset_id();
RETURN_TRUE;
} else {
PS(id) = STR_EMPTY_ALLOC();
@@ -1972,7 +1972,7 @@ static PHP_FUNCTION(session_cache_limiter)
zend_string *limiter = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &limiter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &limiter) == FAILURE) {
return;
}
@@ -1993,7 +1993,7 @@ static PHP_FUNCTION(session_cache_expire)
zval *expires = NULL;
zend_string *ini_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &expires) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &expires) == FAILURE) {
return;
}
@@ -2018,7 +2018,7 @@ static PHP_FUNCTION(session_encode)
return;
}
- enc = php_session_encode(TSRMLS_C);
+ enc = php_session_encode();
if (enc == NULL) {
RETURN_FALSE;
}
@@ -2038,11 +2038,11 @@ static PHP_FUNCTION(session_decode)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
- php_session_decode(str, str_len TSRMLS_CC);
+ php_session_decode(str, str_len);
RETURN_TRUE;
}
@@ -2053,7 +2053,7 @@ static PHP_FUNCTION(session_decode)
static PHP_FUNCTION(session_start)
{
/* skipping check for non-zero args for performance reasons here ?*/
- php_session_start(TSRMLS_C);
+ php_session_start();
if (PS(session_status) != php_session_active) {
RETURN_FALSE;
@@ -2070,7 +2070,7 @@ static PHP_FUNCTION(session_destroy)
return;
}
- RETURN_BOOL(php_session_destroy(TSRMLS_C) == SUCCESS);
+ RETURN_BOOL(php_session_destroy() == SUCCESS);
}
/* }}} */
@@ -2095,7 +2095,7 @@ static PHP_FUNCTION(session_unset)
Write session data and end session */
static PHP_FUNCTION(session_write_close)
{
- php_session_flush(TSRMLS_C);
+ php_session_flush();
}
/* }}} */
@@ -2103,7 +2103,7 @@ static PHP_FUNCTION(session_write_close)
Abort session and end session. Session data will not be written */
static PHP_FUNCTION(session_abort)
{
- php_session_abort(TSRMLS_C);
+ php_session_abort();
}
/* }}} */
@@ -2111,7 +2111,7 @@ static PHP_FUNCTION(session_abort)
Reset session data from saved session data */
static PHP_FUNCTION(session_reset)
{
- php_session_reset(TSRMLS_C);
+ php_session_reset();
}
/* }}} */
@@ -2145,7 +2145,7 @@ static PHP_FUNCTION(session_register_shutdown)
ZVAL_STRING(&shutdown_function_entry.arguments[0], "session_write_close");
- if (!append_user_shutdown_function(shutdown_function_entry TSRMLS_CC)) {
+ if (!append_user_shutdown_function(shutdown_function_entry)) {
zval_ptr_dtor(&shutdown_function_entry.arguments[0]);
efree(shutdown_function_entry.arguments);
@@ -2155,8 +2155,8 @@ static PHP_FUNCTION(session_register_shutdown)
* If the user does have a later shutdown function which needs the
* session then tough luck.
*/
- php_session_flush(TSRMLS_C);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to register session flush function");
+ php_session_flush();
+ php_error_docref(NULL, E_WARNING, "Unable to register session flush function");
}
}
/* }}} */
@@ -2311,16 +2311,16 @@ static const zend_function_entry php_session_class_functions[] = {
* Module Setup and Destruction *
******************************** */
-static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
+static int php_rinit_session(zend_bool auto_start) /* {{{ */
{
- php_rinit_session_globals(TSRMLS_C);
+ php_rinit_session_globals();
if (PS(mod) == NULL) {
char *value;
value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0);
if (value) {
- PS(mod) = _php_find_ps_module(value TSRMLS_CC);
+ PS(mod) = _php_find_ps_module(value);
}
}
@@ -2329,7 +2329,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
value = zend_ini_string("session.serialize_handler", sizeof("session.serialize_handler") - 1, 0);
if (value) {
- PS(serializer) = _php_find_ps_serializer(value TSRMLS_CC);
+ PS(serializer) = _php_find_ps_serializer(value);
}
}
@@ -2340,7 +2340,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
}
if (auto_start) {
- php_session_start(TSRMLS_C);
+ php_session_start();
}
return SUCCESS;
@@ -2348,7 +2348,7 @@ static int php_rinit_session(zend_bool auto_start TSRMLS_DC) /* {{{ */
static PHP_RINIT_FUNCTION(session) /* {{{ */
{
- return php_rinit_session(PS(auto_start) TSRMLS_CC);
+ return php_rinit_session(PS(auto_start));
}
/* }}} */
@@ -2357,9 +2357,9 @@ static PHP_RSHUTDOWN_FUNCTION(session) /* {{{ */
int i;
zend_try {
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} zend_end_try();
- php_rshutdown_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
/* this should NOT be done in php_rshutdown_session_globals() */
for (i = 0; i < 7; i++) {
@@ -2402,7 +2402,7 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
{
zend_class_entry ce;
- zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL TSRMLS_CC);
+ zend_register_auto_global(zend_string_init("_SESSION", sizeof("_SESSION") - 1, 1), 0, NULL);
PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */
@@ -2417,18 +2417,18 @@ static PHP_MINIT_FUNCTION(session) /* {{{ */
/* Register interfaces */
INIT_CLASS_ENTRY(ce, PS_IFACE_NAME, php_session_iface_functions);
- php_session_iface_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_session_iface_entry = zend_register_internal_class(&ce);
php_session_iface_entry->ce_flags |= ZEND_ACC_INTERFACE;
INIT_CLASS_ENTRY(ce, PS_SID_IFACE_NAME, php_session_id_iface_functions);
- php_session_id_iface_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_session_id_iface_entry = zend_register_internal_class(&ce);
php_session_id_iface_entry->ce_flags |= ZEND_ACC_INTERFACE;
/* Register base class */
INIT_CLASS_ENTRY(ce, PS_CLASS_NAME, php_session_class_functions);
- php_session_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
- zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_iface_entry);
- zend_class_implements(php_session_class_entry TSRMLS_CC, 1, php_session_id_iface_entry);
+ php_session_class_entry = zend_register_internal_class(&ce);
+ zend_class_implements(php_session_class_entry, 1, php_session_iface_entry);
+ zend_class_implements(php_session_class_entry, 1, php_session_id_iface_entry);
REGISTER_LONG_CONSTANT("PHP_SESSION_DISABLED", php_session_disabled, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_SESSION_NONE", php_session_none, CONST_CS | CONST_PERSISTENT);
@@ -2519,7 +2519,7 @@ static const zend_module_dep session_deps[] = { /* {{{ */
* Upload hook handling *
************************ */
-static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress) /* {{{ */
{
zval *ppid;
@@ -2537,12 +2537,12 @@ static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_pr
return 0;
} /* }}} */
-static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress) /* {{{ */
{
if (PS(use_cookies)) {
- sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);
- if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress TSRMLS_CC)) {
+ sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
+ if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress)) {
progress->apply_trans_sid = 0;
return;
}
@@ -2550,11 +2550,11 @@ static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *pro
if (PS(use_only_cookies)) {
return;
}
- sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);
- early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress TSRMLS_CC);
+ sapi_module.treat_data(PARSE_GET, NULL, NULL);
+ early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress);
} /* }}} */
-static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress) /* {{{ */
{
zval *progress_ary, *cancel_upload;
@@ -2570,7 +2570,7 @@ static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress
return Z_TYPE_P(cancel_upload) == IS_TRUE;
} /* }}} */
-static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update) /* {{{ */
{
if (!force_update) {
if (Z_LVAL_P(progress->post_bytes_processed) < progress->next_update) {
@@ -2591,33 +2591,33 @@ static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, i
progress->next_update = Z_LVAL_P(progress->post_bytes_processed) + progress->update_step;
}
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
PS(session_status) = php_session_active;
IF_SESSION_VARS() {
- progress->cancel_upload |= php_check_cancel_upload(progress TSRMLS_CC);
+ progress->cancel_upload |= php_check_cancel_upload(progress);
if (Z_REFCOUNTED(progress->data)) Z_ADDREF(progress->data);
zend_hash_update(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.s, &progress->data);
}
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} /* }}} */
-static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
+static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress) /* {{{ */
{
- php_session_initialize(TSRMLS_C);
+ php_session_initialize();
PS(session_status) = php_session_active;
IF_SESSION_VARS() {
zend_hash_del(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.s);
}
- php_session_flush(TSRMLS_C);
+ php_session_flush();
} /* }}} */
-static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra TSRMLS_DC) /* {{{ */
+static int php_session_rfc1867_callback(unsigned int event, void *event_data, void **extra) /* {{{ */
{
php_session_rfc1867_progress *progress;
int retval = SUCCESS;
if (php_session_rfc1867_orig_callback) {
- retval = php_session_rfc1867_orig_callback(event, event_data, extra TSRMLS_CC);
+ retval = php_session_rfc1867_orig_callback(event, event_data, extra);
}
if (!PS(rfc1867_enabled)) {
return retval;
@@ -2662,7 +2662,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
smart_str_0(&progress->key);
progress->apply_trans_sid = PS(use_trans_sid);
- php_session_rfc1867_early_find_sid(progress TSRMLS_CC);
+ php_session_rfc1867_early_find_sid(progress);
}
}
}
@@ -2690,7 +2690,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
array_init(&progress->data);
array_init(&progress->files);
- add_assoc_long_ex(&progress->data, "start_time", sizeof("start_time") - 1, (zend_long)sapi_get_request_time(TSRMLS_C));
+ add_assoc_long_ex(&progress->data, "start_time", sizeof("start_time") - 1, (zend_long)sapi_get_request_time());
add_assoc_long_ex(&progress->data, "content_length", sizeof("content_length") - 1, progress->content_length);
add_assoc_long_ex(&progress->data, "bytes_processed", sizeof("bytes_processed") - 1, data->post_bytes_processed);
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 0);
@@ -2698,7 +2698,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
progress->post_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->data), "bytes_processed", sizeof("bytes_processed") - 1);
- php_rinit_session(0 TSRMLS_CC);
+ php_rinit_session(0);
PS(id) = zend_string_init(Z_STRVAL(progress->sid), Z_STRLEN(progress->sid), 0);
PS(apply_trans_sid) = progress->apply_trans_sid;
PS(send_cookie) = 0;
@@ -2721,7 +2721,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
progress->current_file_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->current_file), "bytes_processed", sizeof("bytes_processed") - 1);
Z_LVAL_P(progress->current_file_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_FILE_DATA: {
@@ -2734,7 +2734,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
Z_LVAL_P(progress->current_file_bytes_processed) = data->offset + data->length;
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_FILE_END: {
@@ -2753,7 +2753,7 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 0 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 0);
}
break;
case MULTIPART_EVENT_END: {
@@ -2761,13 +2761,13 @@ static int php_session_rfc1867_callback(unsigned int event, void *event_data, vo
if (Z_TYPE(progress->sid) && progress->key.s) {
if (PS(rfc1867_cleanup)) {
- php_session_rfc1867_cleanup(progress TSRMLS_CC);
+ php_session_rfc1867_cleanup(progress);
} else {
add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 1);
Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
- php_session_rfc1867_update(progress, 1 TSRMLS_CC);
+ php_session_rfc1867_update(progress, 1);
}
- php_rshutdown_session_globals(TSRMLS_C);
+ php_rshutdown_session_globals();
}
if (!Z_ISUNDEF(progress->data)) {
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index 4bf9d7dedf..276fbed533 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -113,7 +113,7 @@ ZEND_GET_MODULE(shmop)
/* {{{ rsclean
*/
-static void rsclean(zend_resource *rsrc TSRMLS_DC)
+static void rsclean(zend_resource *rsrc)
{
struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr;
@@ -152,12 +152,12 @@ PHP_FUNCTION(shmop_open)
char *flags;
size_t flags_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsll", &key, &flags, &flags_len, &mode, &size) == FAILURE) {
return;
}
if (flags_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid flag", flags);
+ php_error_docref(NULL, E_WARNING, "%s is not a valid flag", flags);
RETURN_FALSE;
}
@@ -187,29 +187,29 @@ PHP_FUNCTION(shmop_open)
*/
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid access mode");
+ php_error_docref(NULL, E_WARNING, "invalid access mode");
goto err;
}
if (shmop->shmflg & IPC_CREAT && shmop->size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Shared memory segment size must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Shared memory segment size must be greater than zero");
goto err;
}
shmop->shmid = shmget(shmop->key, shmop->size, shmop->shmflg);
if (shmop->shmid == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach or create shared memory segment '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to attach or create shared memory segment '%s'", strerror(errno));
goto err;
}
if (shmctl(shmop->shmid, IPC_STAT, &shm)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to get shared memory segment information '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to get shared memory segment information '%s'", strerror(errno));
goto err;
}
shmop->addr = shmat(shmop->shmid, 0, shmop->shmatflg);
if (shmop->addr == (char*) -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to attach to shared memory segment '%s'", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to attach to shared memory segment '%s'", strerror(errno));
goto err;
}
@@ -233,19 +233,19 @@ PHP_FUNCTION(shmop_read)
int bytes;
zend_string *return_string;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &shmid, &start, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &shmid, &start, &count) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if (start < 0 || start > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "start is out of range");
+ php_error_docref(NULL, E_WARNING, "start is out of range");
RETURN_FALSE;
}
if (count < 0 || start > (INT_MAX - count) || start + count > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "count is out of range");
+ php_error_docref(NULL, E_WARNING, "count is out of range");
RETURN_FALSE;
}
@@ -265,7 +265,7 @@ PHP_FUNCTION(shmop_close)
zend_long shmid;
zval *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
@@ -283,7 +283,7 @@ PHP_FUNCTION(shmop_size)
zend_long shmid;
struct php_shmop *shmop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
@@ -302,19 +302,19 @@ PHP_FUNCTION(shmop_write)
zend_long shmid, offset;
zend_string *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lSl", &shmid, &data, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lSl", &shmid, &data, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "trying to write to a read only segment");
+ php_error_docref(NULL, E_WARNING, "trying to write to a read only segment");
RETURN_FALSE;
}
if (offset < 0 || offset > shmop->size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "offset out of range");
+ php_error_docref(NULL, E_WARNING, "offset out of range");
RETURN_FALSE;
}
@@ -332,14 +332,14 @@ PHP_FUNCTION(shmop_delete)
zend_long shmid;
struct php_shmop *shmop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &shmid) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &shmid) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(shmop, struct php_shmop *, NULL, shmid, "shmop", shm_type);
if (shmctl(shmop->shmid, IPC_RMID, NULL)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't mark segment for deletion (are you the owner?)");
+ php_error_docref(NULL, E_WARNING, "can't mark segment for deletion (are you the owner?)");
RETURN_FALSE;
}
diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h
index 82e5aff9e4..f531ba2fa5 100644
--- a/ext/simplexml/php_simplexml_exports.h
+++ b/ext/simplexml/php_simplexml_exports.h
@@ -35,11 +35,11 @@
__n = (__s)->node->node; \
} else { \
__n = NULL; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \
+ php_error_docref(NULL, E_WARNING, "Node no longer exists"); \
} \
}
-PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce TSRMLS_DC);
+PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce);
static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ {
return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo));
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 361b0824eb..692b5d368a 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -51,24 +51,24 @@ PHP_SXE_API zend_class_entry *sxe_get_element_class_entry() /* {{{ */
#define SXE_METHOD(func) PHP_METHOD(simplexml_element, func)
-static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC);
-static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRMLS_DC);
-static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data TSRMLS_DC);
-static zval *sxe_get_value(zval *z, zval *rv TSRMLS_DC);
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC);
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC);
-static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC);
-static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC);
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC);
+static php_sxe_object* php_sxe_object_new(zend_class_entry *ce);
+static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data);
+static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data);
+static zval *sxe_get_value(zval *z, zval *rv);
+static void php_sxe_iterator_dtor(zend_object_iterator *iter);
+static int php_sxe_iterator_valid(zend_object_iterator *iter);
+static zval *php_sxe_iterator_current_data(zend_object_iterator *iter);
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key);
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter);
+static void php_sxe_iterator_rewind(zend_object_iterator *iter);
/* {{{ _node_as_zval()
*/
-static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, const xmlChar *nsprefix, int isprefix TSRMLS_DC)
+static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, const xmlChar *nsprefix, int isprefix)
{
php_sxe_object *subnode;
- subnode = php_sxe_object_new(sxe->zo.ce TSRMLS_CC);
+ subnode = php_sxe_object_new(sxe->zo.ce);
subnode->document = sxe->document;
subnode->document->refcount++;
subnode->iter.type = itertype;
@@ -80,7 +80,7 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
subnode->iter.isprefix = isprefix;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL);
ZVAL_OBJ(value, &subnode->zo);
}
@@ -102,17 +102,17 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
__n = (__s)->node->node; \
} else { \
__n = NULL; \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Node no longer exists"); \
+ php_error_docref(NULL, E_WARNING, "Node no longer exists"); \
} \
}
-static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) /* {{{ */
{
php_sxe_object *intern;
xmlNodePtr retnode = NULL;
if (sxe && sxe->iter.type != SXE_ITER_NONE) {
- php_sxe_reset_iterator(sxe, 1 TSRMLS_CC);
+ php_sxe_reset_iterator(sxe, 1);
if (!Z_ISUNDEF(sxe->iter.data)) {
intern = Z_SXEOBJ_P(&sxe->iter.data);
GET_NODE(intern, retnode)
@@ -175,7 +175,7 @@ next_iter:
}
/* }}} */
-static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name TSRMLS_DC) /* {{{ */
+static xmlNodePtr sxe_find_element_by_name(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) /* {{{ */
{
while (node) {
SKIP_TEXT(node)
@@ -190,7 +190,7 @@ next_iter:
return NULL;
} /* }}} */
-static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char **name, SXE_ITER *type TSRMLS_DC) /* {{{ */
+static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node, char **name, SXE_ITER *type) /* {{{ */
{
int orgtype;
xmlNodePtr orgnode = node;
@@ -202,12 +202,12 @@ static xmlNodePtr sxe_get_element_by_name(php_sxe_object *sxe, xmlNodePtr node,
if (sxe->iter.type == SXE_ITER_NONE) {
sxe->iter.type = SXE_ITER_CHILD;
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
sxe->iter.type = orgtype;
}
if (sxe->iter.type == SXE_ITER_ELEMENT) {
- orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name TSRMLS_CC);
+ orgnode = sxe_find_element_by_name(sxe, node, sxe->iter.name);
if (!orgnode) {
return NULL;
}
@@ -243,7 +243,7 @@ next_iter:
/* {{{ sxe_prop_dim_read()
*/
-static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, zend_bool attribs, int type, zval *rv TSRMLS_DC)
+static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, zend_bool attribs, int type, zval *rv)
{
php_sxe_object *sxe;
char *name;
@@ -261,7 +261,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
elements = 1;
} else if (!member) {
/* This happens when the user did: $sxe[]->foo = $value */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return NULL;
}
name = NULL;
@@ -278,17 +278,17 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
if (!member && node && node->parent &&
node->parent->type == XML_DOCUMENT_NODE) {
/* This happens when the user did: $sxe[]->foo = $value */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return NULL;
}
}
@@ -302,7 +302,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
while (attr && nodendx <= Z_LVAL_P(member)) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
- _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
break;
}
nodendx++;
@@ -312,7 +312,7 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
} else {
while (attr) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)name) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
- _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, (xmlNodePtr) attr, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
break;
}
attr = attr->next;
@@ -323,18 +323,18 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
if (elements) {
if (!sxe->node) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, node, NULL);
}
if (!member || Z_TYPE_P(member) == IS_LONG) {
zend_long cnt = 0;
xmlNodePtr mynode = node;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
if (sxe->iter.type == SXE_ITER_NONE) {
if (member && Z_LVAL_P(member) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
}
} else if (member) {
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, &cnt);
@@ -342,25 +342,25 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
node = NULL;
}
if (node) {
- _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
} else if (type == BP_VAR_W || type == BP_VAR_RW) {
if (member && cnt < Z_LVAL_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
}
node = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, NULL);
- _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_NONE, NULL, sxe->iter.nsprefix, sxe->iter.isprefix);
}
} else {
#if SXE_ELEMENT_BY_NAME
int newtype;
GET_NODE(sxe, node);
- node = sxe_get_element_by_name(sxe, node, &name, &newtype TSRMLS_CC);
+ node = sxe_get_element_by_name(sxe, node, &name, &newtype);
if (node) {
- _node_as_zval(sxe, node, rv, newtype, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, newtype, name, sxe->iter.nsprefix, sxe->iter.isprefix);
}
#else
- _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, rv, SXE_ITER_ELEMENT, name, sxe->iter.nsprefix, sxe->iter.isprefix);
#endif
}
}
@@ -380,23 +380,23 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z
/* {{{ sxe_property_read()
*/
-static zval *sxe_property_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+static zval *sxe_property_read(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
- return sxe_prop_dim_read(object, member, 1, 0, type, rv TSRMLS_CC);
+ return sxe_prop_dim_read(object, member, 1, 0, type, rv);
}
/* }}} */
/* {{{ sxe_dimension_read()
*/
-static zval *sxe_dimension_read(zval *object, zval *offset, int type, zval *rv TSRMLS_DC)
+static zval *sxe_dimension_read(zval *object, zval *offset, int type, zval *rv)
{
- return sxe_prop_dim_read(object, offset, 0, 1, type, rv TSRMLS_CC);
+ return sxe_prop_dim_read(object, offset, 0, 1, type, rv);
}
/* }}} */
/* {{{ change_node_zval()
*/
-static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
+static void change_node_zval(xmlNodePtr node, zval *value)
{
zval value_copy;
xmlChar *buffer;
@@ -433,7 +433,7 @@ static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "It is not possible to assign complex types to nodes");
+ php_error_docref(NULL, E_WARNING, "It is not possible to assign complex types to nodes");
break;
}
}
@@ -441,7 +441,7 @@ static void change_node_zval(xmlNodePtr node, zval *value TSRMLS_DC)
/* {{{ sxe_property_write()
*/
-static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode TSRMLS_DC)
+static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool elements, zend_bool attribs, xmlNodePtr *pnewnode)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -469,19 +469,19 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return FAILURE;
}
} else {
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_STR(&trim_zv, zval_get_string(member));
- php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, &tmp_zv, 3 TSRMLS_CC);
+ php_trim(Z_STRVAL(trim_zv), Z_STRLEN(trim_zv), NULL, 0, &tmp_zv, 3);
zval_dtor(&trim_zv);
member = &tmp_zv;
}
if (!Z_STRLEN_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element");
+ php_error_docref(NULL, E_WARNING, "Cannot write or create unnamed %s", attribs ? "attribute" : "element");
if (member == &tmp_zv) {
zval_dtor(&tmp_zv);
}
@@ -494,12 +494,12 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
mynode = node;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
if (!member && node && node->parent &&
@@ -508,7 +508,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
* and could also be E_PARSE, but we use this only during parsing
* and this is during runtime.
*/
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create unnamed attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create unnamed attribute");
return FAILURE;
}
if (attribs && !node && sxe->iter.type == SXE_ITER_ELEMENT) {
@@ -538,7 +538,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
case IS_OBJECT:
if (Z_OBJCE_P(value) == sxe_class_entry) {
//???
- value = sxe_get_value(value, &zval_copy TSRMLS_CC);
+ value = sxe_get_value(value, &zval_copy);
//INIT_PZVAL(value);
new_value = 1;
break;
@@ -583,7 +583,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
if (elements) {
if (!member || Z_TYPE_P(member) == IS_LONG) {
if (node->type == XML_ATTRIBUTE_NODE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot create duplicate attribute");
+ php_error_docref(NULL, E_ERROR, "Cannot create duplicate attribute");
return FAILURE;
}
@@ -591,7 +591,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool
newnode = node;
++counter;
if (member && Z_LVAL_P(member) > 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only 0 such elements exist", mynode->name, Z_LVAL_P(member));
retval = FAILURE;
}
} else if (member) {
@@ -623,12 +623,12 @@ next_iter:
if (value) {
while ((tempnode = (xmlNodePtr) newnode->children)) {
xmlUnlinkNode(tempnode);
- php_libxml_node_free_resource((xmlNodePtr) tempnode TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) tempnode);
}
- change_node_zval(newnode, value TSRMLS_CC);
+ change_node_zval(newnode, value);
}
} else if (counter > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
+ php_error_docref(NULL, E_WARNING, "Cannot assign to an array of nodes (duplicate subnodes or attr detected)");
retval = FAILURE;
} else if (elements) {
if (!node) {
@@ -639,14 +639,14 @@ next_iter:
}
} else if (!member || Z_TYPE_P(member) == IS_LONG) {
if (member && cnt < Z_LVAL_P(member)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
+ php_error_docref(NULL, E_WARNING, "Cannot add element %s number %pd when only %pd such elements exist", mynode->name, Z_LVAL_P(member), cnt);
retval = FAILURE;
}
newnode = xmlNewTextChild(mynode->parent, mynode->ns, mynode->name, value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
}
} else if (attribs) {
if (Z_TYPE_P(member) == IS_LONG) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot change attribute number %pd when only %d attributes exist", Z_LVAL_P(member), nodendx);
+ php_error_docref(NULL, E_WARNING, "Cannot change attribute number %pd when only %d attributes exist", Z_LVAL_P(member), nodendx);
retval = FAILURE;
} else {
newnode = (xmlNodePtr)xmlNewProp(node, (xmlChar *)Z_STRVAL_P(member), value ? (xmlChar *)Z_STRVAL_P(value) : NULL);
@@ -669,21 +669,21 @@ next_iter:
/* {{{ sxe_property_write()
*/
-static void sxe_property_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+static void sxe_property_write(zval *object, zval *member, zval *value, void **cache_slot)
{
- sxe_prop_dim_write(object, member, value, 1, 0, NULL TSRMLS_CC);
+ sxe_prop_dim_write(object, member, value, 1, 0, NULL);
}
/* }}} */
/* {{{ sxe_dimension_write()
*/
-static void sxe_dimension_write(zval *object, zval *offset, zval *value TSRMLS_DC)
+static void sxe_dimension_write(zval *object, zval *offset, zval *value)
{
- sxe_prop_dim_write(object, offset, value, 0, 1, NULL TSRMLS_CC);
+ sxe_prop_dim_write(object, offset, value, 0, 1, NULL);
}
/* }}} */
-static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, void **cache_slot) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -696,17 +696,17 @@ static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, vo
GET_NODE(sxe, node);
convert_to_string(member);
name = Z_STRVAL_P(member);
- node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC);
+ node = sxe_get_element_by_name(sxe, node, &name, &type);
if (node) {
return NULL;
}
- if (sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC) != SUCCESS) {
+ if (sxe_prop_dim_write(object, member, NULL, 1, 0, &node) != SUCCESS) {
return NULL;
}
type = SXE_ITER_NONE;
name = NULL;
- _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, &ret, type, name, sxe->iter.nsprefix, sxe->iter.isprefix);
sxe = Z_SXEOBJ_P(&ret);
if (!Z_ISUNDEF(sxe->tmp)) {
@@ -722,7 +722,7 @@ static zval *sxe_property_get_adr(zval *object, zval *member, int fetch_type, vo
/* {{{ sxe_prop_dim_exists()
*/
-static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs TSRMLS_DC)
+static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend_bool elements, zend_bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -745,7 +745,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
attribs = 0;
elements = 1;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
}
}
@@ -753,11 +753,11 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
}
@@ -797,7 +797,7 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
if (elements) {
if (Z_TYPE_P(member) == IS_LONG) {
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL);
}
@@ -833,23 +833,23 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend
/* {{{ sxe_property_exists()
*/
-static int sxe_property_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC)
+static int sxe_property_exists(zval *object, zval *member, int check_empty, void **cache_slot)
{
- return sxe_prop_dim_exists(object, member, check_empty, 1, 0 TSRMLS_CC);
+ return sxe_prop_dim_exists(object, member, check_empty, 1, 0);
}
/* }}} */
/* {{{ sxe_property_exists()
*/
-static int sxe_dimension_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
+static int sxe_dimension_exists(zval *object, zval *member, int check_empty)
{
- return sxe_prop_dim_exists(object, member, check_empty, 0, 1 TSRMLS_CC);
+ return sxe_prop_dim_exists(object, member, check_empty, 0, 1);
}
/* }}} */
/* {{{ sxe_prop_dim_delete()
*/
-static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, zend_bool attribs TSRMLS_DC)
+static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, zend_bool attribs)
{
php_sxe_object *sxe;
xmlNodePtr node;
@@ -873,7 +873,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
attribs = 0;
elements = 1;
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
}
}
@@ -881,11 +881,11 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
attribs = 1;
elements = 0;
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = (xmlAttrPtr)node;
test = sxe->iter.name != NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
attr = node ? node->properties : NULL;
test = 0;
}
@@ -899,7 +899,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
if (nodendx == Z_LVAL_P(member)) {
xmlUnlinkNode((xmlNodePtr) attr);
- php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) attr);
break;
}
nodendx++;
@@ -911,7 +911,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
anext = attr->next;
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && !xmlStrcmp(attr->name, (xmlChar *)Z_STRVAL_P(member)) && match_ns(sxe, (xmlNodePtr) attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
xmlUnlinkNode((xmlNodePtr) attr);
- php_libxml_node_free_resource((xmlNodePtr) attr TSRMLS_CC);
+ php_libxml_node_free_resource((xmlNodePtr) attr);
break;
}
attr = anext;
@@ -922,12 +922,12 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (elements) {
if (Z_TYPE_P(member) == IS_LONG) {
if (sxe->iter.type == SXE_ITER_CHILD) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
node = sxe_get_element_by_offset(sxe, Z_LVAL_P(member), node, NULL);
if (node) {
xmlUnlinkNode(node);
- php_libxml_node_free_resource(node TSRMLS_CC);
+ php_libxml_node_free_resource(node);
}
} else {
node = node->children;
@@ -938,7 +938,7 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements,
if (!xmlStrcmp(node->name, (xmlChar *)Z_STRVAL_P(member))) {
xmlUnlinkNode(node);
- php_libxml_node_free_resource(node TSRMLS_CC);
+ php_libxml_node_free_resource(node);
}
next_iter:
@@ -956,21 +956,21 @@ next_iter:
/* {{{ sxe_property_delete()
*/
-static void sxe_property_delete(zval *object, zval *member, void **cache_slot TSRMLS_DC)
+static void sxe_property_delete(zval *object, zval *member, void **cache_slot)
{
- sxe_prop_dim_delete(object, member, 1, 0 TSRMLS_CC);
+ sxe_prop_dim_delete(object, member, 1, 0);
}
/* }}} */
/* {{{ sxe_dimension_unset()
*/
-static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC)
+static void sxe_dimension_delete(zval *object, zval *offset)
{
- sxe_prop_dim_delete(object, offset, 0, 1 TSRMLS_CC);
+ sxe_prop_dim_delete(object, offset, 0, 1);
}
/* }}} */
-static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine TSRMLS_DC) /* {{{ */
+static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine) /* {{{ */
{
xmlChar *tmp = xmlNodeListGetString(doc, list, inLine);
zend_string *res;
@@ -988,7 +988,7 @@ static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr li
/* {{{ _get_base_node_value()
*/
-static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, xmlChar *nsprefix, int isprefix TSRMLS_DC)
+static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval *value, xmlChar *nsprefix, int isprefix)
{
php_sxe_object *subnode;
xmlChar *contents;
@@ -1000,14 +1000,14 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
xmlFree(contents);
}
} else {
- subnode = php_sxe_object_new(sxe_ref->zo.ce TSRMLS_CC);
+ subnode = php_sxe_object_new(sxe_ref->zo.ce);
subnode->document = sxe_ref->document;
subnode->document->refcount++;
if (nsprefix && *nsprefix) {
subnode->iter.nsprefix = xmlStrdup((xmlChar *)nsprefix);
subnode->iter.isprefix = isprefix;
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL);
ZVAL_OBJ(value, &subnode->zo);
/*zval_add_ref(value);*/
@@ -1015,7 +1015,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
}
/* }}} */
-static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *value TSRMLS_DC) /* {{{ */
+static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *value) /* {{{ */
{
zval *data_ptr;
zval newptr;
@@ -1040,7 +1040,7 @@ static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *val
}
/* }}} */
-static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ */
+static HashTable *sxe_get_prop_hash(zval *object, int is_debug) /* {{{ */
{
zval value;
zval zattr;
@@ -1076,7 +1076,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
}
if (is_debug || sxe->iter.type != SXE_ITER_CHILD) {
if (sxe->iter.type == SXE_ITER_ELEMENT) {
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
}
if (!node || node->type != XML_ENTITY_DECL) {
attr = node ? (xmlAttrPtr)node->properties : NULL;
@@ -1084,11 +1084,11 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
while (attr) {
if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1));
namelen = xmlStrlen(attr->name);
if (Z_ISUNDEF(zattr)) {
array_init(&zattr);
- sxe_properties_add(rv, "@attributes", sizeof("@attributes") - 1, &zattr TSRMLS_CC);
+ sxe_properties_add(rv, "@attributes", sizeof("@attributes") - 1, &zattr);
}
add_assoc_zval_ex(&zattr, (char*)attr->name, namelen, &value);
}
@@ -1098,11 +1098,11 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
}
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node && sxe->iter.type != SXE_ITER_ATTRLIST) {
if (node->type == XML_ATTRIBUTE_NODE) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1));
zend_hash_next_index_insert(rv, &value);
node = NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
@@ -1113,7 +1113,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data);
ZVAL_UNDEF(&sxe->iter.data);
- node = php_sxe_reset_iterator(sxe, 0 TSRMLS_CC);
+ node = php_sxe_reset_iterator(sxe, 0);
use_iter = 1;
}
@@ -1127,7 +1127,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
const xmlChar *cur = node->content;
if (*cur != 0) {
- ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1 TSRMLS_CC));
+ ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1));
zend_hash_next_index_insert(rv, &value);
}
goto next_iter;
@@ -1145,16 +1145,16 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{
namelen = xmlStrlen(node->name);
}
- _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC);
+ _get_base_node_value(sxe, node, &value, sxe->iter.nsprefix, sxe->iter.isprefix);
if ( use_iter ) {
zend_hash_next_index_insert(rv, &value);
} else {
- sxe_properties_add(rv, name, namelen, &value TSRMLS_CC);
+ sxe_properties_add(rv, name, namelen, &value);
}
next_iter:
if (use_iter) {
- node = php_sxe_iterator_fetch(sxe, node->next, 0 TSRMLS_CC);
+ node = php_sxe_iterator_fetch(sxe, node->next, 0);
} else {
node = node->next;
}
@@ -1172,7 +1172,7 @@ next_iter:
}
/* }}} */
-static HashTable *sxe_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ {
+static HashTable *sxe_get_gc(zval *object, zval **table, int *n) /* {{{ */ {
php_sxe_object *sxe;
sxe = Z_SXEOBJ_P(object);
@@ -1182,20 +1182,20 @@ static HashTable *sxe_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{
}
/* }}} */
-static HashTable *sxe_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *sxe_get_properties(zval *object) /* {{{ */
{
- return sxe_get_prop_hash(object, 0 TSRMLS_CC);
+ return sxe_get_prop_hash(object, 0);
}
/* }}} */
-static HashTable * sxe_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable * sxe_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
*is_temp = 1;
- return sxe_get_prop_hash(object, 1 TSRMLS_CC);
+ return sxe_get_prop_hash(object, 1);
}
/* }}} */
-static int sxe_objects_compare(zval *object1, zval *object2 TSRMLS_DC) /* {{{ */
+static int sxe_objects_compare(zval *object1, zval *object2) /* {{{ */
{
php_sxe_object *sxe1;
php_sxe_object *sxe2;
@@ -1231,7 +1231,7 @@ SXE_METHOD(xpath)
xmlNodeSetPtr result;
xmlNodePtr nodeptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) {
return;
}
@@ -1245,13 +1245,13 @@ SXE_METHOD(xpath)
sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
}
if (!sxe->node) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL);
if (!sxe->node) {
RETURN_FALSE;
}
}
- nodeptr = php_sxe_get_first_node(sxe, sxe->node->node TSRMLS_CC);
+ nodeptr = php_sxe_get_first_node(sxe, sxe->node->node);
sxe->xpath->node = nodeptr;
@@ -1290,11 +1290,11 @@ SXE_METHOD(xpath)
* to the parent node.
*/
if (nodeptr->type == XML_TEXT_NODE) {
- _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_NONE, NULL, NULL, 0);
} else if (nodeptr->type == XML_ATTRIBUTE_NODE) {
- _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, nodeptr->ns ? (xmlChar *)nodeptr->ns->href : NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr->parent, &value, SXE_ITER_ATTRLIST, (char*)nodeptr->name, nodeptr->ns ? (xmlChar *)nodeptr->ns->href : NULL, 0);
} else {
- _node_as_zval(sxe, nodeptr, &value, SXE_ITER_NONE, NULL, NULL, 0 TSRMLS_CC);
+ _node_as_zval(sxe, nodeptr, &value, SXE_ITER_NONE, NULL, NULL, 0);
}
add_next_index_zval(return_value, &value);
@@ -1314,7 +1314,7 @@ SXE_METHOD(registerXPathNamespace)
size_t prefix_len, ns_uri_len;
char *prefix, *ns_uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
@@ -1348,13 +1348,13 @@ SXE_METHOD(asXML)
}
if (ZEND_NUM_ARGS() == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
@@ -1383,7 +1383,7 @@ SXE_METHOD(asXML)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->parent && (XML_DOCUMENT_NODE == node->parent->type)) {
@@ -1424,7 +1424,7 @@ static inline void sxe_add_namespace_name(zval *return_value, xmlNsPtr ns) /* {{
}
/* }}} */
-static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value TSRMLS_DC) /* {{{ */
+static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
{
xmlAttrPtr attr;
@@ -1444,7 +1444,7 @@ static void sxe_add_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool r
node = node->children;
while (node) {
if (node->type == XML_ELEMENT_NODE) {
- sxe_add_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_namespaces(sxe, node, recursive, return_value);
}
node = node->next;
}
@@ -1459,7 +1459,7 @@ SXE_METHOD(getNamespaces)
php_sxe_object *sxe;
xmlNodePtr node;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &recursive) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) {
return;
}
@@ -1467,11 +1467,11 @@ SXE_METHOD(getNamespaces)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
if (node->type == XML_ELEMENT_NODE) {
- sxe_add_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_namespaces(sxe, node, recursive, return_value);
} else if (node->type == XML_ATTRIBUTE_NODE && node->ns) {
sxe_add_namespace_name(return_value, node->ns);
}
@@ -1479,7 +1479,7 @@ SXE_METHOD(getNamespaces)
}
/* }}} */
-static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value TSRMLS_DC) /* {{{ */
+static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node, zend_bool recursive, zval *return_value) /* {{{ */
{
xmlNsPtr ns;
@@ -1492,7 +1492,7 @@ static void sxe_add_registered_namespaces(php_sxe_object *sxe, xmlNodePtr node,
if (recursive) {
node = node->children;
while (node) {
- sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_registered_namespaces(sxe, node, recursive, return_value);
node = node->next;
}
}
@@ -1508,7 +1508,7 @@ SXE_METHOD(getDocNamespaces)
php_sxe_object *sxe;
xmlNodePtr node;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &recursive, &from_root) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bb", &recursive, &from_root) == FAILURE) {
return;
}
@@ -1524,7 +1524,7 @@ SXE_METHOD(getDocNamespaces)
}
array_init(return_value);
- sxe_add_registered_namespaces(sxe, node, recursive, return_value TSRMLS_CC);
+ sxe_add_registered_namespaces(sxe, node, recursive, return_value);
}
/* }}} */
@@ -1538,7 +1538,7 @@ SXE_METHOD(children)
xmlNodePtr node;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1549,9 +1549,9 @@ SXE_METHOD(children)
}
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
- _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_CHILD, NULL, (xmlChar *)nsprefix, isprefix);
}
/* }}} */
@@ -1567,7 +1567,7 @@ SXE_METHOD(getName)
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node) {
namelen = xmlStrlen(node->name);
RETURN_STRINGL((char*)node->name, namelen);
@@ -1587,7 +1587,7 @@ SXE_METHOD(attributes)
xmlNodePtr node;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &nsprefix, &nsprefix_len, &isprefix) == FAILURE) {
return;
}
@@ -1598,9 +1598,9 @@ SXE_METHOD(attributes)
return; /* attributes don't have attributes */
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
- _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, return_value, SXE_ITER_ATTRLIST, NULL, (xmlChar *)nsprefix, isprefix);
}
/* }}} */
@@ -1615,13 +1615,13 @@ SXE_METHOD(addChild)
xmlNsPtr nsptr = NULL;
xmlChar *localname, *prefix = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
return;
}
if (qname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
+ php_error_docref(NULL, E_WARNING, "Element name is required");
return;
}
@@ -1629,14 +1629,14 @@ SXE_METHOD(addChild)
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to attributes");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to attributes");
return;
}
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree");
+ php_error_docref(NULL, E_WARNING, "Cannot add child. Parent is not a permanent member of the XML tree");
return;
}
@@ -1660,7 +1660,7 @@ SXE_METHOD(addChild)
}
}
- _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char *)localname, prefix, 0 TSRMLS_CC);
+ _node_as_zval(sxe, newnode, return_value, SXE_ITER_NONE, (char *)localname, prefix, 0);
xmlFree(localname);
if (prefix != NULL) {
@@ -1681,27 +1681,27 @@ SXE_METHOD(addAttribute)
xmlNsPtr nsptr = NULL;
xmlChar *localname, *prefix = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s!",
&qname, &qname_len, &value, &value_len, &nsuri, &nsuri_len) == FAILURE) {
return;
}
if (qname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute name is required");
return;
}
sxe = Z_SXEOBJ_P(getThis());
GET_NODE(sxe, node);
- node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, node);
if (node && node->type != XML_ELEMENT_NODE) {
node = node->parent;
}
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate parent Element");
+ php_error_docref(NULL, E_WARNING, "Unable to locate parent Element");
return;
}
@@ -1711,7 +1711,7 @@ SXE_METHOD(addAttribute)
if (prefix != NULL) {
xmlFree(prefix);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute requires prefix for namespace");
+ php_error_docref(NULL, E_WARNING, "Attribute requires prefix for namespace");
return;
}
localname = xmlStrdup((xmlChar *)qname);
@@ -1723,7 +1723,7 @@ SXE_METHOD(addAttribute)
if (prefix != NULL) {
xmlFree(prefix);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute already exists");
+ php_error_docref(NULL, E_WARNING, "Attribute already exists");
return;
}
@@ -1745,7 +1745,7 @@ SXE_METHOD(addAttribute)
/* {{{ cast_object()
*/
-static int cast_object(zval *object, int type, char *contents TSRMLS_DC)
+static int cast_object(zval *object, int type, char *contents)
{
if (contents) {
ZVAL_STRINGL(object, contents, strlen(contents));
@@ -1777,7 +1777,7 @@ static int cast_object(zval *object, int type, char *contents TSRMLS_DC)
/* {{{ sxe_object_cast()
*/
-static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type)
{
php_sxe_object *sxe;
xmlChar *contents = NULL;
@@ -1788,8 +1788,8 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
sxe = Z_SXEOBJ_P(readobj);
if (type == _IS_BOOL) {
- node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
- prop_hash = sxe_get_prop_hash(readobj, 1 TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, NULL);
+ prop_hash = sxe_get_prop_hash(readobj, 1);
ZVAL_BOOL(writeobj, node != NULL || zend_hash_num_elements(prop_hash) > 0);
zend_hash_destroy(prop_hash);
efree(prop_hash);
@@ -1797,14 +1797,14 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
}
if (sxe->iter.type != SXE_ITER_NONE) {
- node = php_sxe_get_first_node(sxe, NULL TSRMLS_CC);
+ node = php_sxe_get_first_node(sxe, NULL);
if (node) {
contents = xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, node->children, 1);
}
} else {
if (!sxe->node) {
if (sxe->document) {
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement((xmlDocPtr) sxe->document->ptr), NULL);
}
}
@@ -1819,7 +1819,7 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
zval_ptr_dtor(readobj);
}
- rv = cast_object(writeobj, type, (char *)contents TSRMLS_CC);
+ rv = cast_object(writeobj, type, (char *)contents);
if (contents) {
xmlFree(contents);
@@ -1830,15 +1830,15 @@ static int sxe_object_cast_ex(zval *readobj, zval *writeobj, int type TSRMLS_DC)
/* }}} */
/* Variant of sxe_object_cast_ex that handles overwritten __toString() method */
-static int sxe_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int sxe_object_cast(zval *readobj, zval *writeobj, int type)
{
if (type == IS_STRING
- && zend_std_cast_object_tostring(readobj, writeobj, IS_STRING TSRMLS_CC) == SUCCESS
+ && zend_std_cast_object_tostring(readobj, writeobj, IS_STRING) == SUCCESS
) {
return SUCCESS;
}
- return sxe_object_cast_ex(readobj, writeobj, type TSRMLS_CC);
+ return sxe_object_cast_ex(readobj, writeobj, type);
}
/* {{{ proto object SimpleXMLElement::__toString() U
@@ -1847,7 +1847,7 @@ SXE_METHOD(__toString)
{
zval result;
- if (sxe_object_cast_ex(getThis(), &result, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (sxe_object_cast_ex(getThis(), &result, IS_STRING) == SUCCESS) {
RETURN_ZVAL(&result, 0, 0);
} else {
zval_ptr_dtor(&result);
@@ -1856,7 +1856,7 @@ SXE_METHOD(__toString)
}
/* }}} */
-static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count TSRMLS_DC) /* {{{ */
+static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count) /* {{{ */
{
xmlNodePtr node;
zval data;
@@ -1866,12 +1866,12 @@ static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count T
ZVAL_COPY_VALUE(&data, &sxe->iter.data);
ZVAL_UNDEF(&sxe->iter.data);
- node = php_sxe_reset_iterator(sxe, 0 TSRMLS_CC);
+ node = php_sxe_reset_iterator(sxe, 0);
while (node)
{
(*count)++;
- node = php_sxe_iterator_fetch(sxe, node->next, 0 TSRMLS_CC);
+ node = php_sxe_iterator_fetch(sxe, node->next, 0);
}
if (!Z_ISUNDEF(sxe->iter.data)) {
@@ -1883,7 +1883,7 @@ static int php_sxe_count_elements_helper(php_sxe_object *sxe, zend_long *count T
}
/* }}} */
-static int sxe_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int sxe_count_elements(zval *object, zend_long *count) /* {{{ */
{
php_sxe_object *intern;
intern = Z_SXEOBJ_P(object);
@@ -1901,7 +1901,7 @@ static int sxe_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ *
}
return FAILURE;
}
- return php_sxe_count_elements_helper(intern, count TSRMLS_CC);
+ return php_sxe_count_elements_helper(intern, count);
}
/* }}} */
@@ -1916,15 +1916,15 @@ SXE_METHOD(count)
return;
}
- php_sxe_count_elements_helper(sxe, &count TSRMLS_CC);
+ php_sxe_count_elements_helper(sxe, &count);
RETURN_LONG(count);
}
/* }}} */
-static zval *sxe_get_value(zval *z, zval *rv TSRMLS_DC) /* {{{ */
+static zval *sxe_get_value(zval *z, zval *rv) /* {{{ */
{
- if (sxe_object_cast_ex(z, rv, IS_STRING TSRMLS_CC) == FAILURE) {
+ if (sxe_object_cast_ex(z, rv, IS_STRING) == FAILURE) {
zend_error(E_ERROR, "Unable to cast node to string");
/* FIXME: Should not be fatal */
}
@@ -1963,14 +1963,14 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */
/* {{{ sxe_object_clone()
*/
static zend_object *
-sxe_object_clone(zval *object TSRMLS_DC)
+sxe_object_clone(zval *object)
{
php_sxe_object *sxe = Z_SXEOBJ_P(object);
php_sxe_object *clone;
xmlNodePtr nodep = NULL;
xmlDocPtr docp = NULL;
- clone = php_sxe_object_new(sxe->zo.ce TSRMLS_CC);
+ clone = php_sxe_object_new(sxe->zo.ce);
clone->document = sxe->document;
if (clone->document) {
clone->document->refcount++;
@@ -1990,7 +1990,7 @@ sxe_object_clone(zval *object TSRMLS_DC)
nodep = xmlDocCopyNode(sxe->node->node, docp, 1);
}
- php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, NULL TSRMLS_CC);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)clone, nodep, NULL);
return &clone->zo;
}
@@ -1998,7 +1998,7 @@ sxe_object_clone(zval *object TSRMLS_DC)
/* {{{ sxe_object_dtor()
*/
-static void sxe_object_dtor(zend_object *object TSRMLS_DC)
+static void sxe_object_dtor(zend_object *object)
{
/* dtor required to cleanup iterator related data properly */
php_sxe_object *sxe;
@@ -2027,15 +2027,15 @@ static void sxe_object_dtor(zend_object *object TSRMLS_DC)
/* {{{ sxe_object_free_storage()
*/
-static void sxe_object_free_storage(zend_object *object TSRMLS_DC)
+static void sxe_object_free_storage(zend_object *object)
{
php_sxe_object *sxe;
sxe = php_sxe_fetch_object(object);
- zend_object_std_dtor(&sxe->zo TSRMLS_CC);
+ zend_object_std_dtor(&sxe->zo);
- php_libxml_node_decrement_resource((php_libxml_node_object *)sxe TSRMLS_CC);
+ php_libxml_node_decrement_resource((php_libxml_node_object *)sxe);
if (sxe->xpath) {
xmlXPathFreeContext(sxe->xpath);
@@ -2050,7 +2050,7 @@ static void sxe_object_free_storage(zend_object *object TSRMLS_DC)
/* {{{ php_sxe_object_new()
*/
-static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
+static php_sxe_object* php_sxe_object_new(zend_class_entry *ce)
{
php_sxe_object *intern;
zend_class_entry *parent = ce;
@@ -2063,7 +2063,7 @@ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
intern->iter.name = NULL;
intern->fptr_count = NULL;
- zend_object_std_init(&intern->zo, ce TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce);
intern->zo.handlers = &sxe_object_handlers;
@@ -2090,11 +2090,11 @@ static php_sxe_object* php_sxe_object_new(zend_class_entry *ce TSRMLS_DC)
/* {{{ sxe_object_new()
*/
PHP_SXE_API zend_object *
-sxe_object_new(zend_class_entry *ce TSRMLS_DC)
+sxe_object_new(zend_class_entry *ce)
{
php_sxe_object *intern;
- intern = php_sxe_object_new(ce TSRMLS_CC);
+ intern = php_sxe_object_new(ce);
return &intern->zo;
}
/* }}} */
@@ -2113,7 +2113,7 @@ PHP_FUNCTION(simplexml_load_file)
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|C!lsb", &filename, &filename_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -2126,11 +2126,11 @@ PHP_FUNCTION(simplexml_load_file)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
ZVAL_OBJ(return_value, &sxe->zo);
}
@@ -2150,7 +2150,7 @@ PHP_FUNCTION(simplexml_load_string)
zend_class_entry *ce= sxe_class_entry;
zend_bool isprefix = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|C!lsb", &data, &data_len, &ce, &options, &ns, &ns_len, &isprefix) == FAILURE) {
return;
}
@@ -2163,11 +2163,11 @@ PHP_FUNCTION(simplexml_load_string)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
ZVAL_OBJ(return_value, &sxe->zo);
}
@@ -2185,26 +2185,26 @@ SXE_METHOD(__construct)
zend_bool is_url = 0, isprefix = 0;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lbsb", &data, &data_len, &options, &is_url, &ns, &ns_len, &isprefix) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
docp = is_url ? xmlReadFile(data, NULL, options) : xmlReadMemory(data, data_len, NULL, NULL, options);
if (!docp) {
((php_libxml_node_object *)sxe)->document = NULL;
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "String could not be parsed as XML", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0);
return;
}
sxe->iter.nsprefix = ns_len ? xmlStrdup((xmlChar *)ns) : NULL;
sxe->iter.isprefix = isprefix;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL);
}
/* }}} */
@@ -2218,7 +2218,7 @@ zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */
};
/* }}} */
-static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_iterator_fetch(php_sxe_object *sxe, xmlNodePtr node, int use_data) /* {{{ */
{
xmlChar *prefix = sxe->iter.nsprefix;
int isprefix = sxe->iter.isprefix;
@@ -2241,14 +2241,14 @@ next_iter:
}
if (node && use_data) {
- _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix TSRMLS_CC);
+ _node_as_zval(sxe, node, &sxe->iter.data, SXE_ITER_NONE, NULL, prefix, isprefix);
}
return node;
}
/* }}} */
-static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRMLS_DC) /* {{{ */
+static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data) /* {{{ */
{
xmlNodePtr node;
@@ -2269,13 +2269,13 @@ static xmlNodePtr php_sxe_reset_iterator(php_sxe_object *sxe, int use_data TSRML
case SXE_ITER_ATTRLIST:
node = (xmlNodePtr) node->properties;
}
- return php_sxe_iterator_fetch(sxe, node, use_data TSRMLS_CC);
+ return php_sxe_iterator_fetch(sxe, node, use_data);
}
return NULL;
}
/* }}} */
-zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
php_sxe_iterator *iterator;
@@ -2283,7 +2283,7 @@ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, i
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
iterator = emalloc(sizeof(php_sxe_iterator));
- zend_iterator_init(&iterator->intern TSRMLS_CC);
+ zend_iterator_init(&iterator->intern);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &php_sxe_iterator_funcs;
@@ -2293,7 +2293,7 @@ zend_object_iterator *php_sxe_get_iterator(zend_class_entry *ce, zval *object, i
}
/* }}} */
-static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_dtor(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2304,7 +2304,7 @@ static void php_sxe_iterator_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int php_sxe_iterator_valid(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2312,7 +2312,7 @@ static int php_sxe_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *php_sxe_iterator_current_data(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
@@ -2320,7 +2320,7 @@ static zval *php_sxe_iterator_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
zval *curobj = &iterator->sxe->iter.data;
@@ -2339,7 +2339,7 @@ static void php_sxe_iterator_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /* {{{ */
+PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe) /* {{{ */
{
xmlNodePtr node = NULL;
php_sxe_object *intern;
@@ -2352,37 +2352,37 @@ PHP_SXE_API void php_sxe_move_forward_iterator(php_sxe_object *sxe TSRMLS_DC) /*
}
if (node) {
- php_sxe_iterator_fetch(sxe, node->next, 1 TSRMLS_CC);
+ php_sxe_iterator_fetch(sxe, node->next, 1);
}
}
/* }}} */
-static void php_sxe_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_move_forward(zend_object_iterator *iter) /* {{{ */
{
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
- php_sxe_move_forward_iterator(iterator->sxe TSRMLS_CC);
+ php_sxe_move_forward_iterator(iterator->sxe);
}
/* }}} */
-static void php_sxe_iterator_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void php_sxe_iterator_rewind(zend_object_iterator *iter) /* {{{ */
{
php_sxe_object *sxe;
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
sxe = iterator->sxe;
- php_sxe_reset_iterator(sxe, 1 TSRMLS_CC);
+ php_sxe_reset_iterator(sxe, 1);
}
/* }}} */
-void *simplexml_export_node(zval *object TSRMLS_DC) /* {{{ */
+void *simplexml_export_node(zval *object) /* {{{ */
{
php_sxe_object *sxe;
xmlNodePtr node;
sxe = Z_SXEOBJ_P(object);
GET_NODE(sxe, node);
- return php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ return php_sxe_get_first_node(sxe, node);
}
/* }}} */
@@ -2396,17 +2396,17 @@ PHP_FUNCTION(simplexml_import_dom)
xmlNodePtr nodep = NULL;
zend_class_entry *ce = sxe_class_entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|C!", &node, &ce) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|C!", &node, &ce) == FAILURE) {
return;
}
object = Z_LIBXML_NODE_P(node);
- nodep = php_libxml_import_node(node TSRMLS_CC);
+ nodep = php_libxml_import_node(node);
if (nodep) {
if (nodep->doc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Imported Node must have associated Document");
+ php_error_docref(NULL, E_WARNING, "Imported Node must have associated Document");
RETURN_NULL();
}
if (nodep->type == XML_DOCUMENT_NODE || nodep->type == XML_HTML_DOCUMENT_NODE) {
@@ -2418,14 +2418,14 @@ PHP_FUNCTION(simplexml_import_dom)
if (!ce) {
ce = sxe_class_entry;
}
- sxe = php_sxe_object_new(ce TSRMLS_CC);
+ sxe = php_sxe_object_new(ce);
sxe->document = object->document;
- php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep->doc TSRMLS_CC);
- php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, nodep, NULL TSRMLS_CC);
+ php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep->doc);
+ php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, nodep, NULL);
ZVAL_OBJ(return_value, &sxe->zo);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Nodetype to import");
+ php_error_docref(NULL, E_WARNING, "Invalid Nodetype to import");
RETVAL_NULL();
}
}
@@ -2561,10 +2561,10 @@ PHP_MINIT_FUNCTION(simplexml)
INIT_CLASS_ENTRY(sxe, "SimpleXMLElement", sxe_functions);
sxe.create_object = sxe_object_new;
- sxe_class_entry = zend_register_internal_class(&sxe TSRMLS_CC);
+ sxe_class_entry = zend_register_internal_class(&sxe);
sxe_class_entry->get_iterator = php_sxe_get_iterator;
sxe_class_entry->iterator_funcs.funcs = &php_sxe_iterator_funcs;
- zend_class_implements(sxe_class_entry TSRMLS_CC, 1, zend_ce_traversable);
+ zend_class_implements(sxe_class_entry, 1, zend_ce_traversable);
sxe_object_handlers.offset = XtOffsetOf(php_sxe_object, zo);
sxe_object_handlers.dtor_obj = sxe_object_dtor;
sxe_object_handlers.free_obj = sxe_object_free_storage;
diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c
index 27d1e9b0f2..19ef49a785 100644
--- a/ext/simplexml/sxe.c
+++ b/ext/simplexml/sxe.c
@@ -47,7 +47,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
}
iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter TSRMLS_CC);
+ ce_SimpleXMLElement->iterator_funcs.funcs->rewind((zend_object_iterator*)&iter);
}
/* }}} */
@@ -120,7 +120,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
}
iter.sxe = Z_SXEOBJ_P(getThis());
- ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter TSRMLS_CC);
+ ce_SimpleXMLElement->iterator_funcs.funcs->move_forward((zend_object_iterator*)&iter);
}
/* }}} */
@@ -199,11 +199,11 @@ PHP_MINIT_FUNCTION(sxe) /* {{{ */
ce_SimpleXMLElement = pce;
INIT_CLASS_ENTRY_EX(sxi, "SimpleXMLIterator", sizeof("SimpleXMLIterator") - 1, funcs_SimpleXMLIterator);
- ce_SimpleXMLIterator = zend_register_internal_class_ex(&sxi, ce_SimpleXMLElement TSRMLS_CC);
+ ce_SimpleXMLIterator = zend_register_internal_class_ex(&sxi, ce_SimpleXMLElement);
ce_SimpleXMLIterator->create_object = ce_SimpleXMLElement->create_object;
- zend_class_implements(ce_SimpleXMLIterator TSRMLS_CC, 1, spl_ce_RecursiveIterator);
- zend_class_implements(ce_SimpleXMLIterator TSRMLS_CC, 1, spl_ce_Countable);
+ zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_RecursiveIterator);
+ zend_class_implements(ce_SimpleXMLIterator, 1, spl_ce_Countable);
return SUCCESS;
}
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index 5103ba82fc..ba49b0d31a 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -39,7 +39,7 @@ PHP_FUNCTION(confirm_extname_compiled)
size_t arg_len, len;
char *strg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index 610fff11c7..f9315a825f 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -104,8 +104,8 @@ static inline php_snmp_object *php_snmp_fetch_object(zend_object *obj) {
#define Z_SNMP_P(zv) php_snmp_fetch_object(Z_OBJ_P((zv)))
-typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval *retval TSRMLS_DC);
-typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object, zval *newval TSRMLS_DC);
+typedef int (*php_snmp_read_t)(php_snmp_object *snmp_object, zval *retval);
+typedef int (*php_snmp_write_t)(php_snmp_object *snmp_object, zval *newval);
typedef struct _ptp_snmp_prop_handler {
const char *name;
@@ -133,7 +133,7 @@ ZEND_END_MODULE_GLOBALS(snmp)
#endif
#define REGISTER_SNMP_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(php_snmp_ce, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(php_snmp_ce, const_name, sizeof(const_name)-1, (zend_long)value);
#else
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 90c1bff951..4f42cac2d0 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -103,7 +103,7 @@ typedef struct snmp_session php_snmp_session;
int i = 0; \
while (b[i].name != NULL) { \
php_snmp_add_property((a), (b)[i].name, (b)[i].name_length, \
- (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func TSRMLS_CC); \
+ (php_snmp_read_t)(b)[i].read_func, (php_snmp_write_t)(b)[i].write_func); \
i++; \
} \
}
@@ -467,14 +467,14 @@ static void netsnmp_session_free(php_snmp_session **session) /* {{{ */
}
/* }}} */
-static void php_snmp_session_destructor(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+static void php_snmp_session_destructor(zend_resource *rsrc) /* {{{ */
{
php_snmp_session *session = (php_snmp_session *)rsrc->ptr;
netsnmp_session_free(&session);
}
/* }}} */
-static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_snmp_object_free_storage(zend_object *object) /* {{{ */
{
php_snmp_object *intern = php_snmp_fetch_object(object);
@@ -484,18 +484,18 @@ static void php_snmp_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
netsnmp_session_free(&(intern->session));
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_snmp_object_new(zend_class_entry *class_type) /* {{{ */
{
php_snmp_object *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_snmp_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &php_snmp_object_handlers;
@@ -510,7 +510,7 @@ static zend_object *php_snmp_object_new(zend_class_entry *class_type TSRMLS_DC)
* Record last SNMP-related error in object
*
*/
-static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...)
+static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object = NULL;
@@ -532,10 +532,10 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type,
}
if (object && (snmp_object->exceptions_enabled & type)) {
- zend_throw_exception_ex(php_snmp_exception_ce, type TSRMLS_CC, snmp_object->snmp_errstr);
+ zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr);
} else {
va_start(args, format);
- php_verror(docref, "", E_WARNING, format, args TSRMLS_CC);
+ php_verror(docref, "", E_WARNING, format, args);
va_end(args);
}
}
@@ -547,7 +547,7 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type,
* SNMP value to zval converter
*
*/
-static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_DC, int valueretrieval)
+static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval, int valueretrieval)
{
zval val;
char sbuf[512];
@@ -565,7 +565,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
*buf = '\0';
if (snprint_value(buf, buflen, vars->name, vars->name_length, vars) == -1) {
if (val_len > 512*1024) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?");
+ php_error_docref(NULL, E_WARNING, "snprint_value() asks for a buffer more than 512k, Net-SNMP bug?");
break;
}
/* buffer is not long enough to hold full output, double it */
@@ -581,7 +581,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
}
if (!dbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
buf = &(sbuf[0]);
buflen = sizeof(sbuf) - 1;
break;
@@ -596,7 +596,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
buf = dbuf;
buflen = val_len;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed: %s, fallback to static buffer", strerror(errno));
}
}
@@ -670,7 +670,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D
default:
ZVAL_STRING(&val, "Unknown value type");
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value type: %u", vars->type);
+ php_error_docref(NULL, E_WARNING, "Unknown value type: %u", vars->type);
break;
}
} else /* use Net-SNMP value translation */ {
@@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
RETVAL_FALSE;
/* reset errno and errstr */
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_NOERROR, "");
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_NOERROR, "");
if (st & SNMP_CMD_WALK) { /* remember root OID */
memmove((char *)root, (char *)(objid_query->vars[0].name), (objid_query->vars[0].name_length) * sizeof(oid));
@@ -729,14 +729,14 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
if ((ss = snmp_open(session)) == NULL) {
snmp_error(session, NULL, NULL, &err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open snmp connection: %s", err);
+ php_error_docref(NULL, E_WARNING, "Could not open snmp connection: %s", err);
free(err);
RETVAL_FALSE;
return;
}
if ((st & SNMP_CMD_SET) && objid_query->count > objid_query->step) {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries");
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_MULTIPLE_SET_QUERIES, "Can not fit all OIDs for SET query into one packet, using multiple queries");
}
while (keepwalking) {
@@ -759,7 +759,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
pdu = snmp_pdu_create(SNMP_MSG_SET);
} else {
snmp_close(ss);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown SNMP command (internals)");
+ php_error_docref(NULL, E_ERROR, "Unknown SNMP command (internals)");
RETVAL_FALSE;
return;
}
@@ -767,7 +767,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
if (st & SNMP_CMD_SET) {
if ((snmp_errno = snmp_add_var(pdu, objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value))) {
snprint_objid(buf, sizeof(buf), objid_query->vars[objid_query->offset].name, objid_query->vars[objid_query->offset].name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Could not add variable: OID='%s' type='%c' value='%s': %s", buf, objid_query->vars[objid_query->offset].type, objid_query->vars[objid_query->offset].value, snmp_api_errstring(snmp_errno));
snmp_free_pdu(pdu);
snmp_close(ss);
RETVAL_FALSE;
@@ -809,7 +809,7 @@ retry:
}
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
snprint_value(buf2, sizeof(buf2), vars->name, vars->name_length, vars);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2);
continue;
}
@@ -828,7 +828,7 @@ retry:
}
ZVAL_NULL(&snmpval);
- php_snmp_getvalue(vars, &snmpval TSRMLS_CC, objid_query->valueretrieval);
+ php_snmp_getvalue(vars, &snmpval, objid_query->valueretrieval);
if (objid_query->array_output) {
if (Z_TYPE_P(return_value) == IS_TRUE || Z_TYPE_P(return_value) == IS_FALSE) {
@@ -849,7 +849,7 @@ retry:
add_assoc_zval(return_value, objid_query->vars[count].oid, &snmpval);
} else {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find original OID name for '%s'", buf2);
+ php_error_docref(NULL, E_WARNING, "Could not find original OID name for '%s'", buf2);
}
} else if (st & SNMP_USE_SUFFIX_AS_KEYS && st & SNMP_CMD_WALK) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
@@ -877,7 +877,7 @@ retry:
if (st & SNMP_CMD_WALK) {
if (objid_query->oid_increasing_check == TRUE && snmp_oid_compare(objid_query->vars[0].name, objid_query->vars[0].name_length, vars->name, vars->name_length) >= 0) {
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
keepwalking = 0;
} else {
memmove((char *)(objid_query->vars[0].name), (char *)vars->name, vars->name_length * sizeof(oid));
@@ -910,9 +910,9 @@ retry:
}
if (vars) {
snprint_objid(buf, sizeof(buf), vars->name, vars->name_length);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, snmp_errstring(response->errstat));
} else {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat));
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at %u object_id: %s", response->errindex, snmp_errstring(response->errstat));
}
if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT)) { /* cut out bogus OID and retry */
if ((pdu = snmp_fix_pdu(response, ((st & SNMP_CMD_GET) ? SNMP_MSG_GET : SNMP_MSG_GETNEXT) )) != NULL) {
@@ -930,7 +930,7 @@ retry:
}
}
} else if (status == STAT_TIMEOUT) {
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_TIMEOUT, "No response from %s", session->peername);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
}
@@ -939,7 +939,7 @@ retry:
return;
} else { /* status == STAT_ERROR */
snmp_error(ss, NULL, NULL, &err);
- php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err);
+ php_snmp_error(getThis(), NULL, PHP_SNMP_ERRNO_GENERIC, "Fatal error: %s", err);
free(err);
if (objid_query->array_output) {
zval_ptr_dtor(return_value);
@@ -961,7 +961,7 @@ retry:
* OID parser (and type, value for SNMP_SET command)
*/
-static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value TSRMLS_DC)
+static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zval *oid, zval *type, zval *value)
{
char *pptr;
HashPosition pos_oid, pos_type, pos_value;
@@ -1007,7 +1007,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if (Z_TYPE_P(oid) == IS_STRING) {
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
if (objid_query->vars == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
@@ -1015,7 +1015,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
if (Z_STRLEN_P(type) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type));
+ php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %u", Z_STRVAL_P(type), Z_STRLEN_P(type));
efree(objid_query->vars);
return FALSE;
}
@@ -1023,7 +1023,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].type = *pptr;
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Single objid and multiple type or values are not supported");
+ php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported");
efree(objid_query->vars);
return FALSE;
}
@@ -1031,12 +1031,12 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->count++;
} else if (Z_TYPE_P(oid) == IS_ARRAY) { /* we got objid array */
if (zend_hash_num_elements(Z_ARRVAL_P(oid)) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got empty OID array");
+ php_error_docref(NULL, E_WARNING, "Got empty OID array");
return FALSE;
}
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_P(oid)));
if (objid_query->vars == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno));
efree(objid_query->vars);
return FALSE;
}
@@ -1055,7 +1055,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
if ((tmp_type = zend_hash_get_current_data_ex(Z_ARRVAL_P(type), &pos_type)) != NULL) {
convert_to_string_ex(tmp_type);
if (Z_STRLEN_P(tmp_type) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
+ php_error_docref(NULL, E_WARNING, "'%s': bogus type '%s', should be single char, got %u", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
efree(objid_query->vars);
return FALSE;
}
@@ -1063,7 +1063,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].type = *pptr;
zend_hash_move_forward_ex(Z_ARRVAL_P(type), &pos_type);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid));
+ php_error_docref(NULL, E_WARNING, "'%s': no type set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
@@ -1077,7 +1077,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value);
zend_hash_move_forward_ex(Z_ARRVAL_P(value), &pos_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid));
+ php_error_docref(NULL, E_WARNING, "'%s': no value set", Z_STRVAL_P(tmp_oid));
efree(objid_query->vars);
return FALSE;
}
@@ -1090,14 +1090,14 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
/* now parse all OIDs */
if (st & SNMP_CMD_WALK) {
if (objid_query->count > 1) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!");
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Multi OID walks are not supported!");
efree(objid_query->vars);
return FALSE;
}
objid_query->vars[0].name_length = MAX_NAME_LEN;
if (strlen(objid_query->vars[0].oid)) { /* on a walk, an empty string means top of tree - no error */
if (!snmp_parse_oid(objid_query->vars[0].oid, objid_query->vars[0].name, &(objid_query->vars[0].name_length))) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid);
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[0].oid);
efree(objid_query->vars);
return FALSE;
}
@@ -1109,7 +1109,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
for (objid_query->offset = 0; objid_query->offset < objid_query->count; objid_query->offset++) {
objid_query->vars[objid_query->offset].name_length = MAX_OID_LEN;
if (!snmp_parse_oid(objid_query->vars[objid_query->offset].oid, objid_query->vars[objid_query->offset].name, &(objid_query->vars[objid_query->offset].name_length))) {
- php_snmp_error(object, NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid);
+ php_snmp_error(object, NULL, PHP_SNMP_ERRNO_OID_PARSING_ERROR, "Invalid object identifier: %s", objid_query->vars[objid_query->offset].oid);
efree(objid_query->vars);
return FALSE;
}
@@ -1124,7 +1124,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
/* {{{ netsnmp_session_init
allocates memory for session and session->peername, caller should free it manually using netsnmp_session_free() and efree()
*/
-static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries TSRMLS_DC)
+static int netsnmp_session_init(php_snmp_session **session_p, int version, char *hostname, char *community, int timeout, int retries)
{
php_snmp_session *session;
char *pptr, *host_ptr;
@@ -1136,7 +1136,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
*session_p = (php_snmp_session *)emalloc(sizeof(php_snmp_session));
session = *session_p;
if (session == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed allocating session");
+ php_error_docref(NULL, E_WARNING, "emalloc() failed allocating session");
return (-1);
}
memset(session, 0, sizeof(php_snmp_session));
@@ -1148,7 +1148,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
session->peername = emalloc(MAX_NAME_LEN);
if (session->peername == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while copying hostname");
+ php_error_docref(NULL, E_WARNING, "emalloc() failed while copying hostname");
return (-1);
}
/* we copy original hostname for further processing */
@@ -1165,7 +1165,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
}
*pptr = '\0';
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "malformed IPv6 address, closing square bracket missing");
+ php_error_docref(NULL, E_WARNING, "malformed IPv6 address, closing square bracket missing");
return (-1);
}
} else { /* IPv4 address */
@@ -1177,7 +1177,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
/* since Net-SNMP library requires 'udp6:' prefix for all IPv6 addresses (in FQDN form too) we need to
perform possible name resolution before running any SNMP queries */
- if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL TSRMLS_CC)) == 0) { /* some resolver error */
+ if ((n = php_network_getaddresses(host_ptr, SOCK_DGRAM, &psal, NULL)) == 0) { /* some resolver error */
/* warnings sent, bailing out */
return (-1);
}
@@ -1214,7 +1214,7 @@ static int netsnmp_session_init(php_snmp_session **session_p, int version, char
}
if (strlen(session->peername) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown failure while resolving '%s'", hostname);
+ php_error_docref(NULL, E_WARNING, "Unknown failure while resolving '%s'", hostname);
return (-1);
}
/* XXX FIXME
@@ -1264,7 +1264,7 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
/* {{{ int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
Set the authentication protocol in the snmpv3 session */
-static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
+static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "MD5")) {
s->securityAuthProto = usmHMACMD5AuthProtocol;
@@ -1273,7 +1273,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot
s->securityAuthProto = usmHMACSHA1AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown authentication protocol '%s'", prot);
+ php_error_docref(NULL, E_WARNING, "Unknown authentication protocol '%s'", prot);
return (-1);
}
return (0);
@@ -1282,7 +1282,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot
/* {{{ int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
Set the security protocol in the snmpv3 session */
-static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
+static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
{
if (!strcasecmp(prot, "DES")) {
s->securityPrivProto = usmDESPrivProtocol;
@@ -1293,7 +1293,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
s->securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown security protocol '%s'", prot);
+ php_error_docref(NULL, E_WARNING, "Unknown security protocol '%s'", prot);
return (-1);
}
return (0);
@@ -1302,14 +1302,14 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T
/* {{{ int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
Make key from pass phrase in the snmpv3 session */
-static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRMLS_DC)
+static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *) pass, strlen(pass),
s->securityAuthKey, &(s->securityAuthKeyLen)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
+ php_error_docref(NULL, E_WARNING, "Error generating a key for authentication pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-1);
}
return (0);
@@ -1318,7 +1318,7 @@ static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRML
/* {{{ int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
Make key from pass phrase in the snmpv3 session */
-static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS_DC)
+static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass)
{
int snmp_errno;
@@ -1326,7 +1326,7 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS
if ((snmp_errno = generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
(u_char *)pass, strlen(pass),
s->securityPrivKey, &(s->securityPrivKeyLen)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
+ php_error_docref(NULL, E_WARNING, "Error generating a key for privacy pass phrase '%s': %s", pass, snmp_api_errstring(snmp_errno));
return (-2);
}
return (0);
@@ -1335,17 +1335,17 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, char *pass TSRMLS
/* {{{ in netsnmp_session_set_contextEngineID(struct snmp_session *s, u_char * contextEngineID)
Set context Engine Id in the snmpv3 session */
-static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID TSRMLS_DC)
+static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * contextEngineID)
{
size_t ebuf_len = 32, eout_len = 0;
u_char *ebuf = (u_char *) emalloc(ebuf_len);
if (ebuf == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "malloc failure setting contextEngineID");
+ php_error_docref(NULL, E_WARNING, "malloc failure setting contextEngineID");
return (-1);
}
if (!snmp_hex_to_binary(&ebuf, &ebuf_len, &eout_len, 1, contextEngineID)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad engine ID value '%s'", contextEngineID);
+ php_error_docref(NULL, E_WARNING, "Bad engine ID value '%s'", contextEngineID);
efree(ebuf);
return (-1);
}
@@ -1362,38 +1362,38 @@ static int netsnmp_session_set_contextEngineID(struct snmp_session *s, char * co
/* {{{ php_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
Set all snmpv3-related security options */
-static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID TSRMLS_DC)
+static int netsnmp_session_set_security(struct snmp_session *session, char *sec_level, char *auth_protocol, char *auth_passphrase, char *priv_protocol, char *priv_passphrase, char *contextName, char *contextEngineID)
{
/* Setting the security level. */
if (netsnmp_session_set_sec_level(session, sec_level)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level '%s'", sec_level);
+ php_error_docref(NULL, E_WARNING, "Invalid security level '%s'", sec_level);
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHNOPRIV || session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the authentication protocol. */
- if (netsnmp_session_set_auth_protocol(session, auth_protocol TSRMLS_CC)) {
+ if (netsnmp_session_set_auth_protocol(session, auth_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the authentication passphrase. */
- if (netsnmp_session_gen_auth_key(session, auth_passphrase TSRMLS_CC)) {
+ if (netsnmp_session_gen_auth_key(session, auth_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
if (session->securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) {
/* Setting the security protocol. */
- if (netsnmp_session_set_sec_protocol(session, priv_protocol TSRMLS_CC)) {
+ if (netsnmp_session_set_sec_protocol(session, priv_protocol)) {
/* Warning message sent already, just bail out */
return (-1);
}
/* Setting the security protocol passphrase. */
- if (netsnmp_session_gen_sec_key(session, priv_passphrase TSRMLS_CC)) {
+ if (netsnmp_session_gen_sec_key(session, priv_passphrase)) {
/* Warning message sent already, just bail out */
return (-1);
}
@@ -1407,7 +1407,7 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_
}
/* Setting contextEngineIS if specified */
- if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID TSRMLS_CC)) {
+ if (contextEngineID && strlen(contextEngineID) && netsnmp_session_set_contextEngineID(session, contextEngineID)) {
/* Warning message sent already, just bail out */
return (-1);
}
@@ -1446,7 +1446,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
if (session_less_mode) {
if (version == SNMP_VERSION_3) {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "ssssssszzz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
@@ -1455,14 +1455,14 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "sssssssz|ll", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
+ if (zend_parse_parameters(argc, "sszzz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &type, &value, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
} else {
@@ -1470,25 +1470,25 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
* SNMP_CMD_GETNEXT
* SNMP_CMD_WALK
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
+ if (zend_parse_parameters(argc, "ssz|ll", &a1, &a1_len, &a2, &a2_len, &oid, &timeout, &retries) == FAILURE) {
RETURN_FALSE;
}
}
}
} else {
if (st & SNMP_CMD_SET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "zzz", &oid, &type, &value) == FAILURE) {
+ if (zend_parse_parameters(argc, "zzz", &oid, &type, &value) == FAILURE) {
RETURN_FALSE;
}
} else if (st & SNMP_CMD_WALK) {
- if (zend_parse_parameters(argc TSRMLS_CC, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|bll", &oid, &suffix_keys, &(objid_query.max_repetitions), &(objid_query.non_repeaters)) == FAILURE) {
RETURN_FALSE;
}
if (suffix_keys) {
st |= SNMP_USE_SUFFIX_AS_KEYS;
}
} else if (st & SNMP_CMD_GET) {
- if (zend_parse_parameters(argc TSRMLS_CC, "z|b", &oid, &use_orignames) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|b", &oid, &use_orignames) == FAILURE) {
RETURN_FALSE;
}
if (use_orignames) {
@@ -1497,23 +1497,23 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
} else {
/* SNMP_CMD_GETNEXT
*/
- if (zend_parse_parameters(argc TSRMLS_CC, "z", &oid) == FAILURE) {
+ if (zend_parse_parameters(argc, "z", &oid) == FAILURE) {
RETURN_FALSE;
}
}
}
- if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value TSRMLS_CC)) {
+ if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid, type, value)) {
RETURN_FALSE;
}
if (session_less_mode) {
- if (netsnmp_session_init(&session, version, a1, a2, timeout, retries TSRMLS_CC)) {
+ if (netsnmp_session_init(&session, version, a1, a2, timeout, retries)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
RETURN_FALSE;
}
- if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL TSRMLS_CC)) {
+ if (version == SNMP_VERSION_3 && netsnmp_session_set_security(session, a3, a4, a5, a6, a7, NULL, NULL)) {
efree(objid_query.vars);
netsnmp_session_free(&session);
/* Warning message sent already, just bail out */
@@ -1524,7 +1524,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
snmp_object = Z_SNMP_P(object);
session = snmp_object->session;
if (!session) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or uninitialized SNMP object");
+ php_error_docref(NULL, E_WARNING, "Invalid or uninitialized SNMP object");
efree(objid_query.vars);
RETURN_FALSE;
}
@@ -1621,7 +1621,7 @@ PHP_FUNCTION(snmp_set_quick_print)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1636,7 +1636,7 @@ PHP_FUNCTION(snmp_set_enum_print)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1651,7 +1651,7 @@ PHP_FUNCTION(snmp_set_oid_output_format)
{
zend_long a1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &a1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
RETURN_FALSE;
}
@@ -1666,7 +1666,7 @@ PHP_FUNCTION(snmp_set_oid_output_format)
RETURN_TRUE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1);
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%d'", (int) a1);
RETURN_FALSE;
break;
}
@@ -1759,7 +1759,7 @@ PHP_FUNCTION(snmp_set_valueretrieval)
{
zend_long method;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &method) == FAILURE) {
RETURN_FALSE;
}
@@ -1767,7 +1767,7 @@ PHP_FUNCTION(snmp_set_valueretrieval)
SNMP_G(valueretrieval) = method;
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method);
RETURN_FALSE;
}
}
@@ -1792,13 +1792,13 @@ PHP_FUNCTION(snmp_read_mib)
char *filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
if (!read_mib(filename)) {
char *error = strerror(errno);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading MIB file '%s': %s", filename, error);
+ php_error_docref(NULL, E_WARNING, "Error while reading MIB file '%s': %s", filename, error);
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1820,14 +1820,14 @@ PHP_METHOD(snmp, __construct)
zend_error_handling error_handling;
snmp_object = Z_SNMP_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (zend_parse_parameters(argc TSRMLS_CC, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(argc, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
switch(version) {
case SNMP_VERSION_1:
@@ -1835,7 +1835,7 @@ PHP_METHOD(snmp, __construct)
case SNMP_VERSION_3:
break;
default:
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown SNMP protocol version", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Unknown SNMP protocol version", 0);
return;
}
@@ -1844,7 +1844,7 @@ PHP_METHOD(snmp, __construct)
netsnmp_session_free(&(snmp_object->session));
}
- if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries TSRMLS_CC)) {
+ if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries)) {
return;
}
snmp_object->max_oids = 0;
@@ -1920,12 +1920,12 @@ PHP_METHOD(snmp, setSecurity)
snmp_object = Z_SNMP_P(object);
- if (zend_parse_parameters(argc TSRMLS_CC, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
+ if (zend_parse_parameters(argc, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len,
&a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len) == FAILURE) {
RETURN_FALSE;
}
- if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7 TSRMLS_CC)) {
+ if (netsnmp_session_set_security(snmp_object->session, a1, a2, a3, a4, a5, a6, a7)) {
/* Warning message sent already, just bail out */
RETURN_FALSE;
}
@@ -1961,7 +1961,7 @@ PHP_METHOD(snmp, getError)
/* }}} */
/* {{{ */
-void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func TSRMLS_DC)
+void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, php_snmp_read_t read_func, php_snmp_write_t write_func)
{
php_snmp_prop_handler p;
@@ -1975,7 +1975,7 @@ void php_snmp_add_property(HashTable *h, const char *name, size_t name_length, p
/* {{{ php_snmp_read_property(zval *object, zval *member, int type[, const zend_literal *key])
Generic object property reader */
-zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
zval tmp_member;
zval *retval;
@@ -1994,7 +1994,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->read_func) {
- ret = hnd->read_func(obj, rv TSRMLS_CC);
+ ret = hnd->read_func(obj, rv);
if (ret == SUCCESS) {
retval = rv;
} else {
@@ -2002,7 +2002,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
}
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -2015,7 +2015,7 @@ zval *php_snmp_read_property(zval *object, zval *member, int type, void **cache_
/* {{{ php_snmp_write_property(zval *object, zval *member, zval *value[, const zend_literal *key])
Generic object property writer */
-void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void php_snmp_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
php_snmp_object *obj;
@@ -2032,7 +2032,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member));
if (hnd && hnd->write_func) {
- hnd->write_func(obj, value TSRMLS_CC);
+ hnd->write_func(obj, value);
/*
if (!PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) {
Z_ADDREF_P(value);
@@ -2041,7 +2041,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
*/
} else {
zend_object_handlers * std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -2052,7 +2052,7 @@ void php_snmp_write_property(zval *object, zval *member, zval *value, void **cac
/* {{{ php_snmp_has_property(zval *object, zval *member, int has_set_exists[, const zend_literal *key])
Generic object property checker */
-static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC)
+static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot)
{
zval rv;
php_snmp_prop_handler *hnd;
@@ -2064,7 +2064,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
ret = 1;
break;
case 0: {
- zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
ret = Z_TYPE_P(value) != IS_NULL? 1 : 0;
zval_ptr_dtor(value);
@@ -2072,7 +2072,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
break;
}
default: {
- zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv TSRMLS_CC);
+ zval *value = php_snmp_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (value != &EG(uninitialized_zval)) {
convert_to_boolean(value);
ret = Z_TYPE_P(value) == IS_TRUE? 1:0;
@@ -2082,7 +2082,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
}
} else {
zend_object_handlers *std_hnd = zend_get_std_object_handlers();
- ret = std_hnd->has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ ret = std_hnd->has_property(object, member, has_set_exists, cache_slot);
}
return ret;
}
@@ -2090,7 +2090,7 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists,
/* {{{ php_snmp_get_properties(zval *object)
Returns all object properties. Injects SNMP properties into object on first call */
-static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
+static HashTable *php_snmp_get_properties(zval *object)
{
php_snmp_object *obj;
php_snmp_prop_handler *hnd;
@@ -2100,10 +2100,10 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
zend_ulong num_key;
obj = Z_SNMP_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) {
- if (!hnd->read_func || hnd->read_func(obj, &rv TSRMLS_CC) != SUCCESS) {
+ if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) {
ZVAL_NULL(&rv);
}
zend_hash_update(props, key, &rv);
@@ -2114,7 +2114,7 @@ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC)
/* }}} */
/* {{{ */
-static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_DC)
+static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval)
{
zval val;
@@ -2141,7 +2141,7 @@ static int php_snmp_read_info(php_snmp_object *snmp_object, zval *retval TSRMLS_
/* }}} */
/* {{{ */
-static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSRMLS_DC)
+static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval)
{
if (snmp_object->max_oids > 0) {
ZVAL_LONG(retval, snmp_object->max_oids);
@@ -2153,7 +2153,7 @@ static int php_snmp_read_max_oids(php_snmp_object *snmp_object, zval *retval TSR
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(name) \
- static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \
+ static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_BOOL(retval, snmp_object->name); \
return SUCCESS; \
@@ -2164,7 +2164,7 @@ PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(quick_print)
PHP_SNMP_BOOL_PROPERTY_READER_FUNCTION(enum_print)
#define PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(name) \
- static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval TSRMLS_DC) \
+ static int php_snmp_read_##name(php_snmp_object *snmp_object, zval *retval) \
{ \
ZVAL_LONG(retval, snmp_object->name); \
return SUCCESS; \
@@ -2175,15 +2175,15 @@ PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(oid_output_format)
PHP_SNMP_LONG_PROPERTY_READER_FUNCTION(exceptions_enabled)
/* {{{ */
-static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_info(php_snmp_object *snmp_object, zval *newval)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "info property is read-only");
+ php_error_docref(NULL, E_WARNING, "info property is read-only");
return FAILURE;
}
/* }}} */
/* {{{ */
-static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2203,7 +2203,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS
if (Z_LVAL_P(newval) > 0) {
snmp_object->max_oids = Z_LVAL_P(newval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval));
}
if (newval == &ztmp) {
@@ -2215,7 +2215,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS
/* }}} */
/* {{{ */
-static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2230,7 +2230,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new
if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) {
snmp_object->valueretrieval = Z_LVAL_P(newval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
}
@@ -2243,7 +2243,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new
/* }}} */
#define PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(name) \
-static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval TSRMLS_DC) \
+static int php_snmp_write_##name(php_snmp_object *snmp_object, zval *newval) \
{ \
zval ztmp; \
ZVAL_COPY(&ztmp, newval); \
@@ -2260,7 +2260,7 @@ PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(enum_print)
PHP_SNMP_BOOL_PROPERTY_WRITER_FUNCTION(oid_increasing_check)
/* {{{ */
-static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2280,7 +2280,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *
snmp_object->oid_output_format = Z_LVAL_P(newval);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
+ php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval));
ret = FAILURE;
break;
}
@@ -2293,7 +2293,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval *
/* }}} */
/* {{{ */
-static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval TSRMLS_DC)
+static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval *newval)
{
zval ztmp;
int ret = SUCCESS;
@@ -2385,7 +2385,7 @@ PHP_MINIT_FUNCTION(snmp)
php_snmp_object_handlers.offset = XtOffsetOf(php_snmp_object, zo);
php_snmp_object_handlers.clone_obj = NULL;
php_snmp_object_handlers.free_obj = php_snmp_object_free_storage;
- php_snmp_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ php_snmp_ce = zend_register_internal_class(&ce);
/* Register SNMP Class properties */
zend_hash_init(&php_snmp_properties, 0, NULL, free_php_snmp_properties, 1);
@@ -2432,9 +2432,9 @@ PHP_MINIT_FUNCTION(snmp)
/* Register SNMPException class */
INIT_CLASS_ENTRY(cex, "SNMPException", NULL);
#ifdef HAVE_SPL
- php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException TSRMLS_CC);
+ php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
#else
- php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_exception_get_default());
#endif
return SUCCESS;
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 9e554a9f5a..d147d5ac2f 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -29,63 +29,63 @@
#include "zend_interfaces.h"
/* zval type decode */
-static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_bool(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_string(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_stringr(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_stringc(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_map(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_null(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_base64(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_hexbin(zval* ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-
-static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static zval *to_zval_double(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_long(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_bool(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_string(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_stringr(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_stringc(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_map(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_null(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_base64(zval* ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_hexbin(zval* ret, encodeTypePtr type, xmlNodePtr data);
+
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* String encode */
-static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Null encode */
-static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Array encode */
-static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
-static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent);
/* Datetime encode/decode */
-static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-
-static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-
-static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-
-static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+
+static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data);
+
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+
+static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
/* Try and guess for non-wsdl clients and servers */
-static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
-static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data);
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
static int is_map(zval *array);
-static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type TSRMLS_DC);
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *out_type);
static xmlNodePtr check_and_resolve_href(xmlNodePtr data);
@@ -283,7 +283,7 @@ static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type)
return NULL;
}
-static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
+static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) {
xmlNodePtr node_ptr;
if (SOAP_GLOBAL(ref_map)) {
@@ -350,7 +350,7 @@ static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node TSRMLS_DC) {
return 0;
}
-static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
+static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node)
{
zval *data_ptr;
@@ -368,14 +368,14 @@ static zend_bool soap_check_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
return 0;
}
-static void soap_add_xml_ref(zval *data, xmlNodePtr node TSRMLS_DC)
+static void soap_add_xml_ref(zval *data, xmlNodePtr node)
{
if (SOAP_GLOBAL(ref_map)) {
zend_hash_index_update(SOAP_GLOBAL(ref_map), (zend_ulong)node, data);
}
}
-static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map TSRMLS_DC)
+static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xmlNodePtr parent, int check_class_map)
{
xmlNodePtr node = NULL;
int add_type = 0;
@@ -420,7 +420,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
}
zdata = zend_hash_str_find(ht, "enc_value", sizeof("enc_value")-1);
- node = master_to_xml(enc, zdata, style, parent TSRMLS_CC);
+ node = master_to_xml(enc, zdata, style, parent);
if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) {
if ((ztype = zend_hash_str_find(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL) {
@@ -491,7 +491,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
smart_str_free(&nscat);
}
if (encode->to_xml) {
- node = encode->to_xml(&encode->details, data, style, parent TSRMLS_CC);
+ node = encode->to_xml(&encode->details, data, style, parent);
if (add_type) {
set_ns_and_type(node, &encode->details);
}
@@ -500,12 +500,12 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
return node;
}
-xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent)
{
- return master_to_xml_int(encode, data, style, parent, 1 TSRMLS_CC);
+ return master_to_xml_int(encode, data, style, parent, 1);
}
-static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
+static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data)
{
if (SOAP_GLOBAL(typemap)) {
if (encode->details.type_str) {
@@ -549,12 +549,12 @@ static zval *master_to_zval_int(zval *ret, encodePtr encode, xmlNodePtr data TSR
}
}
if (encode->to_zval) {
- ret = encode->to_zval(ret, &encode->details, data TSRMLS_CC);
+ ret = encode->to_zval(ret, &encode->details, data);
}
return ret;
}
-zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
+zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data)
{
data = check_and_resolve_href(data);
@@ -585,10 +585,10 @@ zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC)
}
}
}
- return master_to_zval_int(ret, encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, encode, data);
}
-xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret = NULL;
zval return_value;
@@ -596,7 +596,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par
if (type && type->map && Z_TYPE(type->map->to_xml) != IS_UNDEF) {
ZVAL_NULL(&return_value);
- if (call_user_function(EG(function_table), NULL, &type->map->to_xml, &return_value, 1, data TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, &type->map->to_xml, &return_value, 1, data) == FAILURE) {
soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
}
if (Z_TYPE(return_value) == IS_STRING) {
@@ -619,7 +619,7 @@ xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr par
return ret;
}
-zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
+zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node)
{
if (type && type->map && Z_TYPE(type->map->to_zval) != IS_UNDEF) {
xmlBufferPtr buf;
@@ -633,7 +633,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
xmlBufferFree(buf);
xmlFreeNode(copy);
- if (call_user_function(EG(function_table), NULL, &type->map->to_zval, ret, 1, &data TSRMLS_CC) == FAILURE) {
+ if (call_user_function(EG(function_table), NULL, &type->map->to_zval, ret, 1, &data) == FAILURE) {
soap_error0(E_ERROR, "Encoding: Error calling from_xml callback");
} else if (EG(exception)) {
ZVAL_NULL(ret);
@@ -647,7 +647,7 @@ zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC)
/* TODO: get rid of "bogus".. ither by passing in the already created xmlnode or passing in the node name */
/* String encode/decode */
-static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -679,7 +679,7 @@ static zval *to_zval_string(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -712,7 +712,7 @@ static zval *to_zval_stringr(zval *ret, encodeTypePtr type, xmlNodePtr data TSRM
return ret;
}
-static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -745,7 +745,7 @@ static zval *to_zval_stringc(zval *ret, encodeTypePtr type, xmlNodePtr data TSRM
return ret;
}
-static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zend_string *str;
@@ -774,7 +774,7 @@ static zval *to_zval_base64(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zend_string *str;
int i, j;
@@ -820,7 +820,7 @@ static zval *to_zval_hexbin(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret, text;
char *str;
@@ -905,7 +905,7 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret, text;
zend_string *str;
@@ -937,7 +937,7 @@ static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
static char hexconvtab[] = "0123456789ABCDEF";
xmlNodePtr ret, text;
@@ -974,7 +974,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1012,7 +1012,7 @@ static zval *to_zval_double(zval *ret, encodeTypePtr type, xmlNodePtr data TSRML
return ret;
}
-static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1044,7 +1044,7 @@ static zval *to_zval_long(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_
return ret;
}
-static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1075,7 +1075,7 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode
return ret;
}
-static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
zval tmp;
@@ -1098,7 +1098,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo
return ret;
}
-static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
@@ -1127,7 +1127,7 @@ static zval *to_zval_bool(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_
return ret;
}
-static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1135,7 +1135,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
- if (zend_is_true(data TSRMLS_CC)) {
+ if (zend_is_true(data)) {
xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
xmlNodeSetContent(ret, BAD_CAST("false"));
@@ -1148,13 +1148,13 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
}
/* Null encode/decode */
-static zval *to_zval_null(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_null(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
ZVAL_NULL(ret);
return ret;
}
-static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret;
@@ -1166,7 +1166,7 @@ static xmlNodePtr to_xml_null(encodeTypePtr type, zval *data, int style, xmlNode
return ret;
}
-static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
+static void set_zval_property(zval* object, char* name, zval* val)
{
zend_class_entry *old_scope;
@@ -1177,7 +1177,7 @@ static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
EG(scope) = old_scope;
}
-static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
+static zval* get_zval_property(zval* object, char* name, zval *rv)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
zval member;
@@ -1187,12 +1187,12 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
ZVAL_STRING(&member, name);
old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(object);
- data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS, NULL, rv TSRMLS_CC);
+ data = Z_OBJ_HT_P(object)->read_property(object, &member, BP_VAR_IS, NULL, rv);
if (data == &EG(uninitialized_zval)) {
/* Hack for bug #32455 */
zend_property_info *property_info;
- property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC);
+ property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1);
EG(scope) = old_scope;
if (property_info != ZEND_WRONG_PROPERTY_INFO && property_info &&
zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) {
@@ -1215,7 +1215,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC)
return NULL;
}
-static void unset_zval_property(zval* object, char* name TSRMLS_DC)
+static void unset_zval_property(zval* object, char* name)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
zval member;
@@ -1224,7 +1224,7 @@ static void unset_zval_property(zval* object, char* name TSRMLS_DC)
ZVAL_STRING(&member, name);
old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(object);
- Z_OBJ_HT_P(object)->unset_property(object, &member, NULL TSRMLS_CC);
+ Z_OBJ_HT_P(object)->unset_property(object, &member, NULL);
EG(scope) = old_scope;
zval_ptr_dtor(&member);
} else if (Z_TYPE_P(object) == IS_ARRAY) {
@@ -1232,17 +1232,17 @@ static void unset_zval_property(zval* object, char* name TSRMLS_DC)
}
}
-static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
+static void model_to_zval_any(zval *ret, xmlNodePtr node)
{
zval rv, arr, val;
zval* any = NULL;
char* name = NULL;
while (node != NULL) {
- if (get_zval_property(ret, (char*)node->name, &rv TSRMLS_CC) == NULL) {
+ if (get_zval_property(ret, (char*)node->name, &rv) == NULL) {
ZVAL_NULL(&val);
- master_to_zval(&val, get_conversion(XSD_ANYXML), node TSRMLS_CC);
+ master_to_zval(&val, get_conversion(XSD_ANYXML), node);
if (any && Z_TYPE_P(any) != IS_ARRAY) {
/* Convert into array */
@@ -1261,7 +1261,7 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
zval val2;
ZVAL_NULL(&val2);
- master_to_zval(&val2, get_conversion(XSD_ANYXML), node->next TSRMLS_CC);
+ master_to_zval(&val2, get_conversion(XSD_ANYXML), node->next);
if (Z_TYPE(val2) != IS_STRING || *Z_STRVAL(val) != '<') {
break;
}
@@ -1307,11 +1307,11 @@ static void model_to_zval_any(zval *ret, xmlNodePtr node TSRMLS_DC)
node = node->next;
}
if (any) {
- set_zval_property(ret, name ? name : "any", any TSRMLS_CC);
+ set_zval_property(ret, name ? name : "any", any);
}
}
-static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl TSRMLS_DC)
+static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr data, sdlPtr sdl)
{
switch (model->kind) {
case XSD_CONTENT_ELEMENT:
@@ -1328,19 +1328,19 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)r_node->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, r_node->children->content);
}
- master_to_zval(&val, model->u.element->encode, r_node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, r_node);
} else if (model->u.element->fixed) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
- master_to_zval(&val, model->u.element->encode, r_node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, r_node);
}
if ((node = get_node(node->next, model->u.element->name)) != NULL) {
zval array;
@@ -1352,19 +1352,19 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
}
- master_to_zval(&val, model->u.element->encode, node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, node);
} else if (model->u.element->fixed) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
- master_to_zval(&val, model->u.element->encode, dummy TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
- master_to_zval(&val, model->u.element->encode, node TSRMLS_CC);
+ master_to_zval(&val, model->u.element->encode, node);
}
add_next_index_zval(&array, &val);
} while ((node = get_node(node->next, model->u.element->name)) != NULL);
@@ -1378,7 +1378,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
add_next_index_zval(&array, &val);
ZVAL_COPY_VALUE(&val, &array);
}
- set_zval_property(ret, model->u.element->name, &val TSRMLS_CC);
+ set_zval_property(ret, model->u.element->name, &val);
}
}
break;
@@ -1392,16 +1392,16 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
if (tmp->kind == XSD_CONTENT_ANY) {
any = tmp;
} else {
- model_to_zval_object(ret, tmp, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, tmp, data, sdl);
}
} ZEND_HASH_FOREACH_END();
if (any) {
- model_to_zval_any(ret, data->children TSRMLS_CC);
+ model_to_zval_any(ret, data->children);
}
break;
}
case XSD_CONTENT_GROUP:
- model_to_zval_object(ret, model->u.group->model, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, model->u.group->model, data, sdl);
break;
default:
break;
@@ -1409,7 +1409,7 @@ static void model_to_zval_object(zval *ret, sdlContentModelPtr model, xmlNodePtr
}
/* Struct encode/decode */
-static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, zend_class_entry *pce TSRMLS_DC)
+static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, zend_class_entry *pce)
{
xmlNodePtr trav;
sdlPtr sdl;
@@ -1425,7 +1425,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
if ((classname = zend_hash_str_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL &&
Z_TYPE_P(classname) == IS_STRING &&
- (tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO TSRMLS_CC)) != NULL) {
+ (tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO)) != NULL) {
ce = tmp;
}
}
@@ -1446,21 +1446,21 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval base;
ZVAL_NULL(ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- master_to_zval_int(&base, enc, data TSRMLS_CC);
- set_zval_property(ret, "_", &base TSRMLS_CC);
+ master_to_zval_int(&base, enc, data);
+ set_zval_property(ret, "_", &base);
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
}
} else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
sdlType->encode &&
@@ -1471,7 +1471,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
CHECK_XML_NULL(data);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
@@ -1484,14 +1484,14 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
(sdlType->encode->details.sdl_type->encode == NULL ||
(sdlType->encode->details.sdl_type->encode->details.type != IS_ARRAY &&
sdlType->encode->details.sdl_type->encode->details.type != SOAP_ENC_ARRAY))) {
- to_zval_object_ex(ret, &sdlType->encode->details, data, ce TSRMLS_CC);
+ to_zval_object_ex(ret, &sdlType->encode->details, data, ce);
} else {
- master_to_zval_int(ret, sdlType->encode, data TSRMLS_CC);
+ master_to_zval_int(ret, sdlType->encode, data);
}
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
- redo_any = get_zval_property(ret, "any", &rv TSRMLS_CC);
+ redo_any = get_zval_property(ret, "any", &rv);
if (Z_TYPE_P(ret) == IS_OBJECT && ce != ZEND_STANDARD_CLASS_DEF_PTR) {
zend_object *zobj = Z_OBJ_P(ret);
zobj->ce = ce;
@@ -1500,32 +1500,32 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval base;
ZVAL_NULL(ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
- master_to_zval_int(&base, sdlType->encode, data TSRMLS_CC);
- set_zval_property(ret, "_", &base TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
+ master_to_zval_int(&base, sdlType->encode, data);
+ set_zval_property(ret, "_", &base);
}
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
}
if (sdlType->model) {
- model_to_zval_object(ret, sdlType->model, data, sdl TSRMLS_CC);
+ model_to_zval_object(ret, sdlType->model, data, sdl);
if (redo_any) {
- if (!get_zval_property(ret, "any", &rv TSRMLS_CC)) {
- model_to_zval_any(ret, data->children TSRMLS_CC);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ if (!get_zval_property(ret, "any", &rv)) {
+ model_to_zval_any(ret, data->children);
+ soap_add_xml_ref(ret, data);
} else {
- unset_zval_property(ret, "any" TSRMLS_CC);
+ unset_zval_property(ret, "any");
}
}
}
@@ -1555,9 +1555,9 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
text = xmlNewText(BAD_CAST(str_val));
xmlAddChild(dummy, text);
ZVAL_NULL(&data);
- master_to_zval(&data, attr->encode, dummy TSRMLS_CC);
+ master_to_zval(&data, attr->encode, dummy);
xmlFreeNode(dummy);
- set_zval_property(ret, attr->name, &data TSRMLS_CC);
+ set_zval_property(ret, attr->name, &data);
}
}
} ZEND_HASH_FOREACH_END();
@@ -1565,12 +1565,12 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
} else {
ZVAL_NULL(ret);
FIND_XML_NULL(data, ret);
- if (soap_check_xml_ref(ret, data TSRMLS_CC)) {
+ if (soap_check_xml_ref(ret, data)) {
return ret;
}
object_init_ex(ret, ce);
- soap_add_xml_ref(ret, data TSRMLS_CC);
+ soap_add_xml_ref(ret, data);
trav = data->children;
while (trav != NULL) {
@@ -1579,18 +1579,18 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
zval *prop;
ZVAL_NULL(&tmpVal);
- master_to_zval(&tmpVal, NULL, trav TSRMLS_CC);
+ master_to_zval(&tmpVal, NULL, trav);
- prop = get_zval_property(ret, (char*)trav->name, &rv TSRMLS_CC);
+ prop = get_zval_property(ret, (char*)trav->name, &rv);
if (!prop) {
if (!trav->next || !get_node(trav->next, (char*)trav->name)) {
- set_zval_property(ret, (char*)trav->name, &tmpVal TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &tmpVal);
} else {
zval arr;
array_init(&arr);
add_next_index_zval(&arr, &tmpVal);
- set_zval_property(ret, (char*)trav->name, &arr TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &arr);
}
} else {
/* Property already exist - make array */
@@ -1599,7 +1599,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
array_init(&arr);
Z_ADDREF_P(prop);
add_next_index_zval(&arr, prop);
- set_zval_property(ret, (char*)trav->name, &arr TSRMLS_CC);
+ set_zval_property(ret, (char*)trav->name, &arr);
prop = &arr;
}
/* Add array element */
@@ -1612,13 +1612,13 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z
return ret;
}
-static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_object(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
- return to_zval_object_ex(ret, type, data, NULL TSRMLS_CC);
+ return to_zval_object_ex(ret, type, data, NULL);
}
-static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict TSRMLS_DC)
+static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *object, int style, int strict)
{
switch (model->kind) {
case XSD_CONTENT_ELEMENT: {
@@ -1627,7 +1627,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
encodePtr enc;
zval rv;
- data = get_zval_property(object, model->u.element->name, &rv TSRMLS_CC);
+ data = get_zval_property(object, model->u.element->name, &rv);
if (data &&
Z_TYPE_P(data) == IS_NULL &&
!model->u.element->nillable &&
@@ -1649,7 +1649,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
xmlAddChild(node, property);
set_xsi_nil(property);
} else {
- property = master_to_xml(enc, val, style, node TSRMLS_CC);
+ property = master_to_xml(enc, val, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
@@ -1671,7 +1671,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
} else if (Z_TYPE_P(data) == IS_NULL && model->min_occurs == 0) {
return 1;
} else {
- property = master_to_xml(enc, data, style, node TSRMLS_CC);
+ property = master_to_xml(enc, data, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
@@ -1712,7 +1712,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
encodePtr enc;
zval rv;
- data = get_zval_property(object, "any", &rv TSRMLS_CC);
+ data = get_zval_property(object, "any", &rv);
if (data) {
enc = get_conversion(XSD_ANYXML);
if ((model->max_occurs == -1 || model->max_occurs > 1) &&
@@ -1722,10 +1722,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zval *val;
ZEND_HASH_FOREACH_VAL(ht, val) {
- master_to_xml(enc, val, style, node TSRMLS_CC);
+ master_to_xml(enc, val, style, node);
} ZEND_HASH_FOREACH_END();
} else {
- master_to_xml(enc, data, style, node TSRMLS_CC);
+ master_to_xml(enc, data, style, node);
}
return 1;
} else if (model->min_occurs == 0) {
@@ -1743,7 +1743,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
sdlContentModelPtr tmp;
ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
- if (!model_to_xml_object(node, tmp, object, style, strict && (tmp->min_occurs > 0) TSRMLS_CC)) {
+ if (!model_to_xml_object(node, tmp, object, style, strict && (tmp->min_occurs > 0))) {
if (!strict || tmp->min_occurs > 0) {
return 0;
}
@@ -1757,7 +1757,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
int ret = 0;
ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
- int tmp_ret = model_to_xml_object(node, tmp, object, style, 0 TSRMLS_CC);
+ int tmp_ret = model_to_xml_object(node, tmp, object, style, 0);
if (tmp_ret == 1) {
return 1;
} else if (tmp_ret != 0) {
@@ -1767,7 +1767,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
return ret;
}
case XSD_CONTENT_GROUP: {
- return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
+ return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0);
}
default:
break;
@@ -1806,7 +1806,7 @@ static sdlTypePtr model_array_element(sdlContentModelPtr model)
return NULL;
}
-static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr xmlParam;
HashTable *prop = NULL;
@@ -1842,11 +1842,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
if (enc) {
zval rv;
- zval *tmp = get_zval_property(data, "_", &rv TSRMLS_CC);
+ zval *tmp = get_zval_property(data, "_", &rv);
if (tmp) {
- xmlParam = master_to_xml(enc, tmp, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, tmp, style, parent);
} else if (prop == NULL) {
- xmlParam = master_to_xml(enc, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, data, style, parent);
} else {
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
@@ -1863,16 +1863,16 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
if (prop) ZEND_HASH_INC_APPLY_COUNT(prop);
- xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent);
if (prop) ZEND_HASH_DEC_APPLY_COUNT(prop);
} else {
zval rv;
- zval *tmp = get_zval_property(data, "_", &rv TSRMLS_CC);
+ zval *tmp = get_zval_property(data, "_", &rv);
if (tmp) {
- xmlParam = master_to_xml(sdlType->encode, tmp, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, tmp, style, parent);
} else if (prop == NULL) {
- xmlParam = master_to_xml(sdlType->encode, data, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(sdlType->encode, data, style, parent);
} else {
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
@@ -1883,7 +1883,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlAddChild(parent, xmlParam);
}
- if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ if (soap_check_zval_ref(data, xmlParam)) {
return xmlParam;
}
if (prop != NULL) {
@@ -1903,7 +1903,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlAddChild(xmlParam, property);
set_xsi_nil(property);
} else {
- property = master_to_xml(array_el->encode, val, style, xmlParam TSRMLS_CC);
+ property = master_to_xml(array_el->encode, val, style, xmlParam);
}
xmlNodeSetName(property, BAD_CAST(array_el->name));
if (style == SOAP_LITERAL &&
@@ -1914,7 +1914,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
} ZEND_HASH_FOREACH_END();
} else if (sdlType->model) {
- model_to_xml_object(xmlParam, sdlType->model, data, style, 1 TSRMLS_CC);
+ model_to_xml_object(xmlParam, sdlType->model, data, style, 1);
}
if (sdlType->attributes) {
sdlAttributePtr attr;
@@ -1922,11 +1922,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
ZEND_HASH_FOREACH_PTR(sdlType->attributes, attr) {
if (attr->name) {
- zattr = get_zval_property(data, attr->name, &rv TSRMLS_CC);
+ zattr = get_zval_property(data, attr->name, &rv);
if (zattr) {
xmlNodePtr dummy;
- dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam TSRMLS_CC);
+ dummy = master_to_xml(attr->encode, zattr, SOAP_LITERAL, xmlParam);
if (dummy->children && dummy->children->content) {
if (attr->fixed && strcmp(attr->fixed, (char*)dummy->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", attr->name, attr->fixed, dummy->children->content);
@@ -1958,7 +1958,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
- if (soap_check_zval_ref(data, xmlParam TSRMLS_CC)) {
+ if (soap_check_zval_ref(data, xmlParam)) {
return xmlParam;
}
if (prop != NULL) {
@@ -1968,7 +1968,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
ZEND_HASH_FOREACH_STR_KEY_VAL_IND(prop, str_key, zprop) {
- property = master_to_xml(get_conversion(Z_TYPE_P(zprop)), zprop, style, xmlParam TSRMLS_CC);
+ property = master_to_xml(get_conversion(Z_TYPE_P(zprop)), zprop, style, xmlParam);
if (str_key) {
const char *prop_name;
@@ -1994,7 +1994,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
}
/* Array encode/decode */
-static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
encodePtr enc = NULL;
@@ -2009,7 +2009,7 @@ static xmlNodePtr guess_array_map(encodeTypePtr type, zval *data, int style, xml
enc = get_conversion(IS_NULL);
}
- return master_to_xml(enc, data, style, parent TSRMLS_CC);
+ return master_to_xml(enc, data, style, parent);
}
static int calc_dimension_12(const char* str)
@@ -2113,7 +2113,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
int* dims,
zval* data,
int style
- TSRMLS_DC)
+ )
{
int j = 0;
zval *zdata;
@@ -2126,9 +2126,9 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
}
if (dimension == 1) {
if (enc == NULL) {
- xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam TSRMLS_CC);
+ xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam);
} else {
- xparam = master_to_xml(enc, zdata, style, xmlParam TSRMLS_CC);
+ xparam = master_to_xml(enc, zdata, style, xmlParam);
}
if (type) {
@@ -2140,7 +2140,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style);
}
j++;
} ZEND_HASH_FOREACH_END();
@@ -2163,7 +2163,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
}
} else {
while (j < dims[0]) {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
j++;
}
}
@@ -2183,7 +2183,7 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
- add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
}
}
}
@@ -2200,7 +2200,7 @@ static inline int array_num_elements(HashTable* ht)
return 0;
}
-static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
sdlTypePtr sdl_type = type->sdl_type;
sdlTypePtr element_type = NULL;
@@ -2231,42 +2231,42 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
return xmlParam;
}
- if (Z_TYPE_P(data) == IS_OBJECT && instanceof_function(Z_OBJCE_P(data), zend_ce_traversable TSRMLS_CC)) {
+ if (Z_TYPE_P(data) == IS_OBJECT && instanceof_function(Z_OBJCE_P(data), zend_ce_traversable)) {
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(data);
zval *val;
array_init(&array_copy);
- iter = ce->get_iterator(ce, data, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, data, 0);
if (EG(exception)) {
goto iterator_done;
}
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (EG(exception)) {
goto iterator_done;
}
}
- while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ while (iter->funcs->valid(iter) == SUCCESS) {
if (EG(exception)) {
goto iterator_done;
}
- val = iter->funcs->get_current_data(iter TSRMLS_CC);
+ val = iter->funcs->get_current_data(iter);
if (EG(exception)) {
goto iterator_done;
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
goto iterator_done;
}
- array_set_zval_key(Z_ARRVAL(array_copy), &key, val TSRMLS_CC);
+ array_set_zval_key(Z_ARRVAL(array_copy), &key, val);
zval_ptr_dtor(val);
zval_dtor(&key);
} else {
@@ -2274,7 +2274,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
}
Z_ADDREF_P(val);
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (EG(exception)) {
goto iterator_done;
}
@@ -2401,7 +2401,7 @@ iterator_done:
enc = elementType->encode;
get_type_str(xmlParam, elementType->encode->details.ns, elementType->encode->details.type_str, &array_type);
} else {
- enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ enc = get_array_type(xmlParam, data, &array_type);
}
} else if (sdl_type && sdl_type->elements &&
zend_hash_num_elements(sdl_type->elements) == 1 &&
@@ -2419,7 +2419,7 @@ iterator_done:
dims[0] = i;
} else {
- enc = get_array_type(xmlParam, data, &array_type TSRMLS_CC);
+ enc = get_array_type(xmlParam, data, &array_type);
smart_str_append_long(&array_size, i);
dims = safe_emalloc(sizeof(int), dimension, 0);
dims[0] = i;
@@ -2452,7 +2452,7 @@ iterator_done:
smart_str_free(&array_type);
smart_str_free(&array_size);
- add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style TSRMLS_CC);
+ add_xml_array_elements(xmlParam, element_type, enc, enc?encode_add_ns(xmlParam,enc->details.ns):NULL, dimension, dims, data, style);
efree(dims);
}
if (style == SOAP_ENCODED) {
@@ -2468,7 +2468,7 @@ iterator_done:
return xmlParam;
}
-static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
xmlNodePtr trav;
encodePtr enc = NULL;
@@ -2625,7 +2625,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
xmlAttrPtr position = get_attribute(trav->properties,"position");
ZVAL_NULL(&tmpVal);
- master_to_zval(&tmpVal, enc, trav TSRMLS_CC);
+ master_to_zval(&tmpVal, enc, trav);
if (position != NULL && position->children && position->children->content) {
char* tmp = strrchr((char*)position->children->content, '[');
if (tmp == NULL) {
@@ -2674,7 +2674,7 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS
}
/* Map encode/decode */
-static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
zval *temp_data;
zend_string *key_val;
@@ -2712,7 +2712,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
smart_str_free(&tmp);
}
- xparam = master_to_xml(get_conversion(Z_TYPE_P(temp_data)), temp_data, style, item TSRMLS_CC);
+ xparam = master_to_xml(get_conversion(Z_TYPE_P(temp_data)), temp_data, style, item);
xmlNodeSetName(xparam, BAD_CAST("value"));
} ZEND_HASH_FOREACH_END();
}
@@ -2723,7 +2723,7 @@ static xmlNodePtr to_xml_map(encodeTypePtr type, zval *data, int style, xmlNodeP
return xmlParam;
}
-static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
zval key, value;
xmlNodePtr trav, item, xmlKey, xmlValue;
@@ -2748,9 +2748,9 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
}
ZVAL_NULL(&key);
- master_to_zval(&key, NULL, xmlKey TSRMLS_CC);
+ master_to_zval(&key, NULL, xmlKey);
ZVAL_NULL(&value);
- master_to_zval(&value, NULL, xmlValue TSRMLS_CC);
+ master_to_zval(&value, NULL, xmlValue);
if (Z_TYPE(key) == IS_STRING) {
zend_symtable_update(Z_ARRVAL_P(ret), Z_STR(key), &value);
@@ -2769,7 +2769,7 @@ static zval *to_zval_map(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
}
/* Unknown encode/decode */
-static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
encodePtr enc;
xmlNodePtr ret;
@@ -2779,7 +2779,7 @@ static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, x
} else {
enc = get_conversion(IS_NULL);
}
- ret = master_to_xml_int(enc, data, style, parent, 0 TSRMLS_CC);
+ ret = master_to_xml_int(enc, data, style, parent, 0);
/*
if (style == SOAP_LITERAL && SOAP_GLOBAL(sdl)) {
set_ns_and_type(ret, &enc->details);
@@ -2788,7 +2788,7 @@ static xmlNodePtr guess_xml_convert(encodeTypePtr type, zval *data, int style, x
return ret;
}
-static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
encodePtr enc = NULL;
xmlAttrPtr tmpattr;
@@ -2845,7 +2845,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data T
}
}
}
- master_to_zval_int(ret, enc, data TSRMLS_CC);
+ master_to_zval_int(ret, enc, data);
if (SOAP_GLOBAL(sdl) && type_name && enc->details.sdl_type) {
zval soapvar;
char *ns, *cptype;
@@ -2869,7 +2869,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data T
}
/* Time encode/decode */
-static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *format, int style, xmlNodePtr parent)
{
/* logic hacked from ext/standard/datetime.c */
struct tm *ta, tmbuf;
@@ -2933,59 +2933,59 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
return xmlParam;
}
-static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_duration(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
/* TODO: '-'?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?T([0-9]+H)?([0-9]+M)?([0-9]+S)? */
- return to_xml_string(type, data, style, parent TSRMLS_CC);
+ return to_xml_string(type, data, style, parent);
}
-static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_datetime(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m-%dT%H:%M:%S", style, parent);
}
-static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_time(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
/* TODO: microsecconds */
- return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%H:%M:%S", style, parent);
}
-static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_date(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m-%d", style, parent);
}
-static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gyearmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y-%m", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y-%m", style, parent);
}
-static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gyear(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "%Y", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "%Y", style, parent);
}
-static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gmonthday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "--%m-%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "--%m-%d", style, parent);
}
-static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gday(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "---%d", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "---%d", style, parent);
}
-static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_gmonth(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
- return to_xml_datetime_ex(type, data, "--%m--", style, parent TSRMLS_CC);
+ return to_xml_datetime_ex(type, data, "--%m--", style, parent);
}
-static zval* to_zval_list(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+static zval* to_zval_list(zval *ret, encodeTypePtr enc, xmlNodePtr data) {
/*FIXME*/
- return to_zval_stringc(ret, enc, data TSRMLS_CC);
+ return to_zval_stringc(ret, enc, data);
}
-static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
xmlNodePtr ret;
encodePtr list_enc = NULL;
@@ -3007,7 +3007,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
HashTable *ht = Z_ARRVAL_P(data);
ZEND_HASH_FOREACH_VAL(ht, tmp) {
- xmlNodePtr dummy = master_to_xml(list_enc, tmp, SOAP_LITERAL, ret TSRMLS_CC);
+ xmlNodePtr dummy = master_to_xml(list_enc, tmp, SOAP_LITERAL, ret);
if (dummy && dummy->children && dummy->children->content) {
if (list.s && list.s->len != 0) {
smart_str_appendc(&list, ' ');
@@ -3044,7 +3044,7 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
next++;
}
ZVAL_STRING(&dummy_zval, start);
- dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret TSRMLS_CC);
+ dummy = master_to_xml(list_enc, &dummy_zval, SOAP_LITERAL, ret);
zval_ptr_dtor(&dummy_zval);
if (dummy && dummy->children && dummy->children->content) {
if (list.s && list.s->len != 0) {
@@ -3068,22 +3068,22 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
return ret;
}
-static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_list1(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
/*FIXME: minLength=1 */
- return to_xml_list(enc,data,style, parent TSRMLS_CC);
+ return to_xml_list(enc,data,style, parent);
}
-static zval* to_zval_union(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC) {
+static zval* to_zval_union(zval *ret, encodeTypePtr enc, xmlNodePtr data) {
/*FIXME*/
- return to_zval_list(ret, enc, data TSRMLS_CC);
+ return to_zval_list(ret, enc, data);
}
-static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC) {
+static xmlNodePtr to_xml_union(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent) {
/*FIXME*/
- return to_xml_list(enc,data,style, parent TSRMLS_CC);
+ return to_xml_list(enc,data,style, parent);
}
-static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
+static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data)
{
xmlBufferPtr buf;
@@ -3101,7 +3101,7 @@ static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
if ((sdl_type = zend_hash_find_ptr(SOAP_GLOBAL(sdl)->elements, nscat.s)) != NULL &&
sdl_type->encode) {
smart_str_free(&nscat);
- return master_to_zval_int(ret, sdl_type->encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, sdl_type->encode, data);
}
smart_str_free(&nscat);
}
@@ -3113,7 +3113,7 @@ static zval *to_zval_any(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_D
return ret;
}
-static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
{
xmlNodePtr ret = NULL;
@@ -3123,7 +3123,7 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
zend_string *name;
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(data), name, el) {
- ret = master_to_xml(enc, el, style, parent TSRMLS_CC);
+ ret = master_to_xml(enc, el, style, parent);
if (ret &&
ret->name != xmlStringTextNoenc) {
xmlNodeSetName(ret, BAD_CAST(name->val));
@@ -3154,13 +3154,13 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP
return ret;
}
-zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC)
+zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data)
{
sdlTypePtr type;
type = enc->sdl_type;
if (type == NULL) {
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
/*FIXME: restriction support
if (type && type->restrictions &&
@@ -3194,31 +3194,31 @@ zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRML
switch (type->kind) {
case XSD_TYPEKIND_SIMPLE:
if (type->encode && enc != &type->encode->details) {
- return master_to_zval_int(ret, type->encode, data TSRMLS_CC);
+ return master_to_zval_int(ret, type->encode, data);
} else {
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
break;
case XSD_TYPEKIND_LIST:
- return to_zval_list(ret, enc, data TSRMLS_CC);
+ return to_zval_list(ret, enc, data);
case XSD_TYPEKIND_UNION:
- return to_zval_union(ret, enc, data TSRMLS_CC);
+ return to_zval_union(ret, enc, data);
case XSD_TYPEKIND_COMPLEX:
case XSD_TYPEKIND_RESTRICTION:
case XSD_TYPEKIND_EXTENSION:
if (type->encode &&
(type->encode->details.type == IS_ARRAY ||
type->encode->details.type == SOAP_ENC_ARRAY)) {
- return to_zval_array(ret, enc, data TSRMLS_CC);
+ return to_zval_array(ret, enc, data);
}
- return to_zval_object(ret, enc, data TSRMLS_CC);
+ return to_zval_object(ret, enc, data);
default:
soap_error0(E_ERROR, "Encoding: Internal Error");
- return guess_zval_convert(ret, enc, data TSRMLS_CC);
+ return guess_zval_convert(ret, enc, data);
}
}
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent TSRMLS_DC)
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent)
{
sdlTypePtr type;
xmlNodePtr ret = NULL;
@@ -3226,7 +3226,7 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
type = enc->sdl_type;
if (type == NULL) {
- ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ ret = guess_xml_convert(enc, data, style, parent);
if (style == SOAP_ENCODED) {
set_ns_and_type(ret, enc);
}
@@ -3258,16 +3258,16 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
switch(type->kind) {
case XSD_TYPEKIND_SIMPLE:
if (type->encode && enc != &type->encode->details) {
- ret = master_to_xml(type->encode, data, style, parent TSRMLS_CC);
+ ret = master_to_xml(type->encode, data, style, parent);
} else {
- ret = guess_xml_convert(enc, data, style, parent TSRMLS_CC);
+ ret = guess_xml_convert(enc, data, style, parent);
}
break;
case XSD_TYPEKIND_LIST:
- ret = to_xml_list(enc, data, style, parent TSRMLS_CC);
+ ret = to_xml_list(enc, data, style, parent);
break;
case XSD_TYPEKIND_UNION:
- ret = to_xml_union(enc, data, style, parent TSRMLS_CC);
+ ret = to_xml_union(enc, data, style, parent);
break;
case XSD_TYPEKIND_COMPLEX:
case XSD_TYPEKIND_RESTRICTION:
@@ -3275,9 +3275,9 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo
if (type->encode &&
(type->encode->details.type == IS_ARRAY ||
type->encode->details.type == SOAP_ENC_ARRAY)) {
- return to_xml_array(enc, data, style, parent TSRMLS_CC);
+ return to_xml_array(enc, data, style, parent);
} else {
- return to_xml_object(enc, data, style, parent TSRMLS_CC);
+ return to_xml_object(enc, data, style, parent);
}
break;
default:
@@ -3401,8 +3401,7 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
}
if (xmlns == NULL) {
xmlChar* prefix;
- TSRMLS_FETCH();
-
+
if ((prefix = zend_hash_str_find_ptr(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns))) != NULL) {
xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), prefix);
} else {
@@ -3445,7 +3444,6 @@ static void set_xsi_type(xmlNodePtr node, char *type)
void encode_reset_ns()
{
- TSRMLS_FETCH();
SOAP_GLOBAL(cur_uniq_ns) = 0;
SOAP_GLOBAL(cur_uniq_ref) = 0;
if (SOAP_GLOBAL(ref_map)) {
@@ -3458,7 +3456,6 @@ void encode_reset_ns()
void encode_finish()
{
- TSRMLS_FETCH();
SOAP_GLOBAL(cur_uniq_ns) = 0;
SOAP_GLOBAL(cur_uniq_ref) = 0;
if (SOAP_GLOBAL(ref_map)) {
@@ -3471,7 +3468,6 @@ void encode_finish()
encodePtr get_conversion(int encode)
{
encodePtr enc;
- TSRMLS_FETCH();
if ((enc = zend_hash_index_find_ptr(&SOAP_GLOBAL(defEncIndex), encode)) == NULL) {
soap_error0(E_ERROR, "Encoding: Cannot find encoding");
@@ -3496,7 +3492,7 @@ static int is_map(zval *array)
return FALSE;
}
-static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TSRMLS_DC)
+static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type)
{
HashTable *ht;
int i, cur_type, prev_type, different;
@@ -3598,7 +3594,6 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type TS
static void get_type_str(xmlNodePtr node, const char* ns, const char* type, smart_str* ret)
{
- TSRMLS_FETCH();
if (ns) {
xmlNsPtr xmlns;
diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h
index 4424116524..a8cc71a6f1 100644
--- a/ext/soap/php_encoding.h
+++ b/ext/soap/php_encoding.h
@@ -183,23 +183,23 @@ struct _encodeType {
struct _encode {
encodeType details;
- zval *(*to_zval)(zval *ret, encodeTypePtr type, xmlNodePtr data TSRMLS_DC);
- xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
+ zval *(*to_zval)(zval *ret, encodeTypePtr type, xmlNodePtr data);
+ xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
};
/* Master functions all encode/decode should be called thur these functions */
-xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data TSRMLS_DC);
+xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent);
+zval *master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data);
/* user defined mapping */
-xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node TSRMLS_DC);
+xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
+zval *to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node);
void whiteSpace_replace(xmlChar* str);
void whiteSpace_collapse(xmlChar* str);
-xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent TSRMLS_DC);
-zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data TSRMLS_DC);
+xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent);
+zval *sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data);
void encode_finish();
void encode_reset_ns();
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index a1cee555a8..1bf0c8fe0f 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -25,14 +25,14 @@
#include "ext/standard/php_rand.h"
static char *get_http_header_value(char *headers, char *type);
-static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size TSRMLS_DC);
-static zend_string *get_http_headers(php_stream *socketd TSRMLS_DC);
+static int get_http_body(php_stream *socketd, int close, char *headers, char **response, int *out_size);
+static zend_string *get_http_headers(php_stream *socketd);
#define smart_str_append_const(str, const) \
smart_str_appendl(str,const,sizeof(const)-1)
/* Proxy HTTP Authentication */
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login, *password;
@@ -58,7 +58,7 @@ int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
}
/* HTTP Authentication */
-int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC)
+int basic_authentication(zval* this_ptr, smart_str* soap_headers)
{
zval *login, *password;
@@ -89,7 +89,7 @@ void http_context_headers(php_stream_context* context,
zend_bool has_authorization,
zend_bool has_proxy_authorization,
zend_bool has_cookies,
- smart_str* soap_headers TSRMLS_DC)
+ smart_str* soap_headers)
{
zval *tmp;
@@ -154,7 +154,7 @@ void http_context_headers(php_stream_context* context,
}
}
-static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, php_stream_context *context, int *use_proxy TSRMLS_DC)
+static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, php_stream_context *context, int *use_proxy)
{
php_stream *stream;
zval *proxy_host, *proxy_port, *tmp;
@@ -249,7 +249,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str_append_unsigned(&soap_headers, phpurl->port);
}
smart_str_append_const(&soap_headers, "\r\n");
- proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ proxy_authentication(this_ptr, &soap_headers);
smart_str_append_const(&soap_headers, "\r\n");
if (php_stream_write(stream, soap_headers.s->val, soap_headers.s->len) != soap_headers.s->len) {
php_stream_close(stream);
@@ -258,7 +258,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
smart_str_free(&soap_headers);
if (stream) {
- zend_string *http_headers = get_http_headers(stream TSRMLS_CC);
+ zend_string *http_headers = get_http_headers(stream);
if (http_headers) {
zend_string_free(http_headers);
} else {
@@ -295,8 +295,8 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
break;
}
}
- if (php_stream_xport_crypto_setup(stream, crypto_method, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
+ if (php_stream_xport_crypto_setup(stream, crypto_method, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
php_stream_close(stream);
stream = NULL;
}
@@ -328,7 +328,7 @@ int make_http_soap_request(zval *this_ptr,
char *location,
char *soapaction,
int soap_version,
- zval *return_value TSRMLS_DC)
+ zval *return_value)
{
char *request;
smart_str soap_headers = {0};
@@ -389,7 +389,7 @@ int make_http_soap_request(zval *this_ptr,
smart_str_append_const(&soap_headers_z,"Content-Encoding: gzip\r\n");
ZVAL_LONG(&params[2], 0x1f);
}
- if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, n, params TSRMLS_CC) == SUCCESS &&
+ if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, n, params) == SUCCESS &&
Z_TYPE(retval) == IS_STRING) {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
@@ -436,7 +436,7 @@ try_again:
if (phpurl == NULL || phpurl->host == NULL) {
if (phpurl != NULL) {php_url_free(phpurl);}
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -447,17 +447,17 @@ try_again:
} else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
old_allow_url_fopen = PG(allow_url_fopen);
PG(allow_url_fopen) = 1;
- if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) {
+ if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY) == NULL) {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
return FALSE;
@@ -471,7 +471,7 @@ try_again:
if (stream != NULL) {
php_url *orig;
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1)) != NULL &&
- (orig = (php_url *) zend_fetch_resource(tmp TSRMLS_CC, -1, "httpurl", NULL, 1, le_url)) != NULL &&
+ (orig = (php_url *) zend_fetch_resource(tmp, -1, "httpurl", NULL, 1, le_url)) != NULL &&
((use_proxy && !use_ssl) ||
(((use_ssl && orig->scheme != NULL && strcmp(orig->scheme, "https") == 0) ||
(!use_ssl && orig->scheme == NULL) ||
@@ -499,7 +499,7 @@ try_again:
}
if (!stream) {
- stream = http_connect(this_ptr, phpurl, use_ssl, context, &use_proxy TSRMLS_CC);
+ stream = http_connect(this_ptr, phpurl, use_ssl, context, &use_proxy);
if (stream) {
php_stream_auto_cleanup(stream);
add_property_resource(this_ptr, "httpsocket", stream->res);
@@ -507,7 +507,7 @@ try_again:
} else {
php_url_free(phpurl);
if (request != buf) {efree(request);}
- add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL);
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
return FALSE;
@@ -517,7 +517,7 @@ try_again:
if (stream) {
zval *cookies, *login, *password;
- zend_resource *ret = zend_register_resource(NULL, phpurl, le_url TSRMLS_CC);
+ zend_resource *ret = zend_register_resource(NULL, phpurl, le_url);
add_property_resource(this_ptr, "httpurl", ret);
/*zend_list_addref(ret);*/
@@ -630,7 +630,7 @@ try_again:
unsigned char hash[16];
PHP_MD5Init(&md5ctx);
- snprintf(cnonce, sizeof(cnonce), ZEND_LONG_FMT, php_rand(TSRMLS_C));
+ snprintf(cnonce, sizeof(cnonce), ZEND_LONG_FMT, php_rand());
PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
PHP_MD5Final(hash, &md5ctx);
make_digest(cnonce, hash);
@@ -793,7 +793,7 @@ try_again:
/* Proxy HTTP Authentication */
if (use_proxy && !use_ssl) {
- has_proxy_authorization = proxy_authentication(this_ptr, &soap_headers TSRMLS_CC);
+ has_proxy_authorization = proxy_authentication(this_ptr, &soap_headers);
}
/* Send cookies along with request */
@@ -835,7 +835,7 @@ try_again:
}
}
- http_context_headers(context, has_authorization, has_proxy_authorization, has_cookies, &soap_headers TSRMLS_CC);
+ http_context_headers(context, has_authorization, has_proxy_authorization, has_cookies, &soap_headers);
smart_str_append_const(&soap_headers, "\r\n");
smart_str_0(&soap_headers);
@@ -853,13 +853,13 @@ try_again:
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
smart_str_free(&soap_headers);
} else {
- add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -873,13 +873,13 @@ try_again:
}
do {
- http_headers = get_http_headers(stream TSRMLS_CC);
+ http_headers = get_http_headers(stream);
if (!http_headers) {
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -1044,13 +1044,13 @@ try_again:
}
}
- if (!get_http_body(stream, http_close, http_headers->val, &http_body, &http_body_size TSRMLS_CC)) {
+ if (!get_http_body(stream, http_close, http_headers->val, &http_body, &http_body_size)) {
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_string_release(http_headers);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
- add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL);
if (http_msg) {
efree(http_msg);
}
@@ -1106,7 +1106,7 @@ try_again:
phpurl = new_url;
if (--redirect_max < 1) {
- add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL);
smart_str_free(&soap_headers_z);
return FALSE;
}
@@ -1170,7 +1170,7 @@ try_again:
php_url *new_url = emalloc(sizeof(php_url));
Z_DELREF(digest);
- add_property_zval_ex(this_ptr, "_digest", sizeof("_digest")-1, &digest TSRMLS_CC);
+ add_property_zval_ex(this_ptr, "_digest", sizeof("_digest")-1, &digest);
*new_url = *phpurl;
if (phpurl->scheme) phpurl->scheme = estrdup(phpurl->scheme);
@@ -1212,7 +1212,7 @@ try_again:
zval *err;
MAKE_STD_ZVAL(err);
ZVAL_STRINGL(err, http_body, http_body_size, 1);
- add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err);
efree(content_type);
zend_string_release(http_headers);
efree(http_body);
@@ -1246,10 +1246,10 @@ try_again:
if (http_msg) {
efree(http_msg);
}
- add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL);
return FALSE;
}
- if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS &&
+ if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, 1, params) == SUCCESS &&
Z_TYPE(retval) == IS_STRING) {
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&func);
@@ -1261,7 +1261,7 @@ try_again:
efree(content_encoding);
zend_string_release(http_headers);
efree(http_body);
- add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL);
if (http_msg) {
efree(http_msg);
}
@@ -1299,7 +1299,7 @@ try_again:
if (error) {
zval_ptr_dtor(return_value);
ZVAL_UNDEF(return_value);
- add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL);
efree(http_msg);
return FALSE;
}
@@ -1350,7 +1350,7 @@ static char *get_http_header_value(char *headers, char *type)
return NULL;
}
-static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size TSRMLS_DC)
+static int get_http_body(php_stream *stream, int close, char *headers, char **response, int *out_size)
{
char *header, *http_buf = NULL;
int header_close = close, header_chunked = 0, header_length = 0, http_buf_size = 0;
@@ -1484,7 +1484,7 @@ static int get_http_body(php_stream *stream, int close, char *headers, char **r
return TRUE;
}
-static zend_string *get_http_headers(php_stream *stream TSRMLS_DC)
+static zend_string *get_http_headers(php_stream *stream)
{
smart_str tmp_response = {0};
char headerbuf[8192];
diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h
index b752641b1b..03007f70f0 100644
--- a/ext/soap/php_http.h
+++ b/ext/soap/php_http.h
@@ -28,13 +28,13 @@ int make_http_soap_request(zval *this_ptr,
char *location,
char *soapaction,
int soap_version,
- zval *response TSRMLS_DC);
+ zval *response);
-int proxy_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
-int basic_authentication(zval* this_ptr, smart_str* soap_headers TSRMLS_DC);
+int proxy_authentication(zval* this_ptr, smart_str* soap_headers);
+int basic_authentication(zval* this_ptr, smart_str* soap_headers);
void http_context_headers(php_stream_context* context,
zend_bool has_authorization,
zend_bool has_proxy_authorization,
zend_bool has_cookies,
- smart_str* soap_headers TSRMLS_DC);
+ smart_str* soap_headers);
#endif
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 52fa71d4e0..074c9819eb 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -22,7 +22,7 @@
#include "php_soap.h"
/* SOAP client calls this function to parse response from SOAP server */
-int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC)
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers)
{
char* envelope_ns = NULL;
xmlDocPtr response;
@@ -43,11 +43,11 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
response = soap_xmlParseMemory(buffer, buffer_size);
if (!response) {
- add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL);
return FALSE;
}
if (xmlGetIntSubset(response) != NULL) {
- add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -66,7 +66,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
soap_version = SOAP_1_2;
} else {
- add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -74,7 +74,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
trav = trav->next;
}
if (env == NULL) {
- add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -82,16 +82,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -123,7 +123,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
trav = trav->next;
}
if (body == NULL) {
- add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -131,17 +131,17 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
while (attr != NULL) {
if (attr->ns == NULL) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -149,7 +149,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = attr->next;
}
if (trav != NULL && soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -158,16 +158,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
- add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
- add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
}
@@ -194,20 +194,20 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = get_node(fault->children, "faultstring");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultstring = Z_STR(zv);
}
tmp = get_node(fault->children, "faultactor");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultactor = Z_STR(zv);
}
tmp = get_node(fault->children, "detail");
if (tmp != NULL) {
- master_to_zval(&details, NULL, tmp TSRMLS_CC);
+ master_to_zval(&details, NULL, tmp);
}
} else {
tmp = get_node(fault->children, "Code");
@@ -224,17 +224,17 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
tmp = get_node(tmp->children,"Text");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
- master_to_zval(&zv, get_conversion(IS_STRING), tmp TSRMLS_CC);
+ master_to_zval(&zv, get_conversion(IS_STRING), tmp);
faultstring = Z_STR(zv);
}
}
tmp = get_node(fault->children,"Detail");
if (tmp != NULL) {
- master_to_zval(&details, NULL, tmp TSRMLS_CC);
+ master_to_zval(&details, NULL, tmp);
}
}
- add_soap_fault(this_ptr, faultcode, faultstring ? faultstring->val : NULL, faultactor ? faultactor->val : NULL, &details TSRMLS_CC);
+ add_soap_fault(this_ptr, faultcode, faultstring ? faultstring->val : NULL, faultactor ? faultactor->val : NULL, &details);
if (faultstring) {
zend_string_release(faultstring);
}
@@ -317,16 +317,16 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
/* TODO: may be "nil" is not OK? */
ZVAL_NULL(&tmp);
/*
- add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Can't find response data", NULL, NULL);
xmlFreeDoc(response);
return FALSE;
*/
} else {
/* Decoding value of parameter */
if (param != NULL) {
- master_to_zval(&tmp, param->encode, val TSRMLS_CC);
+ master_to_zval(&tmp, param->encode, val);
} else {
- master_to_zval(&tmp, NULL, val TSRMLS_CC);
+ master_to_zval(&tmp, NULL, val);
}
}
add_assoc_zval(return_value, param->paramName, &tmp);
@@ -347,7 +347,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
zval tmp;
zval *arr;
- master_to_zval(&tmp, NULL, val TSRMLS_CC);
+ master_to_zval(&tmp, NULL, val);
if (val->name) {
if ((arr = zend_hash_str_find(Z_ARRVAL_P(return_value), (char*)val->name, strlen((char*)val->name))) != NULL) {
add_next_index_zval(arr, &tmp);
@@ -412,7 +412,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
}
smart_str_free(&key);
}
- master_to_zval(&val, enc, trav TSRMLS_CC);
+ master_to_zval(&val, enc, trav);
add_assoc_zval(soap_headers, (char*)trav->name, &val);
}
trav = trav->next;
diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h
index 632470f255..cabfe1a07e 100644
--- a/ext/soap/php_packet_soap.h
+++ b/ext/soap/php_packet_soap.h
@@ -22,6 +22,6 @@
#ifndef PHP_PACKET_SOAP_H
#define PHP_PACKET_SOAP_H
-int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers TSRMLS_DC);
+int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, char *fn_name, zval *return_value, zval *soap_headers);
#endif
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index b5aa5f21c2..9eecd35548 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -95,16 +95,16 @@ static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlCh
return enc;
}
-static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) {
+static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import) {
if (location != NULL &&
!zend_hash_str_exists(&ctx->docs, (char*)location, xmlStrlen(location))) {
xmlDocPtr doc;
xmlNodePtr schema;
xmlAttrPtr new_tns;
- sdl_set_uri_credentials(ctx, (char*)location TSRMLS_CC);
- doc = soap_xmlParseFile((char*)location TSRMLS_CC);
- sdl_restore_uri_credentials(ctx TSRMLS_CC);
+ sdl_set_uri_credentials(ctx, (char*)location);
+ doc = soap_xmlParseFile((char*)location);
+ sdl_restore_uri_credentials(ctx);
if (doc == NULL) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
@@ -136,7 +136,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
}
}
zend_hash_str_add_ptr(&ctx->docs, (char*)location, xmlStrlen(location), doc);
- load_schema(ctx, schema TSRMLS_CC);
+ load_schema(ctx, schema);
}
}
@@ -160,7 +160,7 @@ static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlA
Content: ((include | import | redefine | annotation)*, (((simpleType | complexType | group | attributeGroup) | element | attribute | notation), annotation*)*)
</schema>
*/
-int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
+int load_schema(sdlCtx *ctx, xmlNodePtr schema)
{
xmlNodePtr trav;
xmlAttrPtr tns;
@@ -202,7 +202,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ schema_load_file(ctx, NULL, uri, tns, 0);
xmlFree(uri);
}
@@ -222,7 +222,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
uri = xmlBuildURI(location->children->content, base);
xmlFree(base);
}
- schema_load_file(ctx, NULL, uri, tns, 0 TSRMLS_CC);
+ schema_load_file(ctx, NULL, uri, tns, 0);
xmlFree(uri);
/* TODO: <redefine> support */
}
@@ -251,7 +251,7 @@ int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC)
xmlFree(base);
}
}
- schema_load_file(ctx, ns, uri, tns, 1 TSRMLS_CC);
+ schema_load_file(ctx, ns, uri, tns, 1);
if (uri != NULL) {xmlFree(uri);}
} else if (node_is_equal(trav,"annotation")) {
/* TODO: <annotation> support */
diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h
index 55595f2ad8..0a1ff0da58 100644
--- a/ext/soap/php_schema.h
+++ b/ext/soap/php_schema.h
@@ -22,7 +22,7 @@
#ifndef PHP_SCHEMA_H
#define PHP_SCHEMA_H
-int load_schema(sdlCtx *ctx, xmlNodePtr schema TSRMLS_DC);
+int load_schema(sdlCtx *ctx, xmlNodePtr schema);
void schema_pass2(sdlCtx *ctx);
void delete_model(zval *zv);
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 798c06fdd2..f970958b4f 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -168,7 +168,6 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len)
{
encodePtr enc;
- TSRMLS_FETCH();
if ((enc = zend_hash_str_find_ptr(&SOAP_GLOBAL(defEnc), (char*)nscat, len)) != NULL) {
return enc;
@@ -225,7 +224,7 @@ static int is_wsdl_element(xmlNodePtr node)
return 1;
}
-void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri)
{
char *s;
int l1, l2;
@@ -277,8 +276,8 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
}
if (l1 != l2 || memcmp(ctx->sdl->source, uri, l1) != 0) {
/* another server. clear authentication credentals */
- php_libxml_switch_context(NULL, &context TSRMLS_CC);
- php_libxml_switch_context(&context, NULL TSRMLS_CC);
+ php_libxml_switch_context(NULL, &context);
+ php_libxml_switch_context(&context, NULL);
if (Z_TYPE(context) != IS_UNDEF) {
zval *context_ptr = &context;
ctx->context = php_stream_context_from_zval(context_ptr, 1);
@@ -305,7 +304,7 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC)
}
}
-void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC)
+void sdl_restore_uri_credentials(sdlCtx *ctx)
{
if (Z_TYPE(ctx->old_header) != IS_UNDEF) {
php_stream_context_set_option(ctx->context, "http", "header", &ctx->old_header);
@@ -315,7 +314,7 @@ void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC)
ctx->context = NULL;
}
-static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC)
+static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
{
sdlPtr tmpsdl = ctx->sdl;
xmlDocPtr wsdl;
@@ -326,9 +325,9 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
return;
}
- sdl_set_uri_credentials(ctx, struri TSRMLS_CC);
- wsdl = soap_xmlParseFile(struri TSRMLS_CC);
- sdl_restore_uri_credentials(ctx TSRMLS_CC);
+ sdl_set_uri_credentials(ctx, struri);
+ wsdl = soap_xmlParseFile(struri);
+ sdl_restore_uri_credentials(ctx);
if (!wsdl) {
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
@@ -348,7 +347,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
if (include) {
xmlNodePtr schema = get_node_ex(root, "schema", XSD_NAMESPACE);
if (schema) {
- load_schema(ctx, schema TSRMLS_CC);
+ load_schema(ctx, schema);
return;
}
}
@@ -374,7 +373,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
while (trav2 != NULL) {
if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) {
- load_schema(ctx, trav2 TSRMLS_CC);
+ load_schema(ctx, trav2);
} else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
@@ -393,7 +392,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include
uri = xmlBuildURI(tmp->children->content, base);
xmlFree(base);
}
- load_wsdl_ex(this_ptr, (char*)uri, ctx, 1 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, (char*)uri, ctx, 1);
xmlFree(uri);
}
@@ -722,7 +721,7 @@ static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
return parameters;
}
-static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
+static sdlPtr load_wsdl(zval *this_ptr, char *struri)
{
sdlCtx ctx;
int i,n;
@@ -739,7 +738,7 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC)
zend_hash_init(&ctx.portTypes, 0, NULL, NULL, 0);
zend_hash_init(&ctx.services, 0, NULL, NULL, 0);
- load_wsdl_ex(this_ptr, struri,&ctx, 0 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, struri,&ctx, 0);
schema_pass2(&ctx);
n = zend_hash_num_elements(&ctx.services);
@@ -1523,7 +1522,7 @@ static HashTable* sdl_deserialize_parameters(encodePtr *encoders, sdlTypePtr *ty
return ht;
}
-static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached TSRMLS_DC)
+static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t, time_t *cached)
{
sdlPtr sdl;
time_t old_t;
@@ -2094,7 +2093,7 @@ static void sdl_serialize_soap_body(sdlSoapBindingFunctionBodyPtr body, HashTabl
}
}
-static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl TSRMLS_DC)
+static void add_sdl_to_cache(const char *fn, const char *uri, time_t t, sdlPtr sdl)
{
smart_str buf = {0};
smart_str *out = &buf;
@@ -2917,7 +2916,7 @@ static sdlFunctionPtr make_persistent_sdl_function(sdlFunctionPtr func, HashTabl
return pfunc;
}
-static sdlPtr make_persistent_sdl(sdlPtr sdl TSRMLS_DC)
+static sdlPtr make_persistent_sdl(sdlPtr sdl)
{
sdlPtr psdl = NULL;
HashTable ptr_map;
@@ -3151,7 +3150,7 @@ static void delete_psdl(zval *zv)
free(Z_PTR_P(zv));
}
-sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
+sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
{
char fn[MAXPATHLEN];
sdlPtr sdl = NULL;
@@ -3196,7 +3195,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
unsigned char digest[16];
int len = strlen(SOAP_GLOBAL(cache_dir));
time_t cached;
- char *user = php_get_current_user(TSRMLS_C);
+ char *user = php_get_current_user();
int user_len = user ? strlen(user) + 1 : 0;
md5str[0] = '\0';
@@ -3215,7 +3214,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
}
memcpy(key+len,md5str,sizeof(md5str));
- if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached TSRMLS_CC)) != NULL) {
+ if ((sdl = get_sdl_from_cache(key, uri, t-SOAP_GLOBAL(cache_ttl), &cached)) != NULL) {
t = cached;
efree(key);
goto cache_in_memory;
@@ -3226,7 +3225,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
"_stream_context", sizeof("_stream_context")-1))) {
context = php_stream_context_from_zval(tmp, 0);
} else {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent")-1)) != NULL &&
@@ -3253,7 +3252,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
ZVAL_NEW_STR(&str_proxy, proxy.s);
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "http", "proxy", &str_proxy);
zval_ptr_dtor(&str_proxy);
@@ -3264,10 +3263,10 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
php_stream_context_set_option(context, "http", "request_fulluri", &str_proxy);
}
- has_proxy_authorization = proxy_authentication(this_ptr, &headers TSRMLS_CC);
+ has_proxy_authorization = proxy_authentication(this_ptr, &headers);
}
- has_authorization = basic_authentication(this_ptr, &headers TSRMLS_CC);
+ has_authorization = basic_authentication(this_ptr, &headers);
/* Use HTTP/1.1 with "Connection: close" by default */
if ((tmp = php_stream_context_get_option(context, "http", "protocol_version")) == NULL) {
@@ -3282,9 +3281,9 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
zval str_headers;
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
} else {
- http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers TSRMLS_CC);
+ http_context_headers(context, has_authorization, has_proxy_authorization, 0, &headers);
}
smart_str_0(&headers);
@@ -3295,12 +3294,12 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
if (context) {
php_stream_context_to_zval(context, &new_context);
- php_libxml_switch_context(&new_context, &orig_context TSRMLS_CC);
+ php_libxml_switch_context(&new_context, &orig_context);
}
SOAP_GLOBAL(error_code) = "WSDL";
- sdl = load_wsdl(this_ptr, uri TSRMLS_CC);
+ sdl = load_wsdl(this_ptr, uri);
if (sdl) {
sdl->is_persistent = 0;
}
@@ -3308,13 +3307,13 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC)
SOAP_GLOBAL(error_code) = old_error_code;
if (context) {
- php_libxml_switch_context(&orig_context, NULL TSRMLS_CC);
+ php_libxml_switch_context(&orig_context, NULL);
zval_ptr_dtor(&new_context);
}
if ((cache_wsdl & WSDL_CACHE_DISK) && key) {
if (sdl) {
- add_sdl_to_cache(key, uri, t, sdl TSRMLS_CC);
+ add_sdl_to_cache(key, uri, t, sdl);
}
efree(key);
}
@@ -3348,7 +3347,7 @@ cache_in_memory:
}
}
- psdl = make_persistent_sdl(sdl TSRMLS_CC);
+ psdl = make_persistent_sdl(sdl);
psdl->is_persistent = 1;
p.time = t;
p.sdl = psdl;
@@ -3360,7 +3359,7 @@ cache_in_memory:
/* and replace it with persistent one */
sdl = psdl;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to register persistent entry");
+ php_error_docref(NULL, E_WARNING, "Failed to register persistent entry");
/* clean up persistent sdl */
delete_psdl_int(&p);
/* keep non-persistent sdl and return it */
diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h
index 9ecf40c067..37911a7bc5 100644
--- a/ext/soap/php_sdl.h
+++ b/ext/soap/php_sdl.h
@@ -254,7 +254,7 @@ struct _sdlAttribute {
};
-sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl TSRMLS_DC);
+sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl);
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
@@ -266,7 +266,7 @@ sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
void delete_sdl(void *handle);
void delete_sdl_impl(void *handle);
-void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC);
-void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC);
+void sdl_set_uri_credentials(sdlCtx *ctx, char *uri);
+void sdl_restore_uri_credentials(sdlCtx *ctx);
#endif
diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h
index e636ef39e7..f998587994 100644
--- a/ext/soap/php_soap.h
+++ b/ext/soap/php_soap.h
@@ -203,7 +203,7 @@ ZEND_TSRMLS_CACHE_EXTERN;
extern zend_class_entry* soap_var_class_entry;
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
+void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
#define soap_error0(severity, format) \
php_error(severity, "SOAP-ERROR: " format)
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index 5ad5548c40..de79c07a30 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -77,7 +77,7 @@ static void soap_Comment(void *ctx, const xmlChar *value)
{
}
-xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
+xmlDocPtr soap_xmlParseFile(const char *filename)
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
@@ -100,9 +100,9 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
ctxt->sax->warning = NULL;
ctxt->sax->error = NULL;
/*ctxt->sax->fatalError = NULL;*/
- old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
- php_libxml_disable_entity_loader(old TSRMLS_CC);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
@@ -133,7 +133,6 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
- TSRMLS_FETCH();
/*
xmlInitParser();
@@ -150,9 +149,9 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
#if LIBXML_VERSION >= 20703
ctxt->options |= XML_PARSE_HUGE;
#endif
- old = php_libxml_disable_entity_loader(1 TSRMLS_CC);
+ old = php_libxml_disable_entity_loader(1);
xmlParseDocument(ctxt);
- php_libxml_disable_entity_loader(old TSRMLS_CC);
+ php_libxml_disable_entity_loader(old);
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h
index 42d9dc9c6b..86cbf1b3ba 100644
--- a/ext/soap/php_xml.h
+++ b/ext/soap/php_xml.h
@@ -30,7 +30,7 @@
#define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
#define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
-xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC);
+xmlDocPtr soap_xmlParseFile(const char *filename);
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
xmlNsPtr attr_find_ns(xmlAttrPtr node);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index cf409cedf2..e2a9a84a15 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -49,21 +49,21 @@ typedef struct _soapHeader {
static void function_to_string(sdlFunctionPtr function, smart_str *buf);
static void type_to_string(sdlTypePtr type, smart_str *buf, int level);
-static void clear_soap_fault(zval *obj TSRMLS_DC);
-static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC);
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
-static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name TSRMLS_DC);
-static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr TSRMLS_DC);
+static void clear_soap_fault(zval *obj);
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name);
+static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char *name);
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr);
static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int index, int);
static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name);
static sdlFunctionPtr get_doc_function(sdlPtr sdl, xmlNodePtr node);
-static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers TSRMLS_DC);
-static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version TSRMLS_DC);
-static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC);
-static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent TSRMLS_DC);
-static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC);
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers);
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name,char *uri,zval *ret, soapHeader *headers, int version);
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers);
+static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int index,char *name, int style, xmlNodePtr parent);
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent);
static void delete_service(void *service);
static void delete_url(void *handle);
@@ -105,7 +105,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
CG(in_compilation) = _old_in_compilation; \
EG(current_execute_data) = _old_current_execute_data; \
if (EG(exception) == NULL || \
- !instanceof_function(EG(exception)->ce, soap_fault_class_entry TSRMLS_CC)) {\
+ !instanceof_function(EG(exception)->ce, soap_fault_class_entry)) {\
_bailout = 1;\
}\
if (_old_stack_top != EG(vm_stack_top)) { \
@@ -139,18 +139,18 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
#define FIND_SDL_PROPERTY(ss,tmp) (tmp = zend_hash_str_find(Z_OBJPROP_P(ss), "sdl", sizeof("sdl")-1))
-#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp TSRMLS_CC, -1, "sdl", NULL, 1, le_sdl)
+#define FETCH_SDL_RES(ss,tmp) ss = (sdlPtr) zend_fetch_resource(tmp, -1, "sdl", NULL, 1, le_sdl)
#define FIND_TYPEMAP_PROPERTY(ss,tmp) (tmp = zend_hash_str_find(Z_OBJPROP_P(ss), "typemap", sizeof("typemap")-1))
-#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp TSRMLS_CC, -1, "typemap", NULL, 1, le_typemap)
+#define FETCH_TYPEMAP_RES(ss,tmp) ss = (HashTable*) zend_fetch_resource(tmp, -1, "typemap", NULL, 1, le_typemap)
#define FETCH_THIS_SERVICE(ss) \
{ \
zval *tmp; \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(getThis()),"service", sizeof("service")-1)) != NULL) { \
- ss = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service); \
+ ss = (soapServicePtr)zend_fetch_resource(tmp, -1, "service", NULL, 1, le_service); \
} else { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch service object"); \
+ php_error_docref(NULL, E_WARNING, "Can not fetch service object"); \
SOAP_SERVER_END_CODE(); \
return; \
} \
@@ -509,12 +509,12 @@ static PHP_INI_MH(OnUpdateCacheDir)
p = new_value->val;
}
- if (PG(open_basedir) && *p && php_check_open_basedir(p TSRMLS_CC)) {
+ if (PG(open_basedir) && *p && php_check_open_basedir(p)) {
return FAILURE;
}
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -574,7 +574,7 @@ static void php_soap_prepare_globals()
zend_hash_str_add_ptr(&defEncNs, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)-1, SOAP_1_2_ENC_NS_PREFIX);
}
-static void php_soap_init_globals(zend_soap_globals *soap_globals TSRMLS_DC)
+static void php_soap_init_globals(zend_soap_globals *soap_globals)
{
soap_globals->defEnc = defEnc;
soap_globals->defEncIndex = defEncIndex;
@@ -621,22 +621,22 @@ PHP_RINIT_FUNCTION(soap)
return SUCCESS;
}
-static void delete_sdl_res(zend_resource *res TSRMLS_DC)
+static void delete_sdl_res(zend_resource *res)
{
delete_sdl(res->ptr);
}
-static void delete_url_res(zend_resource *res TSRMLS_DC)
+static void delete_url_res(zend_resource *res)
{
delete_url(res->ptr);
}
-static void delete_service_res(zend_resource *res TSRMLS_DC)
+static void delete_service_res(zend_resource *res)
{
delete_service(res->ptr);
}
-static void delete_hashtable_res(zend_resource *res TSRMLS_DC)
+static void delete_hashtable_res(zend_resource *res)
{
delete_hashtable(res->ptr);
}
@@ -668,26 +668,26 @@ PHP_MINIT_FUNCTION(soap)
INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions,
(zend_function *)&fe, NULL, NULL);
- soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_class_entry = zend_register_internal_class(&ce);
}
/* Register SoapVar class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, soap_var_functions);
- soap_var_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_var_class_entry = zend_register_internal_class(&ce);
/* Register SoapServer class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, soap_server_functions);
- soap_server_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_server_class_entry = zend_register_internal_class(&ce);
/* Register SoapFault class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
- soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C) TSRMLS_CC);
+ soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
/* Register SoapParam class */
INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
- soap_param_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_param_class_entry = zend_register_internal_class(&ce);
INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, soap_header_functions);
- soap_header_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ soap_header_class_entry = zend_register_internal_class(&ce);
le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number);
le_url = zend_register_list_destructors_ex(delete_url_res, NULL, "SOAP URL", module_number);
@@ -817,11 +817,11 @@ PHP_METHOD(SoapParam, SoapParam)
size_t name_length;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &data, &name, &name_length) == FAILURE) {
return;
}
if (name_length == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter name");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter name");
return;
}
@@ -842,15 +842,15 @@ PHP_METHOD(SoapHeader, SoapHeader)
zend_bool must_understand = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
return;
}
if (ns_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid namespace");
+ php_error_docref(NULL, E_WARNING, "Invalid namespace");
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid header name");
+ php_error_docref(NULL, E_WARNING, "Invalid header name");
return;
}
@@ -870,7 +870,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
} else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) {
add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid actor");
+ php_error_docref(NULL, E_WARNING, "Invalid actor");
}
}
@@ -882,7 +882,7 @@ PHP_METHOD(SoapFault, SoapFault)
size_t fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
zval *code = NULL, *details = NULL, *headerfault = NULL, *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s!z!s!z",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|s!z!s!z",
&code,
&fault_string, &fault_string_len,
&fault_actor, &fault_actor_len,
@@ -906,15 +906,15 @@ PHP_METHOD(SoapFault, SoapFault)
fault_code = Z_STRVAL_P(t_code);
fault_code_len = Z_STRLEN_P(t_code);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
if (fault_code != NULL && fault_code_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid fault code");
+ php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
if (name != NULL && name_len == 0) {
@@ -922,7 +922,7 @@ PHP_METHOD(SoapFault, SoapFault)
}
this_ptr = getThis();
- set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name TSRMLS_CC);
+ set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name);
if (headerfault != NULL) {
add_property_zval(this_ptr, "headerfault", headerfault);
}
@@ -944,10 +944,10 @@ PHP_METHOD(SoapFault, __toString)
}
this_ptr = getThis();
- faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC);
- faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1 TSRMLS_CC);
- file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1 TSRMLS_CC);
- line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1 TSRMLS_CC);
+ faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1);
+ faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1);
+ file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1);
+ line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1);
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(getThis())->function_table;
@@ -959,7 +959,7 @@ PHP_METHOD(SoapFault, __toString)
fci.params = NULL;
fci.no_separation = 1;
- zend_call_function(&fci, NULL TSRMLS_CC);
+ zend_call_function(&fci, NULL);
zval_ptr_dtor(&fci.function_name);
@@ -981,7 +981,7 @@ PHP_METHOD(SoapVar, SoapVar)
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
return;
}
@@ -992,7 +992,7 @@ PHP_METHOD(SoapVar, SoapVar)
if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) {
add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type ID");
+ php_error_docref(NULL, E_WARNING, "Invalid type ID");
return;
}
}
@@ -1016,7 +1016,7 @@ PHP_METHOD(SoapVar, SoapVar)
}
/* }}} */
-static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
+static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht)
{
zval *tmp;
HashTable *ht2;
@@ -1031,7 +1031,7 @@ static HashTable* soap_create_typemap(sdlPtr sdl, HashTable *ht TSRMLS_DC)
zend_string *name;
if (Z_TYPE_P(tmp) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong 'typemap' option");
+ php_error_docref(NULL, E_WARNING, "Wrong 'typemap' option");
return NULL;
}
ht2 = Z_ARRVAL_P(tmp);
@@ -1133,12 +1133,12 @@ PHP_METHOD(SoapServer, SoapServer)
SOAP_SERVER_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
service = emalloc(sizeof(soapService));
@@ -1156,7 +1156,7 @@ PHP_METHOD(SoapServer, SoapServer)
(Z_LVAL_P(tmp) == SOAP_1_1 || Z_LVAL_P(tmp) == SOAP_1_2)) {
version = Z_LVAL_P(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'soap_version' option must be SOAP_1_1 or SOAP_1_2");
+ php_error_docref(NULL, E_ERROR, "'soap_version' option must be SOAP_1_1 or SOAP_1_2");
}
}
@@ -1164,7 +1164,7 @@ PHP_METHOD(SoapServer, SoapServer)
Z_TYPE_P(tmp) == IS_STRING) {
service->uri = estrndup(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "actor", sizeof("actor")-1)) != NULL &&
@@ -1178,7 +1178,7 @@ PHP_METHOD(SoapServer, SoapServer)
encoding = xmlFindCharEncodingHandler(Z_STRVAL_P(tmp));
if (encoding == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
+ php_error_docref(NULL, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
} else {
service->encoding = encoding;
}
@@ -1217,7 +1217,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
service->version = version;
@@ -1227,7 +1227,7 @@ PHP_METHOD(SoapServer, SoapServer)
zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
if (Z_TYPE_P(wsdl) != IS_NULL) {
- service->sdl = get_sdl(getThis(), Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
+ service->sdl = get_sdl(getThis(), Z_STRVAL_P(wsdl), cache_wsdl);
if (service->uri == NULL) {
if (service->sdl->target_ns) {
service->uri = estrdup(service->sdl->target_ns);
@@ -1239,10 +1239,10 @@ PHP_METHOD(SoapServer, SoapServer)
}
if (typemap_ht) {
- service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
+ service->typemap = soap_create_typemap(service->sdl, typemap_ht);
}
- res = zend_register_resource(NULL, service, le_service TSRMLS_CC);
+ res = zend_register_resource(NULL, service, le_service);
add_property_resource(getThis(), "service", res);
SOAP_SERVER_END_CODE();
@@ -1261,17 +1261,17 @@ PHP_METHOD(SoapServer, setPersistence)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) != FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) != FAILURE) {
if (service->type == SOAP_CLASS) {
if (value == SOAP_PERSISTENCE_SESSION ||
value == SOAP_PERSISTENCE_REQUEST) {
service->soap_class.persistence = value;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
+ php_error_docref(NULL, E_WARNING, "Tried to set persistence with bogus value (%pd)", value);
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
+ php_error_docref(NULL, E_WARNING, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
return;
}
}
@@ -1295,11 +1295,11 @@ PHP_METHOD(SoapServer, setClass)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S*", &classname, &argv, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S*", &classname, &argv, &num_args) == FAILURE) {
return;
}
- ce = zend_lookup_class(classname TSRMLS_CC);
+ ce = zend_lookup_class(classname);
if (ce) {
service->type = SOAP_CLASS;
@@ -1315,7 +1315,7 @@ PHP_METHOD(SoapServer, setClass)
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existent class (%s)", classname->val);
+ php_error_docref(NULL, E_WARNING, "Tried to set a non existent class (%s)", classname->val);
return;
}
@@ -1335,7 +1335,7 @@ PHP_METHOD(SoapServer, setObject)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
@@ -1403,7 +1403,7 @@ PHP_METHOD(SoapServer, addFunction)
FETCH_THIS_SERVICE(service);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &function_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &function_name) == FAILURE) {
return;
}
@@ -1424,7 +1424,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_function *f;
if (Z_TYPE_P(tmp_function) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a function that isn't a string");
+ php_error_docref(NULL, E_WARNING, "Tried to add a function that isn't a string");
return;
}
@@ -1432,7 +1432,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_str_tolower_copy(key->val, Z_STRVAL_P(tmp_function), Z_STRLEN_P(tmp_function));
if ((f = zend_hash_find_ptr(EG(function_table), key)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(tmp_function));
+ php_error_docref(NULL, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(tmp_function));
return;
}
@@ -1450,7 +1450,7 @@ PHP_METHOD(SoapServer, addFunction)
zend_str_tolower_copy(key->val, Z_STRVAL_P(function_name), Z_STRLEN_P(function_name));
if ((f = zend_hash_find_ptr(EG(function_table), key)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name));
+ php_error_docref(NULL, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name));
return;
}
if (service->soap_functions.ft == NULL) {
@@ -1471,7 +1471,7 @@ PHP_METHOD(SoapServer, addFunction)
}
service->soap_functions.functions_all = TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value passed");
+ php_error_docref(NULL, E_WARNING, "Invalid value passed");
return;
}
}
@@ -1507,7 +1507,7 @@ PHP_METHOD(SoapServer, handle)
FETCH_THIS_SERVICE(service);
SOAP_GLOBAL(soap_version) = service->version;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -1529,8 +1529,8 @@ PHP_METHOD(SoapServer, handle)
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
ZVAL_STRING(&param, service->sdl->source);
ZVAL_STRING(&readfile, "readfile");
- if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param TSRMLS_CC) == FAILURE) {
- soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL TSRMLS_CC);
+ if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param ) == FAILURE) {
+ soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL);
}
zval_ptr_dtor(&param);
@@ -1540,7 +1540,7 @@ PHP_METHOD(SoapServer, handle)
SOAP_SERVER_END_CODE();
return;
} else {
- soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL);
/*
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
@@ -1557,8 +1557,8 @@ PHP_METHOD(SoapServer, handle)
ZVAL_NULL(&retval);
- if (php_output_start_default(TSRMLS_C) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR,"ob_start failed");
+ if (php_output_start_default() != SUCCESS) {
+ php_error_docref(NULL, E_ERROR,"ob_start failed");
}
if (ZEND_NUM_ARGS() == 0) {
@@ -1567,7 +1567,7 @@ PHP_METHOD(SoapServer, handle)
php_stream_filter *zf = NULL;
zend_string *server = zend_string_init("_SERVER", sizeof("_SERVER")-1, 0);
- zend_is_auto_global(server TSRMLS_CC);
+ zend_is_auto_global(server);
if ((server_vars = zend_hash_find(&EG(symbol_table).ht, server)) != NULL &&
Z_TYPE_P(server_vars) == IS_ARRAY &&
(encoding = zend_hash_str_find(Z_ARRVAL_P(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING")-1)) != NULL &&
@@ -1582,28 +1582,28 @@ PHP_METHOD(SoapServer, handle)
array_init_size(&filter_params, 1);
add_assoc_long_ex(&filter_params, "window", sizeof("window")-1, 0x2f); /* ANY WBITS */
- zf = php_stream_filter_create("zlib.inflate", &filter_params, 0 TSRMLS_CC);
+ zf = php_stream_filter_create("zlib.inflate", &filter_params, 0);
zval_dtor(&filter_params);
if (zf) {
php_stream_filter_append(&SG(request_info).request_body->readfilters, zf);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Can't uncompress compressed request");
+ php_error_docref(NULL, E_WARNING,"Can't uncompress compressed request");
zend_string_release(server);
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_P(encoding));
+ php_error_docref(NULL, E_WARNING,"Request is compressed with unknown compression '%s'",Z_STRVAL_P(encoding));
zend_string_release(server);
return;
}
}
zend_string_release(server);
- doc_request = soap_xmlParseFile("php://input" TSRMLS_CC);
+ doc_request = soap_xmlParseFile("php://input");
if (zf) {
- php_stream_filter_remove(zf, 1 TSRMLS_CC);
+ php_stream_filter_remove(zf, 1);
}
} else {
zval_ptr_dtor(&retval);
@@ -1614,7 +1614,7 @@ PHP_METHOD(SoapServer, handle)
}
if (doc_request == NULL) {
- soap_server_fault("Client", "Bad Request", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Bad Request", NULL, NULL, NULL);
}
if (xmlGetIntSubset(doc_request) != NULL) {
xmlNodePtr env = get_node(doc_request->children,"Envelope");
@@ -1626,7 +1626,7 @@ PHP_METHOD(SoapServer, handle)
}
}
xmlFreeDoc(doc_request);
- soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL);
}
old_sdl = SOAP_GLOBAL(sdl);
@@ -1640,16 +1640,16 @@ PHP_METHOD(SoapServer, handle)
old_features = SOAP_GLOBAL(features);
SOAP_GLOBAL(features) = service->features;
old_soap_version = SOAP_GLOBAL(soap_version);
- function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers TSRMLS_CC);
+ function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, &params, &soap_version, &soap_headers);
xmlFreeDoc(doc_request);
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
goto fail;
}
@@ -1669,7 +1669,7 @@ PHP_METHOD(SoapServer, handle)
if (PS(session_status) != php_session_active &&
PS(session_status) != php_session_disabled) {
- php_session_start(TSRMLS_C);
+ php_session_start();
}
/* Find the soap object and assign */
@@ -1694,16 +1694,16 @@ PHP_METHOD(SoapServer, handle)
zval c_ret, constructor;
ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME);
- if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Error calling constructor");
}
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
zval_dtor(&constructor);
zval_dtor(&c_ret);
@@ -1721,17 +1721,17 @@ PHP_METHOD(SoapServer, handle)
zval c_ret, constructor;
ZVAL_STR_COPY(&constructor, service->soap_class.ce->name);
- if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
+ if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Error calling constructor");
}
if (EG(exception)) {
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
zval_dtor(&constructor);
zval_dtor(&c_ret);
@@ -1787,7 +1787,7 @@ PHP_METHOD(SoapServer, handle)
#if 0
if (service->sdl && !h->function && !h->hdr) {
if (h->mustUnderstand) {
- soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
} else {
continue;
}
@@ -1798,16 +1798,16 @@ PHP_METHOD(SoapServer, handle)
((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_str_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
- call_status = call_user_function(NULL, soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ call_status = call_user_function(NULL, soap_obj, &h->function_name, &h->retval, h->num_params, h->parameters);
} else {
- call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
+ call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters);
}
if (call_status != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(h->function_name));
+ php_error_docref(NULL, E_WARNING, "Function '%s' call failed", Z_STRVAL(h->function_name));
return;
}
if (Z_TYPE(h->retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(h->retval), soap_fault_class_entry)) {
//??? zval *headerfault = NULL;
zval *tmp;
@@ -1815,8 +1815,8 @@ PHP_METHOD(SoapServer, handle)
Z_TYPE_P(tmp) != IS_NULL) {
//??? headerfault = tmp;
}
- php_output_discard(TSRMLS_C);
- soap_server_fault_ex(function, &h->retval, h TSRMLS_CC);
+ php_output_discard();
+ soap_server_fault_ex(function, &h->retval, h);
efree(fn_name);
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(soap_obj);}
goto fail;
@@ -1824,8 +1824,8 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
//??? zval *headerfault = NULL;
zval *tmp;
@@ -1833,14 +1833,14 @@ PHP_METHOD(SoapServer, handle)
Z_TYPE_P(tmp) != IS_NULL) {
//??? headerfault = tmp;
}
- soap_server_fault_ex(function, &exception_object, h TSRMLS_CC);
+ soap_server_fault_ex(function, &exception_object, h);
}
efree(fn_name);
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(soap_obj);}
goto fail;
}
} else if (h->mustUnderstand) {
- soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
}
efree(fn_name);
}
@@ -1851,7 +1851,7 @@ PHP_METHOD(SoapServer, handle)
((service->type == SOAP_CLASS || service->type == SOAP_OBJECT) &&
zend_hash_str_exists(function_table, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (service->type == SOAP_CLASS || service->type == SOAP_OBJECT) {
- call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params TSRMLS_CC);
+ call_status = call_user_function(NULL, soap_obj, &function_name, &retval, num_params, params);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
if (service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
@@ -1864,7 +1864,7 @@ PHP_METHOD(SoapServer, handle)
#endif
}
} else {
- call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params TSRMLS_CC);
+ call_status = call_user_function(EG(function_table), NULL, &function_name, &retval, num_params, params);
}
} else {
php_error(E_ERROR, "Function '%s' doesn't exist", Z_STRVAL(function_name));
@@ -1875,9 +1875,9 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
@@ -1895,9 +1895,9 @@ PHP_METHOD(SoapServer, handle)
char *response_name;
if (Z_TYPE(retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(retval), soap_fault_class_entry TSRMLS_CC)) {
- php_output_discard(TSRMLS_C);
- soap_server_fault_ex(function, &retval, NULL TSRMLS_CC);
+ instanceof_function(Z_OBJCE(retval), soap_fault_class_entry)) {
+ php_output_discard();
+ soap_server_fault_ex(function, &retval, NULL);
goto fail;
}
@@ -1908,10 +1908,10 @@ PHP_METHOD(SoapServer, handle)
memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name));
memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response"));
}
- doc_return = serialize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version TSRMLS_CC);
+ doc_return = serialize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version);
efree(response_name);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function '%s' call failed", Z_STRVAL(function_name));
+ php_error_docref(NULL, E_WARNING, "Function '%s' call failed", Z_STRVAL(function_name));
return;
}
@@ -1919,9 +1919,9 @@ PHP_METHOD(SoapServer, handle)
zval exception_object;
ZVAL_OBJ(&exception_object, EG(exception));
- php_output_discard(TSRMLS_C);
- if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry TSRMLS_CC)) {
- soap_server_fault_ex(function, &exception_object, NULL TSRMLS_CC);
+ php_output_discard();
+ if (instanceof_function(Z_OBJCE(exception_object), soap_fault_class_entry)) {
+ soap_server_fault_ex(function, &exception_object, NULL);
}
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
@@ -1936,14 +1936,14 @@ PHP_METHOD(SoapServer, handle)
}
/* Flush buffer */
- php_output_discard(TSRMLS_C);
+ php_output_discard();
if (doc_return) {
/* xmlDocDumpMemoryEnc(doc_return, &buf, &size, XML_CHAR_ENCODING_UTF8); */
xmlDocDumpMemory(doc_return, &buf, &size);
if (size == 0) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed");
+ php_error_docref(NULL, E_ERROR, "Dump memory failed");
}
if (soap_version == SOAP_1_2) {
@@ -1960,7 +1960,7 @@ PHP_METHOD(SoapServer, handle)
snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
sapi_add_header(cont_len, strlen(cont_len), 1);
}
- php_write(buf, size TSRMLS_CC);
+ php_write(buf, size);
xmlFree(buf);
} else {
sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 Accepted")-1, 1);
@@ -2024,13 +2024,13 @@ PHP_METHOD(SoapServer, fault)
old_encoding = SOAP_GLOBAL(encoding);
SOAP_GLOBAL(encoding) = service->encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szs",
&code, &code_len, &string, &string_len, &actor, &actor_len, &details,
&name, &name_len) == FAILURE) {
return;
}
- soap_server_fault(code, string, actor, details, name TSRMLS_CC);
+ soap_server_fault(code, string, actor, details, name);
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_SERVER_END_CODE();
@@ -2048,11 +2048,11 @@ PHP_METHOD(SoapServer, addSoapHeader)
FETCH_THIS_SERVICE(service);
if (!service || !service->soap_headers_ptr) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
+ php_error_docref(NULL, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &fault, soap_header_class_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &fault, soap_header_class_entry) == FAILURE) {
return;
}
@@ -2069,7 +2069,7 @@ PHP_METHOD(SoapServer, addSoapHeader)
SOAP_SERVER_END_CODE();
}
-static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC)
+static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr)
{
int soap_version;
xmlChar *buf;
@@ -2082,12 +2082,12 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
soap_version = SOAP_GLOBAL(soap_version);
- doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version TSRMLS_CC);
+ doc_return = serialize_response_call(function, NULL, NULL, fault, hdr, soap_version);
xmlDocDumpMemory(doc_return, &buf, &size);
server = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(server TSRMLS_CC);
+ zend_is_auto_global(server);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF &&
(agent_name = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) != NULL &&
Z_TYPE_P(agent_name) == IS_STRING) {
@@ -2115,21 +2115,21 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8")-1, 1);
}
- php_write(buf, size TSRMLS_CC);
+ php_write(buf, size);
xmlFreeDoc(doc_return);
xmlFree(buf);
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
-static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name TSRMLS_DC)
+static void soap_server_fault(char* code, char* string, char *actor, zval* details, char* name)
{
zval ret;
ZVAL_NULL(&ret);
- set_soap_fault(&ret, NULL, code, string, actor, details, name TSRMLS_CC);
+ set_soap_fault(&ret, NULL, code, string, actor, details, name);
/* TODO: Which function */
- soap_server_fault_ex(NULL, &ret, NULL TSRMLS_CC);
+ soap_server_fault_ex(NULL, &ret, NULL);
zend_bailout();
}
@@ -2139,7 +2139,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
zend_execute_data *_old_current_execute_data;
int _old_http_response_code;
char *_old_http_status_line;
- TSRMLS_FETCH();
_old_in_compilation = CG(in_compilation);
_old_current_execute_data = EG(current_execute_data);
@@ -2152,7 +2151,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
if (Z_OBJ(SOAP_GLOBAL(error_object)) &&
- instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_class_entry)) {
zval *tmp;
int use_exceptions = 0;
@@ -2195,9 +2194,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
if (code == NULL) {
code = "Client";
}
- add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL TSRMLS_CC);
+ add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, buffer, NULL, NULL);
Z_ADDREF(fault);
- zend_throw_exception_object(&fault TSRMLS_CC);
+ zend_throw_exception_object(&fault);
old_objects = EG(objects_store).object_buckets;
EG(objects_store).object_buckets = NULL;
@@ -2248,9 +2247,9 @@ static void soap_error_handler(int error_num, const char *error_filename, const
code = "Server";
}
if (Z_OBJ(SOAP_GLOBAL(error_object)) &&
- instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_server_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE(SOAP_GLOBAL(error_object)), soap_server_class_entry) &&
(tmp = zend_hash_str_find(Z_OBJPROP(SOAP_GLOBAL(error_object)), "service", sizeof("service")-1)) != NULL &&
- (service = (soapServicePtr)zend_fetch_resource(tmp TSRMLS_CC, -1, "service", NULL, 1, le_service)) &&
+ (service = (soapServicePtr)zend_fetch_resource(tmp, -1, "service", NULL, 1, le_service)) &&
!service->send_errors) {
strcpy(buffer, "Internal Error");
} else {
@@ -2272,14 +2271,14 @@ static void soap_error_handler(int error_num, const char *error_filename, const
}
/* Get output buffer and send as fault detials */
- if (php_output_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_LVAL(outbuflen) != 0) {
- php_output_get_contents(&outbuf TSRMLS_CC);
+ if (php_output_get_length(&outbuflen) != FAILURE && Z_LVAL(outbuflen) != 0) {
+ php_output_get_contents(&outbuf);
}
- php_output_discard(TSRMLS_C);
+ php_output_discard();
}
ZVAL_NULL(&fault_obj);
- set_soap_fault(&fault_obj, NULL, code, buffer, NULL, &outbuf, NULL TSRMLS_CC);
+ set_soap_fault(&fault_obj, NULL, code, buffer, NULL, &outbuf, NULL);
fault = 1;
}
@@ -2299,7 +2298,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
PG(display_errors) = old;
if (fault) {
- soap_server_fault_ex(NULL, &fault_obj, NULL TSRMLS_CC);
+ soap_server_fault_ex(NULL, &fault_obj, NULL);
zend_bailout();
}
}
@@ -2310,7 +2309,7 @@ PHP_FUNCTION(use_soap_error_handler)
zend_bool handler = 1;
ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler));
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &handler) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &handler) == SUCCESS) {
SOAP_GLOBAL(use_soap_error_handler) = handler;
}
}
@@ -2319,9 +2318,9 @@ PHP_FUNCTION(is_soap_fault)
{
zval *fault;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS &&
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &fault) == SUCCESS &&
Z_TYPE_P(fault) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(fault), soap_fault_class_entry)) {
RETURN_TRUE;
}
RETURN_FALSE
@@ -2344,12 +2343,12 @@ PHP_METHOD(SoapClient, SoapClient)
SOAP_CLIENT_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ php_error_docref(NULL, E_ERROR, "Invalid parameters");
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "$wsdl must be string or null");
+ php_error_docref(NULL, E_ERROR, "$wsdl must be string or null");
}
cache_wsdl = SOAP_GLOBAL(cache_enabled) ? SOAP_GLOBAL(cache_mode) : 0;
@@ -2364,7 +2363,7 @@ PHP_METHOD(SoapClient, SoapClient)
Z_TYPE_P(tmp) == IS_STRING) {
add_property_str(this_ptr, "uri", zend_string_copy(Z_STR_P(tmp)));
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "style", sizeof("style")-1)) != NULL &&
@@ -2390,7 +2389,7 @@ PHP_METHOD(SoapClient, SoapClient)
Z_TYPE_P(tmp) == IS_STRING) {
add_property_str(this_ptr, "location", zend_string_copy(Z_STR_P(tmp)));
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'location' option is required in nonWSDL mode");
}
if ((tmp = zend_hash_str_find(ht, "soap_version", sizeof("soap_version")-1)) != NULL) {
@@ -2434,7 +2433,7 @@ PHP_METHOD(SoapClient, SoapClient)
if ((tmp = zend_hash_str_find(ht, "local_cert", sizeof("local_cert")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
if (!context) {
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "ssl", "local_cert", tmp);
if ((tmp = zend_hash_str_find(ht, "passphrase", sizeof("passphrase")-1)) != NULL &&
@@ -2469,7 +2468,7 @@ PHP_METHOD(SoapClient, SoapClient)
encoding = xmlFindCharEncodingHandler(Z_STRVAL_P(tmp));
if (encoding == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
+ php_error_docref(NULL, E_ERROR, "Invalid 'encoding' option - '%s'", Z_STRVAL_P(tmp));
} else {
xmlCharEncCloseFunc(encoding);
add_property_str(this_ptr, "_encoding", zend_string_copy(Z_STR_P(tmp)));
@@ -2532,7 +2531,7 @@ PHP_METHOD(SoapClient, SoapClient)
add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp));
}
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
+ php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
}
add_property_long(this_ptr, "_soap_version", soap_version);
@@ -2544,8 +2543,8 @@ PHP_METHOD(SoapClient, SoapClient)
old_soap_version = SOAP_GLOBAL(soap_version);
SOAP_GLOBAL(soap_version) = soap_version;
- sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
- res = zend_register_resource(NULL, sdl, le_sdl TSRMLS_CC);
+ sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl);
+ res = zend_register_resource(NULL, sdl, le_sdl);
add_property_resource(this_ptr, "sdl", res);
@@ -2553,11 +2552,11 @@ PHP_METHOD(SoapClient, SoapClient)
}
if (typemap_ht) {
- HashTable *typemap = soap_create_typemap(sdl, typemap_ht TSRMLS_CC);
+ HashTable *typemap = soap_create_typemap(sdl, typemap_ht);
if (typemap) {
zend_resource *res;
- res = zend_register_resource(NULL, typemap, le_typemap TSRMLS_CC);
+ res = zend_register_resource(NULL, typemap, le_typemap);
add_property_resource(this_ptr, "typemap", res);
}
}
@@ -2565,7 +2564,7 @@ PHP_METHOD(SoapClient, SoapClient)
}
/* }}} */
-static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response TSRMLS_DC)
+static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response)
{
int ret = TRUE;
char *buf;
@@ -2579,7 +2578,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size);
if (!buf) {
- add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL);
return FALSE;
}
@@ -2603,12 +2602,12 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
ZVAL_LONG(&params[3], version);
ZVAL_LONG(&params[4], one_way);
- if (call_user_function(NULL, this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) {
- add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL TSRMLS_CC);
+ if (call_user_function(NULL, this_ptr, &func, response, 5, params) != SUCCESS) {
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL);
ret = FALSE;
} else if (Z_TYPE_P(response) != IS_STRING) {
if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) == NULL) {
- add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL);
}
ret = FALSE;
} else if ((trace = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace")-1)) != NULL &&
@@ -2640,7 +2639,7 @@ static void do_soap_call(zend_execute_data *execute_data,
char* call_uri,
HashTable* soap_headers,
zval* output_headers
- TSRMLS_DC)
+ )
{
zval *tmp;
zval *trace;
@@ -2684,7 +2683,7 @@ static void do_soap_call(zend_execute_data *execute_data,
FETCH_TYPEMAP_RES(typemap,tmp);
}
- clear_soap_fault(this_ptr TSRMLS_CC);
+ clear_soap_fault(this_ptr);
SOAP_GLOBAL(soap_version) = soap_version;
old_sdl = SOAP_GLOBAL(sdl);
@@ -2731,18 +2730,18 @@ static void do_soap_call(zend_execute_data *execute_data,
}
if (binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
- request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response TSRMLS_CC);
+ request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers);
+ ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response);
} else {
- request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
- ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response TSRMLS_CC);
+ request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers);
+ ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response);
}
xmlFreeDoc(request);
if (ret && Z_TYPE(response) == IS_STRING) {
encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers TSRMLS_CC);
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), fn, NULL, return_value, output_headers);
encode_finish();
}
@@ -2754,7 +2753,7 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str_appends(&error,function);
smart_str_appends(&error,"\") is not a valid method for this service");
smart_str_0(&error);
- add_soap_fault(this_ptr, "Client", error.s->val, NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", error.s->val, NULL, NULL);
smart_str_free(&error);
}
} else {
@@ -2762,14 +2761,14 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str action = {0};
if ((uri = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "uri", sizeof("uri")-1)) == NULL) {
- add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL);
} else if (location == NULL) {
- add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL TSRMLS_CC);
+ add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL);
} else {
if (call_uri == NULL) {
call_uri = Z_STRVAL_P(uri);
}
- request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers TSRMLS_CC);
+ request = serialize_function_call(this_ptr, NULL, function, call_uri, real_args, arg_count, soap_version, soap_headers);
if (soap_action == NULL) {
smart_str_appends(&action, call_uri);
@@ -2780,14 +2779,14 @@ static void do_soap_call(zend_execute_data *execute_data,
}
smart_str_0(&action);
- ret = do_request(this_ptr, request, location, action.s->val, soap_version, 0, &response TSRMLS_CC);
+ ret = do_request(this_ptr, request, location, action.s->val, soap_version, 0, &response);
smart_str_free(&action);
xmlFreeDoc(request);
if (ret && Z_TYPE(response) == IS_STRING) {
encode_reset_ns();
- ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers TSRMLS_CC);
+ ret = parse_packet_soap(this_ptr, Z_STRVAL(response), Z_STRLEN(response), NULL, function, return_value, output_headers);
encode_finish();
}
@@ -2800,7 +2799,7 @@ static void do_soap_call(zend_execute_data *execute_data,
if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) != NULL) {
ZVAL_COPY(return_value, fault);
} else {
- add_soap_fault_ex(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL TSRMLS_CC);
+ add_soap_fault_ex(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL);
}
} else {
zval* fault;
@@ -2811,11 +2810,11 @@ static void do_soap_call(zend_execute_data *execute_data,
if (!EG(exception) &&
Z_TYPE_P(return_value) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
+ instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry) &&
((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_exceptions", sizeof("_exceptions")-1)) == NULL ||
Z_TYPE_P(tmp) != IS_FALSE)) {
Z_ADDREF_P(return_value);
- zend_throw_exception_object(return_value TSRMLS_CC);
+ zend_throw_exception_object(return_value);
}
} zend_catch {
@@ -2838,14 +2837,14 @@ static void do_soap_call(zend_execute_data *execute_data,
SOAP_CLIENT_END_CODE();
}
-static void verify_soap_headers_array(HashTable *ht TSRMLS_DC)
+static void verify_soap_headers_array(HashTable *ht)
{
zval *tmp;
ZEND_HASH_FOREACH_VAL(ht, tmp) {
if (Z_TYPE_P(tmp) != IS_OBJECT ||
- !instanceof_function(Z_OBJCE_P(tmp), soap_header_class_entry TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid SOAP header");
+ !instanceof_function(Z_OBJCE_P(tmp), soap_header_class_entry)) {
+ php_error_docref(NULL, E_ERROR, "Invalid SOAP header");
}
} ZEND_HASH_FOREACH_END();
}
@@ -2870,7 +2869,7 @@ PHP_METHOD(SoapClient, __call)
zend_bool free_soap_headers = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|a!zz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sa|a!zz/",
&function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
return;
}
@@ -2896,17 +2895,17 @@ PHP_METHOD(SoapClient, __call)
if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) {
} else if (Z_TYPE_P(headers) == IS_ARRAY) {
soap_headers = Z_ARRVAL_P(headers);
- verify_soap_headers_array(soap_headers TSRMLS_CC);
+ verify_soap_headers_array(soap_headers);
free_soap_headers = 0;
} else if (Z_TYPE_P(headers) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) {
soap_headers = emalloc(sizeof(HashTable));
zend_hash_init(soap_headers, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_next_index_insert(soap_headers, headers);
Z_ADDREF_P(headers);
free_soap_headers = 1;
} else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ php_error_docref(NULL, E_WARNING, "Invalid SOAP header");
return;
}
@@ -2944,7 +2943,7 @@ PHP_METHOD(SoapClient, __call)
if (output_headers) {
array_init(output_headers);
}
- do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
+ do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers);
if (arg_count > 0) {
efree(real_args);
}
@@ -3095,7 +3094,7 @@ PHP_METHOD(SoapClient, __doRequest)
zend_long one_way = 0;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssl|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sssl|l",
&buf, &buf_size,
&location, &location_size,
&action, &action_size,
@@ -3106,11 +3105,11 @@ PHP_METHOD(SoapClient, __doRequest)
one_way = 0;
}
if (one_way) {
- if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL TSRMLS_CC)) {
+ if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version, NULL)) {
RETURN_EMPTY_STRING();
}
} else if (make_http_soap_request(this_ptr, buf, buf_size, location, action, version,
- return_value TSRMLS_CC)) {
+ return_value)) {
return;
}
RETURN_NULL();
@@ -3129,7 +3128,7 @@ PHP_METHOD(SoapClient, __setCookie)
zval *cookies;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
return;
}
@@ -3183,7 +3182,7 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
zval *headers = NULL;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &headers) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &headers) == FAILURE) {
return;
}
@@ -3192,12 +3191,12 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
} else if (Z_TYPE_P(headers) == IS_ARRAY) {
zval *default_headers;
- verify_soap_headers_array(Z_ARRVAL_P(headers) TSRMLS_CC);
+ verify_soap_headers_array(Z_ARRVAL_P(headers));
if ((default_headers = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) == NULL) {
add_property_zval(this_ptr, "__default_headers", headers);
}
} else if (Z_TYPE_P(headers) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) {
zval default_headers;
array_init(&default_headers);
@@ -3206,7 +3205,7 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
add_property_zval(this_ptr, "__default_headers", &default_headers);
Z_DELREF_P(&default_headers);
} else{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid SOAP header");
+ php_error_docref(NULL, E_WARNING, "Invalid SOAP header");
}
RETURN_TRUE;
}
@@ -3227,7 +3226,7 @@ PHP_METHOD(SoapClient, __setLocation)
zval *tmp;
zval *this_ptr = getThis();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &location, &location_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &location, &location_len) == FAILURE) {
return;
}
@@ -3245,39 +3244,39 @@ PHP_METHOD(SoapClient, __setLocation)
}
/* }}} */
-static void clear_soap_fault(zval *obj TSRMLS_DC)
+static void clear_soap_fault(zval *obj)
{
if (obj != NULL && Z_TYPE_P(obj) == IS_OBJECT) {
zend_hash_str_del(Z_OBJPROP_P(obj), "__soap_fault", sizeof("__soap_fault")-1);
}
}
-static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC)
+static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
ZVAL_NULL(fault);
- set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
+ set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL);
add_property_zval(obj, "__soap_fault", fault);
Z_DELREF_P(fault);
}
-void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC)
+void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
zval fault;
ZVAL_NULL(&fault);
- set_soap_fault(&fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
+ set_soap_fault(&fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL);
add_property_zval(obj, "__soap_fault", &fault);
Z_DELREF(fault);
}
-static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name TSRMLS_DC)
+static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, char *name)
{
if (Z_TYPE_P(obj) != IS_OBJECT) {
object_init_ex(obj, soap_fault_class_entry);
}
add_property_string(obj, "faultstring", fault_string ? fault_string : "");
- zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, (fault_string ? fault_string : "") TSRMLS_CC);
+ zend_update_property_string(zend_exception_get_default(), obj, "message", sizeof("message")-1, (fault_string ? fault_string : ""));
if (fault_code != NULL) {
int soap_version = SOAP_GLOBAL(soap_version);
@@ -3323,7 +3322,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
}
}
-static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval **parameters TSRMLS_DC)
+static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, int *num_params, zval **parameters)
{
int cur_param = 0,num_of_params = 0;
zval *tmp_parameters = NULL;
@@ -3350,7 +3349,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
/* TODO: may be "nil" is not OK? */
ZVAL_NULL(&tmp_parameters[cur_param]);
} else {
- master_to_zval(&tmp_parameters[cur_param], param->encode, val TSRMLS_CC);
+ master_to_zval(&tmp_parameters[cur_param], param->encode, val);
}
cur_param++;
} ZEND_HASH_FOREACH_END();
@@ -3390,15 +3389,14 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
sdlParamPtr param = NULL;
if (function != NULL &&
(param = zend_hash_index_find_ptr(function->requestParameters, cur_param)) == NULL) {
- TSRMLS_FETCH();
- soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL);
}
if (param == NULL) {
enc = NULL;
} else {
enc = param->encode;
}
- master_to_zval(&tmp_parameters[cur_param], enc, trav TSRMLS_CC);
+ master_to_zval(&tmp_parameters[cur_param], enc, trav);
cur_param++;
}
trav = trav->next;
@@ -3406,7 +3404,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i
}
}
if (num_of_params > cur_param) {
- soap_server_fault("Client","Missing parameter", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Missing parameter", NULL, NULL, NULL);
}
(*parameters) = tmp_parameters;
(*num_params) = num_of_params;
@@ -3440,7 +3438,7 @@ static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_
return function;
}
-static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers TSRMLS_DC)
+static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, char* actor, zval *function_name, int *num_params, zval **parameters, int *version, soapHeader **headers)
{
char* envelope_ns = NULL;
xmlNodePtr trav,env,head,body,func;
@@ -3465,24 +3463,24 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
SOAP_GLOBAL(soap_version) = SOAP_1_2;
} else {
- soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL);
}
}
trav = trav->next;
}
if (env == NULL) {
- soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL);
}
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3512,26 +3510,26 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
trav = trav->next;
}
if (body == NULL) {
- soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL);
}
attr = body->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
}
if (trav != NULL && *version == SOAP_1_2) {
- soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL);
}
func = NULL;
@@ -3540,7 +3538,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (trav->type == XML_ELEMENT_NODE) {
/*
if (func != NULL) {
- soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL);
}
*/
func = trav;
@@ -3553,24 +3551,24 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (function != NULL) {
ZVAL_STRING(function_name, (char *)function->functionName);
} else {
- soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL);
}
} else {
if (*version == SOAP_1_1) {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
} else {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
}
function = find_function(sdl, func, function_name);
if (sdl != NULL && function == NULL) {
if (*version == SOAP_1_2) {
- soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL);
} else {
php_error(E_ERROR, "Procedure '%s' not present", func->name);
}
@@ -3584,12 +3582,12 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3603,7 +3601,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (*version == SOAP_1_1) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
if (attr != NULL) {
@@ -3615,7 +3613,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} else if (*version == SOAP_1_2) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
- soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
if (attr != NULL) {
@@ -3635,7 +3633,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
- soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL);
}
}
h = emalloc(sizeof(soapHeader));
@@ -3663,7 +3661,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (h->hdr) {
h->num_params = 1;
h->parameters = emalloc(sizeof(zval));
- master_to_zval(&h->parameters[0], h->hdr->encode, hdr_func TSRMLS_CC);
+ master_to_zval(&h->parameters[0], h->hdr->encode, hdr_func);
} else {
if (h->function && h->function->binding && h->function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)h->function->bindingAttributes;
@@ -3671,7 +3669,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
hdr_func = hdr_func->children;
}
}
- deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters TSRMLS_CC);
+ deserialize_parameters(hdr_func, h->function, &h->num_params, &h->parameters);
}
ZVAL_NULL(&h->retval);
if (last == NULL) {
@@ -3694,7 +3692,7 @@ ignore_header:
} else {
func = func->children;
}
- deserialize_parameters(func, function, num_params, parameters TSRMLS_CC);
+ deserialize_parameters(func, function, num_params, parameters);
encode_finish();
@@ -3738,7 +3736,7 @@ static void set_soap_header_attributes(xmlNodePtr h, HashTable *ht, int version)
}
}
-static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node TSRMLS_DC)
+static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node)
{
xmlNodePtr method = NULL, param;
sdlParamPtr parameter = NULL;
@@ -3786,13 +3784,13 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
if (main && version == SOAP_1_2) {
xmlNs *rpc_ns = xmlNewNs(body, BAD_CAST(RPC_SOAP12_NAMESPACE), BAD_CAST(RPC_SOAP12_NS_PREFIX));
rpc_result = xmlNewChild(method, rpc_ns, BAD_CAST("result"), NULL);
- param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, method);
xmlNodeSetContent(rpc_result,param->name);
} else {
- param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, method);
}
} else {
- param = serialize_parameter(parameter, ret, 0, "return", use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, ret, 0, "return", use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -3815,9 +3813,9 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(ret), param_index, param_name, data) {
parameter = get_param(function, param_name->val, param_index, TRUE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, data, i, param_name->val, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, data, i, param_name->val, use, method);
} else {
- param = serialize_parameter(parameter, data, i, param_name->val, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, data, i, param_name->val, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -3840,7 +3838,7 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
return use;
}
-static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version TSRMLS_DC)
+static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function_name, char *uri, zval *ret, soapHeader* headers, int version)
{
xmlDocPtr doc;
xmlNodePtr envelope = NULL, body, param;
@@ -3863,12 +3861,12 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
- soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL);
}
xmlDocSetRootElement(doc, envelope);
if (Z_TYPE_P(ret) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(ret), soap_fault_class_entry)) {
char *detail_name;
HashTable* prop;
zval *tmp;
@@ -3887,7 +3885,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
if (Z_TYPE_P(hdr_ret) == IS_OBJECT &&
- instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry)) {
HashTable* ht = Z_OBJPROP_P(hdr_ret);
sdlSoapBindingFunctionHeaderPtr hdr;
smart_str key = {0};
@@ -3918,11 +3916,11 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
if (headers->function) {
- if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
} else {
- xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
@@ -3987,7 +3985,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (version == SOAP_1_1) {
if ((tmp = zend_hash_str_find(prop, "faultcode", sizeof("faultcode")-1)) != NULL) {
xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
- zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL TSRMLS_CC);
+ zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL);
xmlAddChild(param, node);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
@@ -4000,18 +3998,18 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
zend_string_release(str);
}
if ((tmp = zend_hash_str_find(prop, "faultstring", sizeof("faultstring")-1)) != NULL) {
- xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param);
xmlNodeSetName(node, BAD_CAST("faultstring"));
}
if ((tmp = zend_hash_str_find(prop, "faultactor", sizeof("faultactor")-1)) != NULL) {
- xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param TSRMLS_CC);
+ xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, param);
xmlNodeSetName(node, BAD_CAST("faultactor"));
}
detail_name = "detail";
} else {
if ((tmp = zend_hash_str_find(prop, "faultcode", sizeof("faultcode")-1)) != NULL) {
xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
- zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL TSRMLS_CC);
+ zend_string *str = php_escape_html_entities((unsigned char*)Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0, 0, NULL);
node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
@@ -4025,7 +4023,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
if ((tmp = zend_hash_str_find(prop, "faultstring", sizeof("faultstring")-1)) != NULL) {
xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Reason"), NULL);
- node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, node TSRMLS_CC);
+ node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, node);
xmlNodeSetName(node, BAD_CAST("Text"));
xmlSetNs(node, ns);
}
@@ -4055,7 +4053,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
detail = tmp;
}
- x = serialize_parameter(sparam, detail, 1, NULL, use, node TSRMLS_CC);
+ x = serialize_parameter(sparam, detail, 1, NULL, use, node);
if (function &&
function->binding &&
@@ -4083,7 +4081,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
}
} else if ((tmp = zend_hash_str_find(prop, "detail", sizeof("detail")-1)) != NULL &&
Z_TYPE_P(tmp) != IS_NULL) {
- serialize_zval(tmp, NULL, detail_name, use, param TSRMLS_CC);
+ serialize_zval(tmp, NULL, detail_name, use, param);
}
} else {
@@ -4102,7 +4100,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
HashTable *ht = NULL;
if (Z_TYPE(h->retval) == IS_OBJECT &&
- instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) {
+ instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry)) {
zval *tmp;
sdlSoapBindingFunctionHeaderPtr hdr;
smart_str key = {0};
@@ -4140,14 +4138,14 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (h->function) {
xmlNodePtr xmlHdr = NULL;
- if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
if (ht) {
set_soap_header_attributes(xmlHdr, ht, version);
}
} else {
- xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC);
+ xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
@@ -4171,7 +4169,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
- if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL TSRMLS_CC) == SOAP_ENCODED) {
+ if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
@@ -4197,7 +4195,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
return doc;
}
-static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers TSRMLS_DC)
+static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function, char *function_name, char *uri, zval *arguments, int arg_count, int version, HashTable *soap_headers)
{
xmlDoc *doc;
xmlNodePtr envelope = NULL, body, method = NULL, head = NULL;
@@ -4282,9 +4280,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, &arguments[i], i, NULL, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, &arguments[i], i, NULL, use, method);
} else if (style == SOAP_DOCUMENT) {
- param = serialize_parameter(parameter, &arguments[i], i, NULL, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, &arguments[i], i, NULL, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -4304,9 +4302,9 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
sdlParamPtr parameter = get_param(function, NULL, i, FALSE);
if (style == SOAP_RPC) {
- param = serialize_parameter(parameter, NULL, i, NULL, use, method TSRMLS_CC);
+ param = serialize_parameter(parameter, NULL, i, NULL, use, method);
} else if (style == SOAP_DOCUMENT) {
- param = serialize_parameter(parameter, NULL, i, NULL, use, body TSRMLS_CC);
+ param = serialize_parameter(parameter, NULL, i, NULL, use, body);
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
@@ -4354,7 +4352,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
}
if ((tmp = zend_hash_str_find(ht, "data", sizeof("data")-1)) != NULL) {
- h = master_to_xml(enc, tmp, hdr_use, head TSRMLS_CC);
+ h = master_to_xml(enc, tmp, hdr_use, head);
xmlNodeSetName(h, BAD_CAST(Z_STRVAL_P(name)));
} else {
h = xmlNewNode(NULL, BAD_CAST(Z_STRVAL_P(name)));
@@ -4385,7 +4383,7 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function
return doc;
}
-static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int index, char *name, int style, xmlNodePtr parent)
{
char *paramName;
xmlNodePtr xmlParam;
@@ -4415,12 +4413,12 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param, zval *param_val, int in
}
}
- xmlParam = serialize_zval(param_val, param, paramName, style, parent TSRMLS_CC);
+ xmlParam = serialize_zval(param_val, param, paramName, style, parent);
return xmlParam;
}
-static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent TSRMLS_DC)
+static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName, int style, xmlNodePtr parent)
{
xmlNodePtr xmlParam;
encodePtr enc;
@@ -4443,7 +4441,7 @@ static xmlNodePtr serialize_zval(zval *val, sdlParamPtr param, char *paramName,
} else {
enc = NULL;
}
- xmlParam = master_to_xml(enc, val, style, parent TSRMLS_CC);
+ xmlParam = master_to_xml(enc, val, style, parent);
zval_ptr_dtor(&defval);
if (!strcmp((char*)xmlParam->name, "BOGUS")) {
xmlNodeSetName(xmlParam, BAD_CAST(paramName));
diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c
index d808271728..98ece64855 100644
--- a/ext/sockets/conversions.c
+++ b/ext/sockets/conversions.c
@@ -196,10 +196,10 @@ static void do_to_zval_err(res_context *ctx, const char *fmt, ...)
va_end(ap);
}
-void err_msg_dispose(struct err_s *err TSRMLS_DC)
+void err_msg_dispose(struct err_s *err)
{
if (err->msg != NULL) {
- php_error_docref0(NULL TSRMLS_CC, err->level, "%s", err->msg);
+ php_error_docref0(NULL, err->level, "%s", err->msg);
if (err->should_free) {
efree(err->msg);
}
@@ -541,10 +541,9 @@ static void from_zval_write_sin_addr(const zval *zaddr_str, char *inaddr, ser_co
int res;
struct sockaddr_in saddr = {0};
zend_string *addr_str;
- TSRMLS_FETCH();
addr_str = zval_get_string((zval *) zaddr_str);
- res = php_set_inet_addr(&saddr, addr_str->val, ctx->sock TSRMLS_CC);
+ res = php_set_inet_addr(&saddr, addr_str->val, ctx->sock);
if (res) {
memcpy(inaddr, &saddr.sin_addr, sizeof saddr.sin_addr);
} else {
@@ -592,10 +591,9 @@ static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_co
int res;
struct sockaddr_in6 saddr6 = {0};
zend_string *addr_str;
- TSRMLS_FETCH();
addr_str = zval_get_string((zval *) zaddr_str);
- res = php_set_inet6_addr(&saddr6, addr_str->val, ctx->sock TSRMLS_CC);
+ res = php_set_inet6_addr(&saddr6, addr_str->val, ctx->sock);
if (res) {
memcpy(addr6, &saddr6.sin6_addr, sizeof saddr6.sin6_addr);
} else {
@@ -645,7 +643,6 @@ static void from_zval_write_sun_path(const zval *path, char *sockaddr_un_c, ser_
{
zend_string *path_str;
struct sockaddr_un *saddr = (struct sockaddr_un*)sockaddr_un_c;
- TSRMLS_FETCH();
path_str = zval_get_string((zval *) path);
@@ -1246,8 +1243,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
}
} else {
zend_string *str;
- TSRMLS_FETCH();
-
+
str = zval_get_string((zval *) zv);
#if HAVE_IF_NAMETOINDEX
@@ -1350,7 +1346,6 @@ size_t calculate_scm_rights_space(const zval *arr, ser_context *ctx)
static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, ser_context *ctx)
{
int *iarr = args[0];
- TSRMLS_FETCH();
if (Z_TYPE_P(elem) == IS_RESOURCE) {
php_stream *stream;
@@ -1395,7 +1390,6 @@ void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
i;
struct cmsghdr *dummy_cmsg = 0;
size_t data_offset;
- TSRMLS_FETCH();
data_offset = (unsigned char *)CMSG_DATA(dummy_cmsg)
- (unsigned char *)dummy_cmsg;
@@ -1428,8 +1422,8 @@ void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
return;
}
if (S_ISSOCK(statbuf.st_mode)) {
- php_socket *sock = socket_import_file_descriptor(fd TSRMLS_CC);
- zend_register_resource(&elem, sock, php_sockets_le_socket() TSRMLS_CC);
+ php_socket *sock = socket_import_file_descriptor(fd);
+ zend_register_resource(&elem, sock, php_sockets_le_socket());
} else {
php_stream *stream = php_stream_fopen_from_fd(fd, "rw", NULL);
php_stream_to_zval(stream, &elem);
diff --git a/ext/sockets/conversions.h b/ext/sockets/conversions.h
index 42e98882f4..0ae6b6d853 100644
--- a/ext/sockets/conversions.h
+++ b/ext/sockets/conversions.h
@@ -39,7 +39,7 @@ typedef void (to_zval_read_field)(const char *data, zval *zv, res_context *ctx);
extern const struct key_value empty_key_value_list[];
/* AUX FUNCTIONS */
-void err_msg_dispose(struct err_s *err TSRMLS_DC);
+void err_msg_dispose(struct err_s *err);
void allocations_dispose(zend_llist **allocations);
/* CONVERSION FUNCTIONS */
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index 3c076b4e7c..b8e7216c9b 100644
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@ -51,9 +51,9 @@ enum source_op {
UNBLOCK_SOURCE
};
-static int _php_mcast_join_leave(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index, int join TSRMLS_DC);
+static int _php_mcast_join_leave(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, unsigned int if_index, int join);
#ifdef HAS_MCAST_EXT
-static int _php_mcast_source_op(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, struct sockaddr *source, socklen_t source_len, unsigned int if_index, enum source_op sop TSRMLS_DC);
+static int _php_mcast_source_op(php_socket *sock, int level, struct sockaddr *group, socklen_t group_len, struct sockaddr *source, socklen_t source_len, unsigned int if_index, enum source_op sop);
#endif
#ifdef RFC3678_API
@@ -63,14 +63,14 @@ static const char *_php_source_op_to_string(enum source_op sop);
static int _php_source_op_to_ipv4_op(enum source_op sop);
#endif
-int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC)
+int php_string_to_if_index(const char *val, unsigned *out)
{
#if HAVE_IF_NAMETOINDEX
unsigned int ind;
ind = if_nametoindex(val);
if (ind == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"no interface with name \"%s\" could be found", val);
return FAILURE;
} else {
@@ -78,20 +78,20 @@ int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC)
return SUCCESS;
}
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"this platform does not support looking up an interface by "
"name, an integer interface index must be supplied instead");
return FAILURE;
#endif
}
-static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
+static int php_get_if_index_from_zval(zval *val, unsigned *out)
{
int ret;
if (Z_TYPE_P(val) == IS_LONG) {
if (Z_LVAL_P(val) < 0 || Z_LVAL_P(val) > UINT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"the interface index cannot be negative or larger than %u;"
" given %pd", UINT_MAX, Z_LVAL_P(val));
ret = FAILURE;
@@ -104,7 +104,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
Z_ADDREF_P(val);
}
convert_to_string_ex(val);
- ret = php_string_to_if_index(Z_STRVAL_P(val), out TSRMLS_CC);
+ ret = php_string_to_if_index(Z_STRVAL_P(val), out);
zval_ptr_dtor(val);
}
@@ -114,7 +114,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
static int php_get_if_index_from_array(const HashTable *ht, const char *key,
- php_socket *sock, unsigned int *if_index TSRMLS_DC)
+ php_socket *sock, unsigned int *if_index)
{
zval *val;
@@ -123,23 +123,23 @@ static int php_get_if_index_from_array(const HashTable *ht, const char *key,
return SUCCESS;
}
- return php_get_if_index_from_zval(val, if_index TSRMLS_CC);
+ return php_get_if_index_from_zval(val, if_index);
}
static int php_get_address_from_array(const HashTable *ht, const char *key,
- php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len TSRMLS_DC)
+ php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len)
{
zval *val;
if ((val = zend_hash_str_find(ht, key, strlen(key))) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", key);
return FAILURE;
}
if (Z_REFCOUNTED_P(val)) {
Z_ADDREF_P(val);
}
convert_to_string_ex(val);
- if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(val), sock TSRMLS_CC)) {
+ if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(val), sock)) {
zval_ptr_dtor(val);
return FAILURE;
}
@@ -147,16 +147,16 @@ static int php_get_address_from_array(const HashTable *ht, const char *key,
return SUCCESS;
}
-static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC)
+static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, zval *arg4)
{
HashTable *opt_ht;
unsigned int if_index;
int retval;
int (*mcast_req_fun)(php_socket *, int, struct sockaddr *, socklen_t,
- unsigned TSRMLS_DC);
+ unsigned);
#ifdef HAS_MCAST_EXT
int (*mcast_sreq_fun)(php_socket *, int, struct sockaddr *, socklen_t,
- struct sockaddr *, socklen_t, unsigned TSRMLS_DC);
+ struct sockaddr *, socklen_t, unsigned);
#endif
switch (optname) {
@@ -174,16 +174,16 @@ mcast_req_fun:
opt_ht = HASH_OF(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
- &glen TSRMLS_CC) == FAILURE) {
+ &glen) == FAILURE) {
return FAILURE;
}
if (php_get_if_index_from_array(opt_ht, "interface", php_sock,
- &if_index TSRMLS_CC) == FAILURE) {
+ &if_index) == FAILURE) {
return FAILURE;
}
retval = mcast_req_fun(php_sock, level, (struct sockaddr*)&group,
- glen, if_index TSRMLS_CC);
+ glen, if_index);
break;
}
@@ -210,25 +210,25 @@ mcast_req_fun:
opt_ht = HASH_OF(arg4);
if (php_get_address_from_array(opt_ht, "group", php_sock, &group,
- &glen TSRMLS_CC) == FAILURE) {
+ &glen) == FAILURE) {
return FAILURE;
}
if (php_get_address_from_array(opt_ht, "source", php_sock, &source,
- &slen TSRMLS_CC) == FAILURE) {
+ &slen) == FAILURE) {
return FAILURE;
}
if (php_get_if_index_from_array(opt_ht, "interface", php_sock,
- &if_index TSRMLS_CC) == FAILURE) {
+ &if_index) == FAILURE) {
return FAILURE;
}
retval = mcast_sreq_fun(php_sock, level, (struct sockaddr*)&group,
- glen, (struct sockaddr*)&source, slen, if_index TSRMLS_CC);
+ glen, (struct sockaddr*)&source, slen, if_index);
break;
}
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"unexpected option in php_do_mcast_opt (level %d, option %d). "
"This is a bug.", level, optname);
return FAILURE;
@@ -246,7 +246,7 @@ mcast_req_fun:
int php_do_setsockopt_ip_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC)
+ zval *arg4)
{
unsigned int if_index;
struct in_addr if_addr;
@@ -264,18 +264,18 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
case PHP_MCAST_JOIN_SOURCE_GROUP:
case PHP_MCAST_LEAVE_SOURCE_GROUP:
#endif
- if (php_do_mcast_opt(php_sock, level, optname, arg4 TSRMLS_CC) == FAILURE) {
+ if (php_do_mcast_opt(php_sock, level, optname, arg4) == FAILURE) {
return FAILURE;
} else {
return SUCCESS;
}
case IP_MULTICAST_IF:
- if (php_get_if_index_from_zval(arg4, &if_index TSRMLS_CC) == FAILURE) {
+ if (php_get_if_index_from_zval(arg4, &if_index) == FAILURE) {
return FAILURE;
}
- if (php_if_index_to_addr4(if_index, php_sock, &if_addr TSRMLS_CC) == FAILURE) {
+ if (php_if_index_to_addr4(if_index, php_sock, &if_addr) == FAILURE) {
return FAILURE;
}
opt_ptr = &if_addr;
@@ -290,7 +290,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
case IP_MULTICAST_TTL:
convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < 0L || Z_LVAL_P(arg4) > 255L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected a value between 0 and 255");
return FAILURE;
}
@@ -316,7 +316,7 @@ dosockopt:
int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC)
+ zval *arg4)
{
unsigned int if_index;
void *opt_ptr;
@@ -333,14 +333,14 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
case PHP_MCAST_JOIN_SOURCE_GROUP:
case PHP_MCAST_LEAVE_SOURCE_GROUP:
#endif
- if (php_do_mcast_opt(php_sock, level, optname, arg4 TSRMLS_CC) == FAILURE) {
+ if (php_do_mcast_opt(php_sock, level, optname, arg4) == FAILURE) {
return FAILURE;
} else {
return SUCCESS;
}
case IPV6_MULTICAST_IF:
- if (php_get_if_index_from_zval(arg4, &if_index TSRMLS_CC) == FAILURE) {
+ if (php_get_if_index_from_zval(arg4, &if_index) == FAILURE) {
return FAILURE;
}
@@ -355,7 +355,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
case IPV6_MULTICAST_HOPS:
convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < -1L || Z_LVAL_P(arg4) > 255L) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expected a value between -1 and 255");
return FAILURE;
}
@@ -383,9 +383,9 @@ int php_mcast_join(
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_join_leave(sock, level, group, group_len, if_index, 1 TSRMLS_CC);
+ return _php_mcast_join_leave(sock, level, group, group_len, if_index, 1);
}
int php_mcast_leave(
@@ -393,9 +393,9 @@ int php_mcast_leave(
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_join_leave(sock, level, group, group_len, if_index, 0 TSRMLS_CC);
+ return _php_mcast_join_leave(sock, level, group, group_len, if_index, 0);
}
#ifdef HAS_MCAST_EXT
@@ -406,9 +406,9 @@ int php_mcast_join_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, JOIN_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, JOIN_SOURCE);
}
int php_mcast_leave_source(
@@ -418,9 +418,9 @@ int php_mcast_leave_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, LEAVE_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, LEAVE_SOURCE);
}
int php_mcast_block_source(
@@ -430,9 +430,9 @@ int php_mcast_block_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, BLOCK_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, BLOCK_SOURCE);
}
int php_mcast_unblock_source(
@@ -442,9 +442,9 @@ int php_mcast_unblock_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC)
+ unsigned int if_index)
{
- return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, UNBLOCK_SOURCE TSRMLS_CC);
+ return _php_mcast_source_op(sock, level, group, group_len, source, source_len, if_index, UNBLOCK_SOURCE);
}
#endif /* HAS_MCAST_EXT */
@@ -455,7 +455,7 @@ static int _php_mcast_join_leave(
struct sockaddr *group, /* struct sockaddr_in/sockaddr_in6 */
socklen_t group_len,
unsigned int if_index,
- int join TSRMLS_DC)
+ int join)
{
#ifdef RFC3678_API
struct group_req greq = {0};
@@ -475,7 +475,7 @@ static int _php_mcast_join_leave(
assert(group_len == sizeof(struct sockaddr_in));
if (if_index != 0) {
- if (php_if_index_to_addr4(if_index, sock, &addr TSRMLS_CC) ==
+ if (php_if_index_to_addr4(if_index, sock, &addr) ==
FAILURE)
return -2; /* failure, but notice already emitted */
mreq.imr_interface = addr;
@@ -502,7 +502,7 @@ static int _php_mcast_join_leave(
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Option %s is inapplicable to this socket type",
join ? "MCAST_JOIN_GROUP" : "MCAST_LEAVE_GROUP");
return -2;
@@ -519,7 +519,7 @@ static int _php_mcast_source_op(
struct sockaddr *source,
socklen_t source_len,
unsigned int if_index,
- enum source_op sop TSRMLS_DC)
+ enum source_op sop)
{
#ifdef RFC3678_API
struct group_source_req gsreq = {0};
@@ -544,7 +544,7 @@ static int _php_mcast_source_op(
assert(source_len == sizeof(struct sockaddr_in));
if (if_index != 0) {
- if (php_if_index_to_addr4(if_index, sock, &addr TSRMLS_CC) ==
+ if (php_if_index_to_addr4(if_index, sock, &addr) ==
FAILURE)
return -2; /* failure, but notice already emitted */
mreqs.imr_interface = addr;
@@ -557,14 +557,14 @@ static int _php_mcast_source_op(
}
#if HAVE_IPV6
else if (sock->type == AF_INET6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"This platform does not support %s for IPv6 sockets",
_php_source_op_to_string(sop));
return -2;
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Option %s is inapplicable to this socket type",
_php_source_op_to_string(sop));
return -2;
@@ -628,7 +628,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
#endif /* HAS_MCAST_EXT */
#if PHP_WIN32
-int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr TSRMLS_DC)
+int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
@@ -652,7 +652,7 @@ retry:
goto retry;
}
if (retval != NO_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"GetIpAddrTable failed with error %lu", retval);
return FAILURE;
}
@@ -663,12 +663,12 @@ retry:
return SUCCESS;
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"No interface with index %u was found", if_index);
return FAILURE;
}
-int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index TSRMLS_DC)
+int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
{
MIB_IPADDRTABLE *addr_table;
ULONG size;
@@ -692,7 +692,7 @@ retry:
goto retry;
}
if (retval != NO_ERROR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"GetIpAddrTable failed with error %lu", retval);
return FAILURE;
}
@@ -707,7 +707,7 @@ retry:
{
char addr_str[17] = {0};
inet_ntop(AF_INET, addr, addr_str, sizeof(addr_str));
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"The interface with IP address %s was not found", addr_str);
}
return FAILURE;
@@ -715,7 +715,7 @@ retry:
#else
-int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr TSRMLS_DC)
+int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
struct ifreq if_req;
@@ -736,13 +736,13 @@ int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_add
#else
#error Neither SIOCGIFNAME nor if_indextoname are available
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining address for interface %u: error %d", if_index, errno);
return FAILURE;
}
if (ioctl(php_sock->bsd_socket, SIOCGIFADDR, &if_req) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining address for interface %u: error %d", if_index, errno);
return FAILURE;
}
@@ -752,7 +752,7 @@ int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_add
return SUCCESS;
}
-int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index TSRMLS_DC)
+int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *if_index)
{
struct ifconf if_conf = {0};
char *buf = NULL,
@@ -774,7 +774,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
if (ioctl(php_sock->bsd_socket, SIOCGIFCONF, (char*)&if_conf) == -1 &&
(errno != EINVAL || lastsize != 0)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed obtaining interfaces list: error %d", errno);
goto err;
}
@@ -817,7 +817,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
#else
#error Neither SIOCGIFINDEX nor if_nametoindex are available
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Error converting interface name to index: error %d",
errno);
goto err;
@@ -836,7 +836,7 @@ int php_add4_to_if_index(struct in_addr *addr, php_socket *php_sock, unsigned *i
{
char addr_str[17] = {0};
inet_ntop(AF_INET, addr, addr_str, sizeof(addr_str));
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"The interface with IP address %s was not found", addr_str);
}
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h
index de76dfcec7..05ad28274d 100644
--- a/ext/sockets/multicast.h
+++ b/ext/sockets/multicast.h
@@ -48,38 +48,38 @@
int php_do_setsockopt_ip_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC);
+ zval *arg4);
int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
int level,
int optname,
- zval *arg4 TSRMLS_DC);
+ zval *arg4);
int php_if_index_to_addr4(
unsigned if_index,
php_socket *php_sock,
- struct in_addr *out_addr TSRMLS_DC);
+ struct in_addr *out_addr);
int php_add4_to_if_index(
struct in_addr *addr,
php_socket *php_sock,
- unsigned *if_index TSRMLS_DC);
+ unsigned *if_index);
-int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC);
+int php_string_to_if_index(const char *val, unsigned *out);
int php_mcast_join(
php_socket *sock,
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_leave(
php_socket *sock,
int level,
struct sockaddr *group,
socklen_t group_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
#ifdef HAS_MCAST_EXT
int php_mcast_join_source(
@@ -89,7 +89,7 @@ int php_mcast_join_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_leave_source(
php_socket *sock,
@@ -98,7 +98,7 @@ int php_mcast_leave_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_block_source(
php_socket *sock,
@@ -107,7 +107,7 @@ int php_mcast_block_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
int php_mcast_unblock_source(
php_socket *sock,
@@ -116,5 +116,5 @@ int php_mcast_unblock_source(
socklen_t group_len,
struct sockaddr *source,
socklen_t source_len,
- unsigned int if_index TSRMLS_DC);
+ unsigned int if_index);
#endif
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index 98c36cd1ad..63638e23e3 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -71,7 +71,7 @@ struct sockaddr_un {
PHP_SOCKETS_API int php_sockets_le_socket(void);
PHP_SOCKETS_API php_socket *php_create_socket(void);
-PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc);
#define php_sockets_le_socket_name "Socket"
@@ -81,7 +81,7 @@ PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);
(socket)->error = _err; \
SOCKETS_G(last_error) = _err; \
if (_err != EAGAIN && _err != EWOULDBLOCK && _err != EINPROGRESS) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s [%d]: %s", msg, _err, sockets_strerror(_err TSRMLS_CC)); \
+ php_error_docref(NULL, E_WARNING, "%s [%d]: %s", msg, _err, sockets_strerror(_err)); \
} \
} while (0)
@@ -104,8 +104,8 @@ enum sockopt_return {
SOCKOPT_SUCCESS
};
-char *sockets_strerror(int error TSRMLS_DC);
-php_socket *socket_import_file_descriptor(PHP_SOCKET sock TSRMLS_DC);
+char *sockets_strerror(int error);
+php_socket *socket_import_file_descriptor(PHP_SOCKET sock);
#else
#define phpext_sockets_ptr NULL
diff --git a/ext/sockets/sendrecvmsg.c b/ext/sockets/sendrecvmsg.c
index dcaa60ac7a..eedc9e1639 100644
--- a/ext/sockets/sendrecvmsg.c
+++ b/ext/sockets/sendrecvmsg.c
@@ -71,7 +71,7 @@ inline ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags)
#define LONG_CHECK_VALID_INT(l) \
do { \
if ((l) < INT_MIN && (l) > INT_MAX) { \
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value %pd does not fit inside " \
+ php_error_docref0(NULL, E_WARNING, "The value %pd does not fit inside " \
"the boundaries of a native integer", (l)); \
return; \
} \
@@ -175,7 +175,7 @@ PHP_FUNCTION(socket_sendmsg)
ssize_t res;
/* zmsg should be passed by ref */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|l", &zsocket, &zmsg, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|l", &zsocket, &zmsg, &flags) == FAILURE) {
return;
}
@@ -188,7 +188,7 @@ PHP_FUNCTION(socket_sendmsg)
sizeof(*msghdr), "msghdr", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
RETURN_FALSE;
}
@@ -217,7 +217,7 @@ PHP_FUNCTION(socket_recvmsg)
struct err_s err = {0};
//ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra/|l",
&zsocket, &zmsg, &flags) == FAILURE) {
return;
}
@@ -231,7 +231,7 @@ PHP_FUNCTION(socket_recvmsg)
sizeof(*msghdr), "msghdr", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
RETURN_FALSE;
}
@@ -256,15 +256,15 @@ PHP_FUNCTION(socket_recvmsg)
if (!err.has_error) {
ZVAL_COPY_VALUE(zmsg, zres);
} else {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
ZVAL_FALSE(zmsg);
/* no need to destroy/free zres -- it's NULL in this circumstance */
assert(zres == NULL);
}
} else {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "error in recvmsg [%d]: %s",
- errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "error in recvmsg [%d]: %s",
+ errno, sockets_strerror(errno));
RETURN_FALSE;
}
@@ -278,7 +278,7 @@ PHP_FUNCTION(socket_cmsg_space)
n = 0;
ancillary_reg_entry *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|l",
&level, &type, &n) == FAILURE) {
return;
}
@@ -288,14 +288,14 @@ PHP_FUNCTION(socket_cmsg_space)
LONG_CHECK_VALID_INT(n);
if (n < 0) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The third argument "
+ php_error_docref0(NULL, E_WARNING, "The third argument "
"cannot be negative");
return;
}
entry = get_ancillary_reg_entry(level, type);
if (entry == NULL) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The pair level %pd/type %pd is "
+ php_error_docref0(NULL, E_WARNING, "The pair level %pd/type %pd is "
"not supported by PHP", level, type);
return;
}
@@ -303,7 +303,7 @@ PHP_FUNCTION(socket_cmsg_space)
if (entry->var_el_size > 0 && n > (ZEND_LONG_MAX - (zend_long)entry->size -
(zend_long)CMSG_SPACE(0) - 15L) / entry->var_el_size) {
/* the -15 is to account for any padding CMSG_SPACE may add after the data */
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "The value for the "
+ php_error_docref0(NULL, E_WARNING, "The value for the "
"third argument (%pd) is too large", n);
return;
}
@@ -312,7 +312,7 @@ PHP_FUNCTION(socket_cmsg_space)
}
#if HAVE_IPV6
-int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC)
+int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4)
{
struct err_s err = {0};
zend_llist *allocations = NULL;
@@ -327,7 +327,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
case IPV6_PKTINFO:
#ifdef PHP_WIN32
if (Z_TYPE_P(arg4) == IS_ARRAY) {
- php_error_docref0(NULL TSRMLS_CC, E_WARNING, "Windows does not "
+ php_error_docref0(NULL, E_WARNING, "Windows does not "
"support sticky IPV6_PKTINFO");
return FAILURE;
} else {
@@ -340,7 +340,7 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
opt_ptr = from_zval_run_conversions(arg4, php_sock, from_zval_write_in6_pktinfo,
sizeof(struct in6_pktinfo), "in6_pktinfo", &allocations, &err);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
return FAILURE;
}
@@ -363,7 +363,7 @@ dosockopt:
return retval != 0 ? FAILURE : SUCCESS;
}
-int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result TSRMLS_DC)
+int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result)
{
struct err_s err = {0};
void *buffer;
@@ -393,7 +393,7 @@ int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
zval *zv = to_zval_run_conversions(buffer, reader, "in6_pktinfo",
empty_key_value_list, &err, &tmp);
if (err.has_error) {
- err_msg_dispose(&err TSRMLS_CC);
+ err_msg_dispose(&err);
res = -1;
} else {
ZVAL_COPY_VALUE(result, zv);
diff --git a/ext/sockets/sendrecvmsg.h b/ext/sockets/sendrecvmsg.h
index db099ed65e..b12974e4bd 100644
--- a/ext/sockets/sendrecvmsg.h
+++ b/ext/sockets/sendrecvmsg.h
@@ -12,8 +12,8 @@ PHP_FUNCTION(socket_cmsg_space);
void php_socket_sendrecvmsg_init(INIT_FUNC_ARGS);
void php_socket_sendrecvmsg_shutdown(SHUTDOWN_FUNC_ARGS);
-int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4 TSRMLS_DC);
-int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result TSRMLS_DC);
+int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *arg4);
+int php_do_getsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname, zval *result);
/* for conversions.c */
typedef struct {
diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c
index f9de9f1361..db1c2f1111 100644
--- a/ext/sockets/sockaddr_conv.c
+++ b/ext/sockets/sockaddr_conv.c
@@ -9,11 +9,11 @@
#include <arpa/inet.h>
#endif
-extern int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC);
+extern int php_string_to_if_index(const char *val, unsigned *out);
#if HAVE_IPV6
/* Sets addr by hostname, or by ip in string form (AF_INET6) */
-int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock) /* {{{ */
{
struct in6_addr tmp;
#if HAVE_GETADDRINFO
@@ -44,7 +44,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
return 0;
}
if (addrinfo->ai_family != PF_INET6 || addrinfo->ai_addrlen != sizeof(struct sockaddr_in6)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET6 domain returned on AF_INET6 socket");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: Non AF_INET6 domain returned on AF_INET6 socket");
freeaddrinfo(addrinfo);
return 0;
}
@@ -54,7 +54,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
#else
/* No IPv6 specific hostname resolution is available on this system? */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: getaddrinfo() not available on this system");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: getaddrinfo() not available on this system");
return 0;
#endif
@@ -70,7 +70,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
scope_id = lval;
}
} else {
- php_string_to_if_index(scope, &scope_id TSRMLS_CC);
+ php_string_to_if_index(scope, &scope_id);
}
sin6->sin6_scope_id = scope_id;
@@ -82,7 +82,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
#endif
/* Sets addr by hostname, or by ip in string form (AF_INET) */
-int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock) /* {{{ */
{
struct in_addr tmp;
struct hostent *host_entry;
@@ -100,7 +100,7 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc
return 0;
}
if (host_entry->h_addrtype != AF_INET) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host lookup failed: Non AF_INET domain returned on AF_INET socket");
+ php_error_docref(NULL, E_WARNING, "Host lookup failed: Non AF_INET domain returned on AF_INET socket");
return 0;
}
memcpy(&(sin->sin_addr.s_addr), host_entry->h_addr_list[0], host_entry->h_length);
@@ -112,11 +112,11 @@ int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_soc
/* Sets addr by hostname or by ip in string form (AF_INET or AF_INET6,
* depending on the socket) */
-int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock TSRMLS_DC) /* {{{ */
+int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock) /* {{{ */
{
if (php_sock->type == AF_INET) {
struct sockaddr_in t = {0};
- if (php_set_inet_addr(&t, string, php_sock TSRMLS_CC)) {
+ if (php_set_inet_addr(&t, string, php_sock)) {
memcpy(ss, &t, sizeof t);
ss->ss_family = AF_INET;
*ss_len = sizeof(t);
@@ -126,7 +126,7 @@ int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *strin
#if HAVE_IPV6
else if (php_sock->type == AF_INET6) {
struct sockaddr_in6 t = {0};
- if (php_set_inet6_addr(&t, string, php_sock TSRMLS_CC)) {
+ if (php_set_inet6_addr(&t, string, php_sock)) {
memcpy(ss, &t, sizeof t);
ss->ss_family = AF_INET6;
*ss_len = sizeof(t);
@@ -135,7 +135,7 @@ int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *strin
}
#endif
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"IP address used in the context of an unexpected type of socket");
}
return 0;
diff --git a/ext/sockets/sockaddr_conv.h b/ext/sockets/sockaddr_conv.h
index 8e51edac8f..1e7e3cf046 100644
--- a/ext/sockets/sockaddr_conv.h
+++ b/ext/sockets/sockaddr_conv.h
@@ -16,16 +16,16 @@
* The IPv6 literal can be a IPv4 mapped address (like ::ffff:127.0.0.1).
* If the hostname yields no IPv6 addresses, a mapped IPv4 address may be returned (AI_V4MAPPED)
*/
-int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_sock);
/*
* Convert an IPv4 literal or a hostname into a sockaddr_in.
*/
-int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet_addr(struct sockaddr_in *sin, char *string, php_socket *php_sock);
/*
* Calls either php_set_inet6_addr() or php_set_inet_addr(), depending on the type of the socket.
*/
-int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock TSRMLS_DC);
+int php_set_inet46_addr(php_sockaddr_storage *ss, socklen_t *ss_len, char *string, php_socket *php_sock);
#endif
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index afd67b3bd4..8e3d37da9b 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -401,7 +401,7 @@ PHP_SOCKETS_API php_socket *php_create_socket(void) /* {{{ */
}
/* }}} */
-PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
+PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc) /* {{{ */
{
php_socket *php_sock = rsrc->ptr;
@@ -416,7 +416,7 @@ PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSRMLS_DC) /* {{{ */
+static int php_open_listen_sock(php_socket **php_sock, int port, int backlog) /* {{{ */
{
struct sockaddr_in la;
struct hostent *hp;
@@ -466,7 +466,7 @@ static int php_open_listen_sock(php_socket **php_sock, int port, int backlog TSR
}
/* }}} */
-static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la, socklen_t *la_len TSRMLS_DC) /* {{{ */
+static int php_accept_connect(php_socket *in_sock, php_socket **new_sock, struct sockaddr *la, socklen_t *la_len) /* {{{ */
{
php_socket *out_sock = php_create_socket();
@@ -553,7 +553,7 @@ static int php_read(php_socket *sock, void *buf, size_t maxlen, int flags)
}
/* }}} */
-char *sockets_strerror(int error TSRMLS_DC) /* {{{ */
+char *sockets_strerror(int error) /* {{{ */
{
const char *buf;
@@ -772,7 +772,7 @@ static PHP_RSHUTDOWN_FUNCTION(sockets)
}
/* }}} */
-static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *max_fd TSRMLS_DC) /* {{{ */
+static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *max_fd) /* {{{ */
{
zval *element;
php_socket *php_sock;
@@ -781,7 +781,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(sock_array), element) {
- php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
+ php_sock = (php_socket*) zend_fetch_resource(element, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
@@ -795,7 +795,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
}
/* }}} */
-static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) /* {{{ */
+static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds) /* {{{ */
{
zval *element;
zval *dest_element;
@@ -809,7 +809,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) /
array_init(&new_hash);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(sock_array), num_key, key, element) {
- php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
+ php_sock = (php_socket*) zend_fetch_resource(element, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) {
@@ -847,7 +847,7 @@ PHP_FUNCTION(socket_select)
int retval, sets = 0;
zend_long usec = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) {
return;
}
@@ -855,12 +855,12 @@ PHP_FUNCTION(socket_select)
FD_ZERO(&wfds);
FD_ZERO(&efds);
- if (r_array != NULL) sets += php_sock_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
- if (w_array != NULL) sets += php_sock_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC);
- if (e_array != NULL) sets += php_sock_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ if (r_array != NULL) sets += php_sock_array_to_fd_set(r_array, &rfds, &max_fd);
+ if (w_array != NULL) sets += php_sock_array_to_fd_set(w_array, &wfds, &max_fd);
+ if (e_array != NULL) sets += php_sock_array_to_fd_set(e_array, &efds, &max_fd);
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no resource arrays were passed to select");
+ php_error_docref(NULL, E_WARNING, "no resource arrays were passed to select");
RETURN_FALSE;
}
@@ -897,13 +897,13 @@ PHP_FUNCTION(socket_select)
if (retval == -1) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s", errno, sockets_strerror(errno));
RETURN_FALSE;
}
- if (r_array != NULL) php_sock_array_from_fd_set(r_array, &rfds TSRMLS_CC);
- if (w_array != NULL) php_sock_array_from_fd_set(w_array, &wfds TSRMLS_CC);
- if (e_array != NULL) php_sock_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ if (r_array != NULL) php_sock_array_from_fd_set(r_array, &rfds);
+ if (w_array != NULL) php_sock_array_from_fd_set(w_array, &wfds);
+ if (e_array != NULL) php_sock_array_from_fd_set(e_array, &efds);
RETURN_LONG(retval);
}
@@ -916,11 +916,11 @@ PHP_FUNCTION(socket_create_listen)
php_socket *php_sock;
zend_long port, backlog = 128;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &port, &backlog) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &port, &backlog) == FAILURE) {
return;
}
- if (!php_open_listen_sock(&php_sock, port, backlog TSRMLS_CC)) {
+ if (!php_open_listen_sock(&php_sock, port, backlog)) {
RETURN_FALSE;
}
@@ -940,13 +940,13 @@ PHP_FUNCTION(socket_accept)
php_sockaddr_storage sa;
socklen_t php_sa_len = sizeof(sa);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(php_sock, php_socket *, arg1, -1, le_socket_name, le_socket);
- if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr*)&sa, &php_sa_len TSRMLS_CC)) {
+ if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr*)&sa, &php_sa_len)) {
RETURN_FALSE;
}
@@ -961,7 +961,7 @@ PHP_FUNCTION(socket_set_nonblock)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -970,7 +970,7 @@ PHP_FUNCTION(socket_set_nonblock)
if (!Z_ISUNDEF(php_sock->zstream)) {
php_stream *stream;
/* omit notice if resource doesn't exist anymore */
- stream = zend_fetch_resource(&php_sock->zstream TSRMLS_CC, -1,
+ stream = zend_fetch_resource(&php_sock->zstream, -1,
NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream != NULL) {
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 0,
@@ -981,7 +981,7 @@ PHP_FUNCTION(socket_set_nonblock)
}
}
- if (php_set_sock_blocking(php_sock->bsd_socket, 0 TSRMLS_CC) == SUCCESS) {
+ if (php_set_sock_blocking(php_sock->bsd_socket, 0) == SUCCESS) {
php_sock->blocking = 0;
RETURN_TRUE;
} else {
@@ -998,7 +998,7 @@ PHP_FUNCTION(socket_set_block)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -1009,7 +1009,7 @@ PHP_FUNCTION(socket_set_block)
* state */
if (!Z_ISUNDEF(php_sock->zstream)) {
php_stream *stream;
- stream = zend_fetch_resource(&php_sock->zstream TSRMLS_CC, -1,
+ stream = zend_fetch_resource(&php_sock->zstream, -1,
NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream != NULL) {
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 1,
@@ -1020,7 +1020,7 @@ PHP_FUNCTION(socket_set_block)
}
}
- if (php_set_sock_blocking(php_sock->bsd_socket, 1 TSRMLS_CC) == SUCCESS) {
+ if (php_set_sock_blocking(php_sock->bsd_socket, 1) == SUCCESS) {
php_sock->blocking = 1;
RETURN_TRUE;
} else {
@@ -1038,7 +1038,7 @@ PHP_FUNCTION(socket_listen)
php_socket *php_sock;
zend_long backlog = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &backlog) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &arg1, &backlog) == FAILURE) {
return;
}
@@ -1059,7 +1059,7 @@ PHP_FUNCTION(socket_close)
zval *arg1;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -1089,7 +1089,7 @@ PHP_FUNCTION(socket_write)
zend_long length = 0;
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &arg1, &str, &str_len, &length) == FAILURE) {
return;
}
@@ -1124,7 +1124,7 @@ PHP_FUNCTION(socket_read)
int retval;
zend_long length, type = PHP_BINARY_READ;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &arg1, &length, &type) == FAILURE) {
return;
}
@@ -1189,7 +1189,7 @@ PHP_FUNCTION(socket_getsockname)
char *addr_string;
socklen_t salen = sizeof(php_sockaddr_storage);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|z/", &arg1, &addr, &port) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|z/", &arg1, &addr, &port) == FAILURE) {
return;
}
@@ -1247,7 +1247,7 @@ PHP_FUNCTION(socket_getsockname)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family);
+ php_error_docref(NULL, E_WARNING, "Unsupported address family %d", sa->sa_family);
RETURN_FALSE;
}
}
@@ -1270,7 +1270,7 @@ PHP_FUNCTION(socket_getpeername)
char *addr_string;
socklen_t salen = sizeof(php_sockaddr_storage);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/|z/", &arg1, &arg2, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/|z/", &arg1, &arg2, &arg3) == FAILURE) {
return;
}
@@ -1326,7 +1326,7 @@ PHP_FUNCTION(socket_getpeername)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported address family %d", sa->sa_family);
+ php_error_docref(NULL, E_WARNING, "Unsupported address family %d", sa->sa_family);
RETURN_FALSE;
}
}
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(socket_create)
zend_long arg1, arg2, arg3;
php_socket *php_sock = php_create_socket();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &arg1, &arg2, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &arg1, &arg2, &arg3) == FAILURE) {
efree(php_sock);
return;
}
@@ -1349,12 +1349,12 @@ PHP_FUNCTION(socket_create)
&& arg1 != AF_INET6
#endif
&& arg1 != AF_INET) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", arg1);
+ php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", arg1);
arg1 = AF_INET;
}
if (arg2 > 10) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", arg2);
+ php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", arg2);
arg2 = SOCK_STREAM;
}
@@ -1363,7 +1363,7 @@ PHP_FUNCTION(socket_create)
if (IS_INVALID_SOCKET(php_sock)) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create socket [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "Unable to create socket [%d]: %s", errno, sockets_strerror(errno));
efree(php_sock);
RETURN_FALSE;
}
@@ -1387,7 +1387,7 @@ PHP_FUNCTION(socket_connect)
zend_long port = 0;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(argc, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1399,7 +1399,7 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_in6 sin6 = {0};
if (argc != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET6 requires 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Socket of type AF_INET6 requires 3 arguments");
RETURN_FALSE;
}
@@ -1408,7 +1408,7 @@ PHP_FUNCTION(socket_connect)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons((unsigned short int)port);
- if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(&sin6, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1420,14 +1420,14 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_in sin = {0};
if (argc != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Socket of type AF_INET requires 3 arguments");
+ php_error_docref(NULL, E_WARNING, "Socket of type AF_INET requires 3 arguments");
RETURN_FALSE;
}
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short int)port);
- if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(&sin, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1439,7 +1439,7 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_un s_un = {0};
if (addr_len >= sizeof(s_un.sun_path)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Path too long");
+ php_error_docref(NULL, E_WARNING, "Path too long");
RETURN_FALSE;
}
@@ -1451,7 +1451,7 @@ PHP_FUNCTION(socket_connect)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1470,11 +1470,11 @@ PHP_FUNCTION(socket_strerror)
{
zend_long arg1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg1) == FAILURE) {
return;
}
- RETURN_STRING(sockets_strerror(arg1 TSRMLS_CC));
+ RETURN_STRING(sockets_strerror(arg1));
}
/* }}} */
@@ -1491,7 +1491,7 @@ PHP_FUNCTION(socket_bind)
zend_long port = 0;
zend_long retval = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1505,7 +1505,7 @@ PHP_FUNCTION(socket_bind)
sa->sun_family = AF_UNIX;
if (addr_len >= sizeof(sa->sun_path)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Invalid path: too long (maximum size is %d)",
(int)sizeof(sa->sun_path) - 1);
RETURN_FALSE;
@@ -1524,7 +1524,7 @@ PHP_FUNCTION(socket_bind)
sa->sin_family = AF_INET;
sa->sin_port = htons((unsigned short) port);
- if (! php_set_inet_addr(sa, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(sa, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1539,7 +1539,7 @@ PHP_FUNCTION(socket_bind)
sa->sin6_family = AF_INET6;
sa->sin6_port = htons((unsigned short) port);
- if (! php_set_inet6_addr(sa, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(sa, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(socket_bind)
}
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported socket type '%d', must be AF_UNIX, AF_INET, or AF_INET6", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "unsupported socket type '%d', must be AF_UNIX, AF_INET, or AF_INET6", php_sock->type);
RETURN_FALSE;
}
@@ -1571,7 +1571,7 @@ PHP_FUNCTION(socket_recv)
int retval;
zend_long len, flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/ll", &php_sock_res, &buf, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/ll", &php_sock_res, &buf, &len, &flags) == FAILURE) {
return;
}
@@ -1617,7 +1617,7 @@ PHP_FUNCTION(socket_send)
zend_long len, flags;
char *buf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsll", &arg1, &buf, &buf_len, &len, &flags) == FAILURE) {
return;
}
@@ -1652,7 +1652,7 @@ PHP_FUNCTION(socket_recvfrom)
char *address;
zend_string *recv_buf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz/llz/|z/", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz/llz/|z/", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
return;
}
@@ -1750,7 +1750,7 @@ PHP_FUNCTION(socket_recvfrom)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1775,7 +1775,7 @@ PHP_FUNCTION(socket_sendto)
char *buf, *addr;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) {
+ if (zend_parse_parameters(argc, "rslls|l", &arg1, &buf, &buf_len, &len, &flags, &addr, &addr_len, &port) == FAILURE) {
return;
}
@@ -1799,7 +1799,7 @@ PHP_FUNCTION(socket_sendto)
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short) port);
- if (! php_set_inet_addr(&sin, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet_addr(&sin, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1815,7 +1815,7 @@ PHP_FUNCTION(socket_sendto)
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons((unsigned short) port);
- if (! php_set_inet6_addr(&sin6, addr, php_sock TSRMLS_CC)) {
+ if (! php_set_inet6_addr(&sin6, addr, php_sock)) {
RETURN_FALSE;
}
@@ -1823,7 +1823,7 @@ PHP_FUNCTION(socket_sendto)
break;
#endif
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported socket type %d", php_sock->type);
+ php_error_docref(NULL, E_WARNING, "Unsupported socket type %d", php_sock->type);
RETURN_FALSE;
}
@@ -1851,7 +1851,7 @@ PHP_FUNCTION(socket_get_option)
int other_val;
zend_long level, optname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &arg1, &level, &optname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &arg1, &level, &optname) == FAILURE) {
return;
}
@@ -1867,7 +1867,7 @@ PHP_FUNCTION(socket_get_option)
PHP_SOCKET_ERROR(php_sock, "unable to retrieve socket option", errno);
RETURN_FALSE;
}
- if (php_add4_to_if_index(&if_addr, php_sock, &if_index TSRMLS_CC) == SUCCESS) {
+ if (php_add4_to_if_index(&if_addr, php_sock, &if_index) == SUCCESS) {
RETURN_LONG((zend_long) if_index);
} else {
RETURN_FALSE;
@@ -1877,7 +1877,7 @@ PHP_FUNCTION(socket_get_option)
}
#if HAVE_IPV6
else if (level == IPPROTO_IPV6) {
- int ret = php_do_getsockopt_ipv6_rfc3542(php_sock, level, optname, return_value TSRMLS_CC);
+ int ret = php_do_getsockopt_ipv6_rfc3542(php_sock, level, optname, return_value);
if (ret == SUCCESS) {
return;
} else if (ret == FAILURE) {
@@ -1964,7 +1964,7 @@ PHP_FUNCTION(socket_set_option)
zval *sec, *usec;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllz", &arg1, &level, &optname, &arg4) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rllz", &arg1, &level, &optname, &arg4) == FAILURE) {
return;
}
@@ -1981,15 +1981,15 @@ PHP_FUNCTION(socket_set_option)
if (level == IPPROTO_IP) {
- int res = php_do_setsockopt_ip_mcast(php_sock, level, optname, arg4 TSRMLS_CC);
+ int res = php_do_setsockopt_ip_mcast(php_sock, level, optname, arg4);
HANDLE_SUBCALL(res);
}
#if HAVE_IPV6
else if (level == IPPROTO_IPV6) {
- int res = php_do_setsockopt_ipv6_mcast(php_sock, level, optname, arg4 TSRMLS_CC);
+ int res = php_do_setsockopt_ipv6_mcast(php_sock, level, optname, arg4);
if (res == 1) {
- res = php_do_setsockopt_ipv6_rfc3542(php_sock, level, optname, arg4 TSRMLS_CC);
+ res = php_do_setsockopt_ipv6_rfc3542(php_sock, level, optname, arg4);
}
HANDLE_SUBCALL(res);
}
@@ -2004,11 +2004,11 @@ PHP_FUNCTION(socket_set_option)
opt_ht = HASH_OF(arg4);
if ((l_onoff = zend_hash_str_find(opt_ht, l_onoff_key, sizeof(l_onoff_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
RETURN_FALSE;
}
if ((l_linger = zend_hash_str_find(opt_ht, l_linger_key, sizeof(l_linger_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_linger_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", l_linger_key);
RETURN_FALSE;
}
@@ -2032,11 +2032,11 @@ PHP_FUNCTION(socket_set_option)
opt_ht = HASH_OF(arg4);
if ((sec = zend_hash_str_find(opt_ht, sec_key, sizeof(sec_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", sec_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", sec_key);
RETURN_FALSE;
}
if ((usec = zend_hash_str_find(opt_ht, usec_key, sizeof(usec_key) - 1)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", usec_key);
+ php_error_docref(NULL, E_WARNING, "no key \"%s\" passed in optval", usec_key);
RETURN_FALSE;
}
@@ -2097,7 +2097,7 @@ PHP_FUNCTION(socket_create_pair)
PHP_SOCKET fds_array[2];
zend_long domain, type, protocol;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllz/", &domain, &type, &protocol, &fds_array_zval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lllz/", &domain, &type, &protocol, &fds_array_zval) == FAILURE) {
return;
}
@@ -2109,18 +2109,18 @@ PHP_FUNCTION(socket_create_pair)
&& domain != AF_INET6
#endif
&& domain != AF_UNIX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", domain);
+ php_error_docref(NULL, E_WARNING, "invalid socket domain [%pd] specified for argument 1, assuming AF_INET", domain);
domain = AF_INET;
}
if (type > 10) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", type);
+ php_error_docref(NULL, E_WARNING, "invalid socket type [%pd] specified for argument 2, assuming SOCK_STREAM", type);
type = SOCK_STREAM;
}
if (socketpair(domain, type, protocol, fds_array) != 0) {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create socket pair [%d]: %s", errno, sockets_strerror(errno TSRMLS_CC));
+ php_error_docref(NULL, E_WARNING, "unable to create socket pair [%d]: %s", errno, sockets_strerror(errno));
efree(php_sock[0]);
efree(php_sock[1]);
RETURN_FALSE;
@@ -2158,7 +2158,7 @@ PHP_FUNCTION(socket_shutdown)
zend_long how_shutdown = 2;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &how_shutdown) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &arg1, &how_shutdown) == FAILURE) {
return;
}
@@ -2181,7 +2181,7 @@ PHP_FUNCTION(socket_last_error)
zval *arg1 = NULL;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg1) == FAILURE) {
return;
}
@@ -2201,7 +2201,7 @@ PHP_FUNCTION(socket_clear_error)
zval *arg1 = NULL;
php_socket *php_sock;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg1) == FAILURE) {
return;
}
@@ -2216,7 +2216,7 @@ PHP_FUNCTION(socket_clear_error)
}
/* }}} */
-php_socket *socket_import_file_descriptor(PHP_SOCKET socket TSRMLS_DC)
+php_socket *socket_import_file_descriptor(PHP_SOCKET socket)
{
#ifdef SO_DOMAIN
int type;
@@ -2272,7 +2272,7 @@ PHP_FUNCTION(socket_import_stream)
php_socket *retsock = NULL;
PHP_SOCKET socket; /* fd */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstream) == FAILURE) {
return;
}
php_stream_from_zval(stream, zstream);
@@ -2282,7 +2282,7 @@ PHP_FUNCTION(socket_import_stream)
RETURN_FALSE;
}
- retsock = socket_import_file_descriptor(socket TSRMLS_CC);
+ retsock = socket_import_file_descriptor(socket);
if (retsock == NULL) {
RETURN_FALSE;
}
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index aa740c40e2..bd6fa9019b 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -61,7 +61,7 @@ static PHP_GINIT_FUNCTION(spl)
}
/* }}} */
-static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload TSRMLS_DC)
+static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autoload)
{
zend_class_entry *ce;
@@ -72,10 +72,10 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autol
ce = zend_hash_find_ptr(EG(class_table), lc_name);
zend_string_free(lc_name);
} else {
- ce = zend_lookup_class(name TSRMLS_CC);
+ ce = zend_lookup_class(name);
}
if (ce == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : "");
+ php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", name->val, autoload ? " and could not be loaded" : "");
return NULL;
}
@@ -90,17 +90,17 @@ PHP_FUNCTION(class_parents)
zend_class_entry *parent_class, *ce;
zend_bool autoload = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -110,7 +110,7 @@ PHP_FUNCTION(class_parents)
array_init(return_value);
parent_class = ce->parent;
while (parent_class) {
- spl_add_class_name(return_value, parent_class, 0, 0 TSRMLS_CC);
+ spl_add_class_name(return_value, parent_class, 0, 0);
parent_class = parent_class->parent;
}
}
@@ -124,16 +124,16 @@ PHP_FUNCTION(class_implements)
zend_bool autoload = 1;
zend_class_entry *ce;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -141,7 +141,7 @@ PHP_FUNCTION(class_implements)
}
array_init(return_value);
- spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE TSRMLS_CC);
+ spl_add_interfaces(return_value, ce, 1, ZEND_ACC_INTERFACE);
}
/* }}} */
@@ -153,16 +153,16 @@ PHP_FUNCTION(class_uses)
zend_bool autoload = 1;
zend_class_entry *ce;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &obj, &autoload) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &obj, &autoload) == FAILURE) {
RETURN_FALSE;
}
if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "object or string expected");
+ php_error_docref(NULL, E_WARNING, "object or string expected");
RETURN_FALSE;
}
if (Z_TYPE_P(obj) == IS_STRING) {
- if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload TSRMLS_CC))) {
+ if (NULL == (ce = spl_find_ce_by_name(Z_STR_P(obj), autoload))) {
RETURN_FALSE;
}
} else {
@@ -170,12 +170,12 @@ PHP_FUNCTION(class_uses)
}
array_init(return_value);
- spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT TSRMLS_CC);
+ spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT);
}
/* }}} */
#define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \
- spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC)
+ spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags)
#define SPL_LIST_CLASSES(z_list, sub, allow, ce_flags) \
SPL_ADD_CLASS(AppendIterator, z_list, sub, allow, ce_flags); \
@@ -245,7 +245,7 @@ PHP_FUNCTION(spl_classes)
}
/* }}} */
-static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len TSRMLS_DC) /* {{{ */
+static int spl_autoload(zend_string *class_name, zend_string *lc_name, const char *ext, int ext_len) /* {{{ */
{
char *class_file;
int class_file_len;
@@ -268,7 +268,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
}
#endif
- ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC);
+ ret = php_stream_open_for_zend_ex(class_file, &file_handle, USE_PATH|STREAM_OPEN_FOR_INCLUDE);
if (ret == SUCCESS) {
zend_string *opened_path;
@@ -278,18 +278,18 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
opened_path = zend_string_init(file_handle.opened_path, strlen(file_handle.opened_path), 0);
ZVAL_NULL(&dummy);
if (zend_hash_add(&EG(included_files), opened_path, &dummy)) {
- new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC);
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
+ new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE);
+ zend_destroy_file_handle(&file_handle);
} else {
new_op_array = NULL;
- zend_file_handle_dtor(&file_handle TSRMLS_CC);
+ zend_file_handle_dtor(&file_handle);
}
zend_string_release(opened_path);
if (new_op_array) {
ZVAL_UNDEF(&result);
- zend_execute(new_op_array, &result TSRMLS_CC);
+ zend_execute(new_op_array, &result);
- destroy_op_array(new_op_array TSRMLS_CC);
+ destroy_op_array(new_op_array);
efree(new_op_array);
if (!EG(exception)) {
zval_ptr_dtor(&result);
@@ -311,7 +311,7 @@ PHP_FUNCTION(spl_autoload)
char *pos, *pos1;
zend_string *class_name, *lc_name, *file_exts = SPL_G(autoload_extensions);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &class_name, &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &class_name, &file_exts) == FAILURE) {
RETURN_FALSE;
}
@@ -332,7 +332,7 @@ PHP_FUNCTION(spl_autoload)
} else {
pos1_len = pos_len;
}
- if (spl_autoload(class_name, lc_name, pos, pos1_len TSRMLS_CC)) {
+ if (spl_autoload(class_name, lc_name, pos, pos1_len)) {
found = 1;
break; /* loaded */
}
@@ -354,9 +354,9 @@ PHP_FUNCTION(spl_autoload)
if (ex &&
ex->opline->opcode != ZEND_FETCH_CLASS &&
ex->opline->opcode != ZEND_NEW) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name->val);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Class %s could not be loaded", class_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be loaded", class_name->val);
+ php_error_docref(NULL, E_ERROR, "Class %s could not be loaded", class_name->val);
}
}
} /* }}} */
@@ -367,7 +367,7 @@ PHP_FUNCTION(spl_autoload_extensions)
{
zend_string *file_exts = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &file_exts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &file_exts) == FAILURE) {
return;
}
if (file_exts) {
@@ -412,7 +412,7 @@ PHP_FUNCTION(spl_autoload_call)
zend_string *lc_name, *func_name;
autoload_func_info *alfi;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &class_name) == FAILURE || Z_TYPE_P(class_name) != IS_STRING) {
return;
}
@@ -422,8 +422,8 @@ PHP_FUNCTION(spl_autoload_call)
lc_name = zend_string_alloc(Z_STRLEN_P(class_name), 0);
zend_str_tolower_copy(lc_name->val, Z_STRVAL_P(class_name), Z_STRLEN_P(class_name));
ZEND_HASH_FOREACH_STR_KEY_PTR(SPL_G(autoload_functions), func_name, alfi) {
- zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL TSRMLS_CC);
- zend_exception_save(TSRMLS_C);
+ zend_call_method(Z_ISUNDEF(alfi->obj)? NULL : &alfi->obj, alfi->ce, &alfi->func_ptr, func_name->val, func_name->len, retval, 1, class_name, NULL);
+ zend_exception_save();
if (retval) {
zval_ptr_dtor(retval);
retval = NULL;
@@ -432,7 +432,7 @@ PHP_FUNCTION(spl_autoload_call)
break;
}
} ZEND_HASH_FOREACH_END();
- zend_exception_restore(TSRMLS_C);
+ zend_exception_restore();
zend_string_free(lc_name);
SPL_G(autoload_running) = l_autoload_running;
} else {
@@ -465,19 +465,19 @@ PHP_FUNCTION(spl_autoload_register)
zend_object *obj_ptr;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS()) {
- if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error TSRMLS_CC)) {
+ if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &fcc, &error)) {
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
obj_ptr = fcc.object;
if (Z_TYPE_P(zcallable) == IS_ARRAY) {
if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object (%s)", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array specifies a non static method but no object (%s)", error);
}
if (error) {
efree(error);
@@ -485,7 +485,7 @@ PHP_FUNCTION(spl_autoload_register)
zend_string_release(func_name);
RETURN_FALSE;
} else if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Passed array does not specify %s %smethod (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error);
}
if (error) {
efree(error);
@@ -494,7 +494,7 @@ PHP_FUNCTION(spl_autoload_register)
RETURN_FALSE;
} else if (Z_TYPE_P(zcallable) == IS_STRING) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Function '%s' not %s (%s)", func_name->val, alfi.func_ptr ? "callable" : "found", error);
}
if (error) {
efree(error);
@@ -503,7 +503,7 @@ PHP_FUNCTION(spl_autoload_register)
RETURN_FALSE;
} else {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed (%s)", error);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Illegal value passed (%s)", error);
}
if (error) {
efree(error);
@@ -514,7 +514,7 @@ PHP_FUNCTION(spl_autoload_register)
} else if (fcc.function_handler->type == ZEND_INTERNAL_FUNCTION &&
fcc.function_handler->internal_function.handler == zif_spl_autoload_call) {
if (do_throw) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function spl_autoload_call() cannot be registered");
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Function spl_autoload_call() cannot be registered");
}
if (error) {
efree(error);
@@ -621,12 +621,12 @@ PHP_FUNCTION(spl_autoload_unregister)
zend_object *obj_ptr;
zend_fcall_info_cache fcc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zcallable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcallable) == FAILURE) {
return;
}
- if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Unable to unregister invalid function (%s)", error);
+ if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &fcc, &error)) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Unable to unregister invalid function (%s)", error);
if (error) {
efree(error);
}
@@ -745,25 +745,25 @@ PHP_FUNCTION(spl_object_hash)
{
zval *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC));
+ RETURN_NEW_STR(php_spl_object_hash(obj));
}
/* }}} */
-PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/
+PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
{
intptr_t hash_handle, hash_handlers;
if (!SPL_G(hash_mask_init)) {
if (!BG(mt_rand_is_seeded)) {
- php_mt_srand((uint32_t)GENERATE_SEED() TSRMLS_CC);
+ php_mt_srand((uint32_t)GENERATE_SEED());
}
- SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1);
- SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1);
+ SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand() >> 1);
+ SPL_G(hash_mask_handlers) = (intptr_t)(php_mt_rand() >> 1);
SPL_G(hash_mask_init) = 1;
}
@@ -774,7 +774,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/
}
/* }}} */
-int spl_build_class_list_string(zval *entry, char **list TSRMLS_DC) /* {{{ */
+int spl_build_class_list_string(zval *entry, char **list) /* {{{ */
{
char *res;
@@ -797,7 +797,7 @@ PHP_MINFO_FUNCTION(spl)
array_init(&list);
SPL_LIST_CLASSES(&list, 0, 1, ZEND_ACC_INTERFACE)
strg = estrdup("");
- zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg);
zval_dtor(&list);
php_info_print_table_row(2, "Interfaces", strg + 2);
efree(strg);
@@ -805,7 +805,7 @@ PHP_MINFO_FUNCTION(spl)
array_init(&list);
SPL_LIST_CLASSES(&list, 0, -1, ZEND_ACC_INTERFACE)
strg = estrdup("");
- zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg TSRMLS_CC);
+ zend_hash_apply_with_argument(Z_ARRVAL_P(&list), (apply_func_arg_t)spl_build_class_list_string, &strg);
zval_dtor(&list);
php_info_print_table_row(2, "Classes", strg + 2);
efree(strg);
diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h
index 8db6f09e6d..6d075e6c3f 100644
--- a/ext/spl/php_spl.h
+++ b/ext/spl/php_spl.h
@@ -79,7 +79,7 @@ PHP_FUNCTION(class_parents);
PHP_FUNCTION(class_implements);
PHP_FUNCTION(class_uses);
-PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC);
+PHPAPI zend_string *php_spl_object_hash(zval *obj);
#endif /* PHP_SPL_H */
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 8aab4c49bf..4f6efcac7d 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -87,7 +87,7 @@ static inline spl_array_object *spl_array_from_obj(zend_object *obj) /* {{{ */ {
#define Z_SPLARRAY_P(zv) spl_array_from_obj(Z_OBJ_P((zv)))
-static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) { /* {{{ */
+static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props) { /* {{{ */
if ((intern->ar_flags & SPL_ARRAY_IS_SELF) != 0) {
if (!intern->std.properties) {
rebuild_object_properties(&intern->std);
@@ -95,7 +95,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int
return intern->std.properties;
} else if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0) && Z_TYPE(intern->array) == IS_OBJECT) {
spl_array_object *other = Z_SPLARRAY_P(&intern->array);
- return spl_array_get_hash_table(other, check_std_props TSRMLS_CC);
+ return spl_array_get_hash_table(other, check_std_props);
} else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) {
if (!intern->std.properties) {
rebuild_object_properties(&intern->std);
@@ -106,7 +106,7 @@ static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int
}
} /* }}} */
-static void spl_array_rewind(spl_array_object *intern TSRMLS_DC);
+static void spl_array_rewind(spl_array_object *intern);
static void spl_array_update_pos(HashTable *ht, spl_array_object* intern) /* {{{ */
{
@@ -122,7 +122,7 @@ static void spl_array_set_pos(spl_array_object* intern, HashTable *ht, HashPosit
spl_array_update_pos(ht, intern);
} /* }}} */
-SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSRMLS_DC) /* {{{ */
+SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht) /* {{{ */
{
uint idx;
@@ -143,24 +143,24 @@ SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSR
}
}
/* HASH_UNPROTECT_RECURSION(ht); */
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
return FAILURE;
} /* }}} */
-SPL_API int spl_hash_verify_pos(spl_array_object * intern TSRMLS_DC) /* {{{ */
+SPL_API int spl_hash_verify_pos(spl_array_object * intern) /* {{{ */
{
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
- return spl_hash_verify_pos_ex(intern, ht TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
+ return spl_hash_verify_pos_ex(intern, ht);
}
/* }}} */
/* {{{ spl_array_object_free_storage */
-static void spl_array_object_free_storage(zend_object *object TSRMLS_DC)
+static void spl_array_object_free_storage(zend_object *object)
{
spl_array_object *intern = spl_array_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zval_ptr_dtor(&intern->array);
zval_ptr_dtor(&intern->retval);
@@ -172,10 +172,10 @@ static void spl_array_object_free_storage(zend_object *object TSRMLS_DC)
}
/* }}} */
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
/* {{{ spl_array_object_new_ex */
-static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC)
+static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig)
{
spl_array_object *intern;
zend_class_entry *parent = class_type;
@@ -183,7 +183,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
intern = ecalloc(1, sizeof(spl_array_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->ar_flags = 0;
@@ -227,7 +227,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
inherited = 1;
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of ArrayObject or ArrayIterator");
}
if (inherited) {
intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1);
@@ -270,40 +270,40 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zval *
}
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
return &intern->std;
}
/* }}} */
/* {{{ spl_array_object_new */
-static zend_object *spl_array_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_array_object_new(zend_class_entry *class_type)
{
- return spl_array_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_array_object_new_ex(class_type, NULL, 0);
}
/* }}} */
/* {{{ spl_array_object_clone */
-static zend_object *spl_array_object_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_array_object_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_array_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_array_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
+static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type) /* {{{ */
{
zval *retval;
zend_long index;
zend_string *offset_key;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
if (!offset || Z_ISUNDEF_P(offset)) {
return &EG(uninitialized_zval);
@@ -400,7 +400,7 @@ num_index:
}
} /* }}} */
-static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval *offset, int type, zval *zv) /* {{{ */
{
zval *ret;
@@ -424,7 +424,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
return &EG(uninitialized_zval);
}
}
- ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type TSRMLS_CC);
+ ret = spl_array_get_dimension_ptr(check_inherited, object, offset, type);
//!!! FIXME?
// ZVAL_COPY(result, ret);
@@ -442,12 +442,12 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
return ret;
} /* }}} */
-static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
- return spl_array_read_dimension_ex(1, object, offset, type, rv TSRMLS_CC);
+ return spl_array_read_dimension_ex(1, object, offset, type, rv);
} /* }}} */
-static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long index;
@@ -468,7 +468,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
}
if (!offset) {
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -485,7 +485,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
}
switch (Z_TYPE_P(offset)) {
case IS_STRING:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -507,7 +507,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
case IS_LONG:
index = Z_LVAL_P(offset);
num_index:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -515,7 +515,7 @@ num_index:
zend_hash_index_update(ht, index, value);
return;
case IS_NULL:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -528,12 +528,12 @@ num_index:
}
} /* }}} */
-static void spl_array_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_array_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
- spl_array_write_dimension_ex(1, object, offset, value TSRMLS_CC);
+ spl_array_write_dimension_ex(1, object, offset, value);
} /* }}} */
-static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset) /* {{{ */
{
zend_long index;
HashTable *ht;
@@ -548,13 +548,13 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
switch(Z_TYPE_P(offset)) {
case IS_STRING:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
if (ht == &EG(symbol_table).ht) {
- if (zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC)) {
+ if (zend_delete_global_variable(Z_STR_P(offset))) {
zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
} else {
@@ -574,7 +574,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
ZVAL_UNDEF(data);
}
//??? fix for ext/spl/tests/bug45614.phpt (may be fix is wrong)
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
} else if (zend_symtable_del(ht, Z_STR_P(offset)) == FAILURE) {
zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
@@ -599,7 +599,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
case IS_LONG:
index = Z_LVAL_P(offset);
num_index:
- ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ ht = spl_array_get_hash_table(intern, 0);
if (ht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -612,15 +612,15 @@ num_index:
zend_error(E_WARNING, "Illegal offset type");
return;
}
- spl_hash_verify_pos(intern TSRMLS_CC); /* call rewind on FAILURE */
+ spl_hash_verify_pos(intern); /* call rewind on FAILURE */
} /* }}} */
-static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_array_unset_dimension(zval *object, zval *offset) /* {{{ */
{
- spl_array_unset_dimension_ex(1, object, offset TSRMLS_CC);
+ spl_array_unset_dimension_ex(1, object, offset);
} /* }}} */
-static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long index;
@@ -636,12 +636,12 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
zend_call_method_with_1_params(object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset);
zval_ptr_dtor(offset);
- if (!Z_ISUNDEF(rv) && zend_is_true(&rv TSRMLS_CC)) {
+ if (!Z_ISUNDEF(rv) && zend_is_true(&rv)) {
zval_ptr_dtor(&rv);
if (check_empty != 1) {
return 1;
} else if (intern->fptr_offset_get) {
- value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC);
+ value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv);
}
} else {
zval_ptr_dtor(&rv);
@@ -650,7 +650,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
}
if (!value) {
- HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *ht = spl_array_get_hash_table(intern, 0);
switch(Z_TYPE_P(offset)) {
case IS_STRING:
@@ -693,30 +693,30 @@ num_index:
}
if (check_empty && check_inherited && intern->fptr_offset_get) {
- value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv TSRMLS_CC);
+ value = spl_array_read_dimension_ex(1, object, offset, BP_VAR_R, &rv);
} else {
value = tmp;
}
}
- return check_empty ? zend_is_true(value TSRMLS_CC) : Z_TYPE_P(value) != IS_NULL;
+ return check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
} /* }}} */
-static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_array_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
- return spl_array_has_dimension_ex(1, object, offset, check_empty TSRMLS_CC);
+ return spl_array_has_dimension_ex(1, object, offset, check_empty);
} /* }}} */
/* {{{ spl_array_object_verify_pos_ex */
-static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix TSRMLS_DC)
+static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashTable *ht, const char *msg_prefix)
{
if (!ht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix);
+ php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and is no longer an array", msg_prefix);
return FAILURE;
}
- if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix);
+ if (object->pos != INVALID_IDX && (object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, ht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "%sArray was modified outside object and internal position is no longer valid", msg_prefix);
return FAILURE;
}
@@ -724,9 +724,9 @@ static inline int spl_array_object_verify_pos_ex(spl_array_object *object, HashT
} /* }}} */
/* {{{ spl_array_object_verify_pos */
-static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht TSRMLS_DC)
+static inline int spl_array_object_verify_pos(spl_array_object *object, HashTable *ht)
{
- return spl_array_object_verify_pos_ex(object, ht, "" TSRMLS_CC);
+ return spl_array_object_verify_pos_ex(object, ht, "");
} /* }}} */
/* {{{ proto bool ArrayObject::offsetExists(mixed $index)
@@ -735,10 +735,10 @@ static inline int spl_array_object_verify_pos(spl_array_object *object, HashTabl
SPL_METHOD(Array, offsetExists)
{
zval *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2 TSRMLS_CC));
+ RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 2));
} /* }}} */
/* {{{ proto mixed ArrayObject::offsetGet(mixed $index)
@@ -747,10 +747,10 @@ SPL_METHOD(Array, offsetExists)
SPL_METHOD(Array, offsetGet)
{
zval *value, *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value TSRMLS_CC);
+ value = spl_array_read_dimension_ex(0, getThis(), index, BP_VAR_R, return_value);
if (value != return_value) {
RETURN_ZVAL(value, 1, 0);
}
@@ -762,28 +762,28 @@ SPL_METHOD(Array, offsetGet)
SPL_METHOD(Array, offsetSet)
{
zval *index, *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &index, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &index, &value) == FAILURE) {
return;
}
- spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC);
+ spl_array_write_dimension_ex(0, getThis(), index, value);
} /* }}} */
-void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */
+void spl_array_iterator_append(zval *object, zval *append_value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
if (Z_TYPE(intern->array) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Cannot append properties to objects, use %s::offsetSet() instead", Z_OBJCE_P(object)->name->val);
return;
}
- spl_array_write_dimension(object, NULL, append_value TSRMLS_CC);
+ spl_array_write_dimension(object, NULL, append_value);
if (intern->pos == INVALID_IDX) {
if (aht->nNumUsed && !Z_ISUNDEF(aht->arData[aht->nNumUsed-1].val)) {
spl_array_set_pos(intern, aht, aht->nNumUsed - 1);
@@ -798,10 +798,10 @@ SPL_METHOD(Array, append)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
- spl_array_iterator_append(getThis(), value TSRMLS_CC);
+ spl_array_iterator_append(getThis(), value);
} /* }}} */
/* {{{ proto void ArrayObject::offsetUnset(mixed $index)
@@ -810,10 +810,10 @@ SPL_METHOD(Array, append)
SPL_METHOD(Array, offsetUnset)
{
zval *index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
- spl_array_unset_dimension_ex(0, getThis(), index TSRMLS_CC);
+ spl_array_unset_dimension_ex(0, getThis(), index);
} /* }}} */
/* {{{ proto array ArrayObject::getArrayCopy()
@@ -825,25 +825,25 @@ SPL_METHOD(Array, getArrayCopy)
spl_array_object *intern = Z_SPLARRAY_P(object);
ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC));
+ zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0));
} /* }}} */
-static HashTable *spl_array_get_properties(zval *object TSRMLS_DC) /* {{{ */
+static HashTable *spl_array_get_properties(zval *object) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *result;
if (intern->nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Nesting level too deep - recursive dependency?");
+ php_error_docref(NULL, E_ERROR, "Nesting level too deep - recursive dependency?");
}
intern->nApplyCount++;
- result = spl_array_get_hash_table(intern, 1 TSRMLS_CC);
+ result = spl_array_get_hash_table(intern, 1);
intern->nApplyCount--;
return result;
} /* }}} */
-static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
zval *storage;
zend_string *zname;
@@ -872,7 +872,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /*
zval_add_ref(storage);
base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject;
- zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1 TSRMLS_CC);
+ zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1);
zend_symtable_update(intern->debug_info, zname, storage);
zend_string_release(zname);
}
@@ -882,67 +882,67 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /*
}
/* }}} */
-static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_array_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_read_dimension(object, member, type, rv TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_read_dimension(object, member, type, rv);
}
- return std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ return std_object_handlers.read_property(object, member, type, cache_slot, rv);
} /* }}} */
-static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+static void spl_array_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- spl_array_write_dimension(object, member, value TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ spl_array_write_dimension(object, member, value);
return;
}
- std_object_handlers.write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_object_handlers.write_property(object, member, value, cache_slot);
} /* }}} */
-static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *spl_array_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_get_dimension_ptr(1, object, member, type TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_get_dimension_ptr(1, object, member, type);
}
//!!! FIXME
- //return std_object_handlers.get_property_ptr_ptr(object, member, type, key TSRMLS_CC);
+ //return std_object_handlers.get_property_ptr_ptr(object, member, type, key);
return NULL;
} /* }}} */
-static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */
+static int spl_array_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- return spl_array_has_dimension(object, member, has_set_exists TSRMLS_CC);
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ return spl_array_has_dimension(object, member, has_set_exists);
}
- return std_object_handlers.has_property(object, member, has_set_exists, cache_slot TSRMLS_CC);
+ return std_object_handlers.has_property(object, member, has_set_exists, cache_slot);
} /* }}} */
-static void spl_array_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void spl_array_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
- && !std_object_handlers.has_property(object, member, 2, cache_slot TSRMLS_CC)) {
- spl_array_unset_dimension(object, member TSRMLS_CC);
- spl_array_rewind(intern TSRMLS_CC); /* because deletion might invalidate position */
+ && !std_object_handlers.has_property(object, member, 2, cache_slot)) {
+ spl_array_unset_dimension(object, member);
+ spl_array_rewind(intern); /* because deletion might invalidate position */
return;
}
- std_object_handlers.unset_property(object, member, cache_slot TSRMLS_CC);
+ std_object_handlers.unset_property(object, member, cache_slot);
} /* }}} */
-static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int spl_array_compare_objects(zval *o1, zval *o2) /* {{{ */
{
HashTable *ht1,
*ht2;
@@ -953,20 +953,20 @@ static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
intern1 = Z_SPLARRAY_P(o1);
intern2 = Z_SPLARRAY_P(o2);
- ht1 = spl_array_get_hash_table(intern1, 0 TSRMLS_CC);
- ht2 = spl_array_get_hash_table(intern2, 0 TSRMLS_CC);
+ ht1 = spl_array_get_hash_table(intern1, 0);
+ ht2 = spl_array_get_hash_table(intern2, 0);
- zend_compare_symbol_tables(&temp_zv, ht1, ht2 TSRMLS_CC);
+ zend_compare_symbol_tables(&temp_zv, ht1, ht2);
result = (int)Z_LVAL(temp_zv);
/* if we just compared std.properties, don't do it again */
if (result == 0 &&
!(ht1 == intern1->std.properties && ht2 == intern2->std.properties)) {
- result = std_object_handlers.compare_objects(o1, o2 TSRMLS_CC);
+ result = std_object_handlers.compare_objects(o1, o2);
}
return result;
} /* }}} */
-static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_string *string_key;
zend_ulong num_key;
@@ -995,51 +995,51 @@ static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSR
return FAILURE;
} /* }}} */
-static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_next_no_verify(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_hash_move_forward_ex(aht, &intern->pos);
spl_array_update_pos(aht, intern);
if (Z_TYPE(intern->array) == IS_OBJECT) {
- return spl_array_skip_protected(intern, aht TSRMLS_CC);
+ return spl_array_skip_protected(intern, aht);
} else {
return zend_hash_has_more_elements_ex(aht, &intern->pos);
}
} /* }}} */
-static int spl_array_next_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static int spl_array_next_ex(spl_array_object *intern, HashTable *aht) /* {{{ */
{
- if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
+ if ((intern->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(intern, aht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and internal position is no longer valid");
return FAILURE;
}
- return spl_array_next_no_verify(intern, aht TSRMLS_CC);
+ return spl_array_next_no_verify(intern, aht);
} /* }}} */
-static int spl_array_next(spl_array_object *intern TSRMLS_DC) /* {{{ */
+static int spl_array_next(spl_array_object *intern) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
- return spl_array_next_ex(intern, aht TSRMLS_CC);
+ return spl_array_next_ex(intern, aht);
} /* }}} */
-static void spl_array_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_dtor(zend_object_iterator *iter) /* {{{ */
{
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iter->data);
}
/* }}} */
-static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_array_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_VALID) {
- return zend_user_it_valid(iter TSRMLS_CC);
+ return zend_user_it_valid(iter);
} else {
- if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): " TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::valid(): ") == FAILURE) {
return FAILURE;
}
@@ -1048,13 +1048,13 @@ static int spl_array_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_CURRENT) {
- return zend_user_it_get_current_data(iter TSRMLS_CC);
+ return zend_user_it_get_current_data(iter);
} else {
zval *data = zend_hash_get_current_data_ex(aht, &object->pos);
if (Z_TYPE_P(data) == IS_INDIRECT) {
@@ -1065,15 +1065,15 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_KEY) {
- zend_user_it_get_current_key(iter, key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key);
} else {
- if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): " TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos_ex(object, aht, "ArrayIterator::current(): ") == FAILURE) {
ZVAL_NULL(key);
} else {
zend_hash_get_current_key_zval_ex(aht, key, &object->pos);
@@ -1082,66 +1082,66 @@ static void spl_array_it_get_current_key(zend_object_iterator *iter, zval *key T
}
/* }}} */
-static void spl_array_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
- HashTable *aht = spl_array_get_hash_table(object, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(object, 0);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_NEXT) {
- zend_user_it_move_forward(iter TSRMLS_CC);
+ zend_user_it_move_forward(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::current(): Array was modified outside object and is no longer an array");
return;
}
- if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid");
+ if ((object->ar_flags & SPL_ARRAY_IS_REF) && spl_hash_verify_pos_ex(object, aht) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::next(): Array was modified outside object and internal position is no longer valid");
} else {
- spl_array_next_no_verify(object, aht TSRMLS_CC);
+ spl_array_next_no_verify(object, aht);
}
}
}
/* }}} */
-static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
+static void spl_array_rewind_ex(spl_array_object *intern, HashTable *aht) /* {{{ */
{
zend_hash_internal_pointer_reset_ex(aht, &intern->pos);
spl_array_update_pos(aht, intern);
- spl_array_skip_protected(intern, aht TSRMLS_CC);
+ spl_array_skip_protected(intern, aht);
} /* }}} */
-static void spl_array_rewind(spl_array_object *intern TSRMLS_DC) /* {{{ */
+static void spl_array_rewind(spl_array_object *intern) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "ArrayIterator::rewind(): Array was modified outside object and is no longer an array");
return;
}
- spl_array_rewind_ex(intern, aht TSRMLS_CC);
+ spl_array_rewind_ex(intern, aht);
}
/* }}} */
-static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_array_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_array_object *object = Z_SPLARRAY_P(&iter->data);
if (object->ar_flags & SPL_ARRAY_OVERLOADED_REWIND) {
- zend_user_it_rewind(iter TSRMLS_CC);
+ zend_user_it_rewind(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
- spl_array_rewind(object TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
+ spl_array_rewind(object);
}
}
/* }}} */
/* {{{ spl_array_set_array */
-static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array TSRMLS_DC) {
+static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array) {
if (Z_TYPE_P(array) == IS_ARRAY) {
SEPARATE_ARRAY(array);
@@ -1157,7 +1157,7 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
ZVAL_COPY_VALUE(&intern->array, array);
} else {
if (Z_TYPE_P(array) != IS_OBJECT && Z_TYPE_P(array) != IS_ARRAY) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead", 0);
return;
}
zval_ptr_dtor(&intern->array);
@@ -1174,12 +1174,12 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
if (Z_TYPE_P(array) == IS_OBJECT) {
zend_object_get_properties_t handler = Z_OBJ_HANDLER_P(array, get_properties);
if ((handler != std_object_handlers.get_properties && handler != spl_array_get_properties)
- || !spl_array_get_hash_table(intern, 0 TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
+ || !spl_array_get_hash_table(intern, 0)) {
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Overloaded object of type %s is not compatible with %s", Z_OBJCE_P(array)->name, intern->std.ce->name);
}
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
}
/* }}} */
@@ -1193,7 +1193,7 @@ zend_object_iterator_funcs spl_array_it_funcs = {
spl_array_it_rewind
};
-zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
zend_user_iterator *iterator;
spl_array_object *array_object = Z_SPLARRAY_P(object);
@@ -1204,7 +1204,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object,
iterator = emalloc(sizeof(zend_user_iterator));
- zend_iterator_init(&iterator->it TSRMLS_CC);
+ zend_iterator_init(&iterator->it);
ZVAL_COPY(&iterator->it.data, object);
iterator->it.funcs = &spl_array_it_funcs;
@@ -1231,12 +1231,12 @@ SPL_METHOD(Array, __construct)
return; /* nothing to do */
}
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
intern = Z_SPLARRAY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|lC", &array, &ar_flags, &ce_get_iterator) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -1246,9 +1246,9 @@ SPL_METHOD(Array, __construct)
ar_flags &= ~SPL_ARRAY_INT_MASK;
- spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1 TSRMLS_CC);
+ spl_array_set_array(object, intern, array, ar_flags, ZEND_NUM_ARGS() == 1);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1262,7 +1262,7 @@ SPL_METHOD(Array, setIteratorClass)
zend_class_entry * ce_get_iterator = spl_ce_Iterator;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &ce_get_iterator) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce_get_iterator) == FAILURE) {
return;
}
#else
@@ -1314,7 +1314,7 @@ SPL_METHOD(Array, setFlags)
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long ar_flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ar_flags) == FAILURE) {
return;
}
@@ -1330,12 +1330,12 @@ SPL_METHOD(Array, exchangeArray)
spl_array_object *intern = Z_SPLARRAY_P(object);
ZVAL_NEW_ARR(return_value);
- zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC));
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &array) == FAILURE) {
+ zend_array_dup(Z_ARRVAL_P(return_value), spl_array_get_hash_table(intern, 0));
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &array) == FAILURE) {
return;
}
- spl_array_set_array(object, intern, array, 0L, 1 TSRMLS_CC);
+ spl_array_set_array(object, intern, array, 0L, 1);
}
/* }}} */
@@ -1345,18 +1345,18 @@ SPL_METHOD(Array, getIterator)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
- ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0 TSRMLS_CC));
+ ZVAL_OBJ(return_value, spl_array_object_new_ex(intern->ce_get_iterator, object, 0));
Z_SET_REFCOUNT_P(return_value, 1);
//!!!PZ_SET_ISREF_P(return_value);
}
@@ -1373,7 +1373,7 @@ SPL_METHOD(Array, rewind)
return;
}
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
}
/* }}} */
@@ -1384,40 +1384,40 @@ SPL_METHOD(Array, seek)
zend_long opos, position;
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) {
return;
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
opos = position;
if (position >= 0) { /* negative values are not supported */
- spl_array_rewind(intern TSRMLS_CC);
+ spl_array_rewind(intern);
result = SUCCESS;
- while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS);
+ while (position-- > 0 && (result = spl_array_next(intern)) == SUCCESS);
if (result == SUCCESS && zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) {
return; /* ok */
}
}
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %pd is out of range", opos);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position %pd is out of range", opos);
} /* }}} */
-int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count TSRMLS_DC) /* {{{ */
+int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count) /* {{{ */
{
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
HashPosition pos;
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
*count = 0;
return FAILURE;
}
@@ -1427,8 +1427,8 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend
* we're going to call and which do not support 'pos' as parameter. */
pos = intern->pos;
*count = 0;
- spl_array_rewind(intern TSRMLS_CC);
- while(intern->pos != INVALID_IDX && spl_array_next(intern TSRMLS_CC) == SUCCESS) {
+ spl_array_rewind(intern);
+ while(intern->pos != INVALID_IDX && spl_array_next(intern) == SUCCESS) {
(*count)++;
}
spl_array_set_pos(intern, aht, pos);
@@ -1439,7 +1439,7 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, zend
}
} /* }}} */
-int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+int spl_array_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
@@ -1456,7 +1456,7 @@ int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /*
*count = 0;
return FAILURE;
}
- return spl_array_object_count_elements_helper(intern, count TSRMLS_CC);
+ return spl_array_object_count_elements_helper(intern, count);
} /* }}} */
/* {{{ proto int ArrayObject::count()
@@ -1471,7 +1471,7 @@ SPL_METHOD(Array, count)
return;
}
- spl_array_object_count_elements_helper(intern, &count TSRMLS_CC);
+ spl_array_object_count_elements_helper(intern, &count);
RETURN_LONG(count);
} /* }}} */
@@ -1479,7 +1479,7 @@ SPL_METHOD(Array, count)
static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(getThis());
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
zval tmp, *arg = NULL;
zval retval;
@@ -1490,25 +1490,25 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam
if (!use_arg) {
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL);
aht->u.v.nApplyCount--;
} else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "|z", &arg) == FAILURE) {
zval_ptr_dtor(&tmp);
- zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0);
return;
}
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg);
aht->u.v.nApplyCount--;
} else {
- if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
zval_ptr_dtor(&tmp);
- zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0);
return;
}
aht->u.v.nApplyCount++;
- zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg TSRMLS_CC);
+ zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg);
aht->u.v.nApplyCount--;
}
/* A tricky way to pass "aht" by reference, copy back and cleanup */
@@ -1566,13 +1566,13 @@ SPL_METHOD(Array, current)
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
zval *entry;
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1597,15 +1597,15 @@ SPL_METHOD(Array, key)
return;
}
- spl_array_iterator_key(getThis(), return_value TSRMLS_CC);
+ spl_array_iterator_key(getThis(), return_value);
} /* }}} */
-void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC) /* {{{ */
+void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1619,17 +1619,17 @@ SPL_METHOD(Array, next)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
- spl_array_next_no_verify(intern, aht TSRMLS_CC);
+ spl_array_next_no_verify(intern, aht);
}
/* }}} */
@@ -1639,13 +1639,13 @@ SPL_METHOD(Array, valid)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
RETURN_FALSE;
} else {
RETURN_BOOL(zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS);
@@ -1659,13 +1659,13 @@ SPL_METHOD(Array, hasChildren)
{
zval *object = getThis(), *entry;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
RETURN_FALSE;
}
@@ -1683,13 +1683,13 @@ SPL_METHOD(Array, getChildren)
{
zval *object = getThis(), *entry, flags;
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if (spl_array_object_verify_pos(intern, aht TSRMLS_CC) == FAILURE) {
+ if (spl_array_object_verify_pos(intern, aht) == FAILURE) {
return;
}
@@ -1701,13 +1701,13 @@ SPL_METHOD(Array, getChildren)
if ((intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) != 0) {
return;
}
- if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(getThis()))) {
RETURN_ZVAL(entry, 1, 0);
}
}
ZVAL_LONG(&flags, SPL_ARRAY_USE_OTHER | intern->ar_flags);
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, entry, &flags);
}
/* }}} */
@@ -1717,7 +1717,7 @@ SPL_METHOD(Array, serialize)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ HashTable *aht = spl_array_get_hash_table(intern, 0);
zval members, flags;
php_serialize_data_t var_hash;
smart_str buf = {0};
@@ -1727,7 +1727,7 @@ SPL_METHOD(Array, serialize)
}
if (!aht) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified outside object and is no longer an array");
+ php_error_docref(NULL, E_NOTICE, "Array was modified outside object and is no longer an array");
return;
}
@@ -1738,10 +1738,10 @@ SPL_METHOD(Array, serialize)
/* storage */
smart_str_appendl(&buf, "x:", 2);
//!!! php_var_serialize need to be modified
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
if (!(intern->ar_flags & SPL_ARRAY_IS_SELF)) {
- php_var_serialize(&buf, &intern->array, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &intern->array, &var_hash);
smart_str_appendc(&buf, ';');
}
@@ -1754,7 +1754,7 @@ SPL_METHOD(Array, serialize)
ZVAL_NEW_ARR(&members);
zend_array_dup(Z_ARRVAL(members), intern->std.properties);
- php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */
+ php_var_serialize(&buf, &members, &var_hash); /* finishes the string */
zval_ptr_dtor(&members);
@@ -1783,7 +1783,7 @@ SPL_METHOD(Array, unserialize)
HashTable *aht;
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -1791,7 +1791,7 @@ SPL_METHOD(Array, unserialize)
return;
}
- aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+ aht = spl_array_get_hash_table(intern, 0);
if (aht->u.v.nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
@@ -1806,7 +1806,7 @@ SPL_METHOD(Array, unserialize)
}
++p;
- if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(zflags) != IS_LONG) {
+ if (!php_var_unserialize(&zflags, &p, s + buf_len, &var_hash) || Z_TYPE(zflags) != IS_LONG) {
goto outexcept;
}
@@ -1829,7 +1829,7 @@ SPL_METHOD(Array, unserialize)
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;
intern->ar_flags |= flags & SPL_ARRAY_CLONE_MASK;
zval_ptr_dtor(&intern->array);
- if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
}
@@ -1845,13 +1845,13 @@ SPL_METHOD(Array, unserialize)
++p;
ZVAL_UNDEF(&members);
- if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(members) != IS_ARRAY) {
+ if (!php_var_unserialize(&members, &p, s + buf_len, &var_hash) || Z_TYPE(members) != IS_ARRAY) {
zval_ptr_dtor(&members);
goto outexcept;
}
/* copy members */
- object_properties_load(&intern->std, Z_ARRVAL(members) TSRMLS_CC);
+ object_properties_load(&intern->std, Z_ARRVAL(members));
zval_ptr_dtor(&members);
/* done reading $serialized */
@@ -1861,7 +1861,7 @@ SPL_METHOD(Array, unserialize)
outexcept:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h
index c27e55bbec..189038032e 100644
--- a/ext/spl/spl_array.h
+++ b/ext/spl/spl_array.h
@@ -31,8 +31,8 @@ extern PHPAPI zend_class_entry *spl_ce_RecursiveArrayIterator;
PHP_MINIT_FUNCTION(spl_array);
-extern void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC);
-extern void spl_array_iterator_key(zval *object, zval *return_value TSRMLS_DC);
+extern void spl_array_iterator_append(zval *object, zval *append_value);
+extern void spl_array_iterator_key(zval *object, zval *return_value);
#endif /* SPL_ARRAY_H */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 8da1d1165f..8e67e8af90 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -60,7 +60,7 @@ PHPAPI zend_class_entry *spl_ce_GlobIterator;
PHPAPI zend_class_entry *spl_ce_SplFileObject;
PHPAPI zend_class_entry *spl_ce_SplTempFileObject;
-static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static void spl_filesystem_file_free_line(spl_filesystem_object *intern) /* {{{ */
{
if (intern->u.file.current_line) {
efree(intern->u.file.current_line);
@@ -72,15 +72,15 @@ static void spl_filesystem_file_free_line(spl_filesystem_object *intern TSRMLS_D
}
} /* }}} */
-static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_filesystem_object_free_storage(zend_object *object) /* {{{ */
{
spl_filesystem_object *intern = spl_filesystem_from_obj(object);
if (intern->oth_handler && intern->oth_handler->dtor) {
- intern->oth_handler->dtor(intern TSRMLS_CC);
+ intern->oth_handler->dtor(intern);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->_path) {
efree(intern->_path);
@@ -119,7 +119,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /*
efree(intern->orig_path);
}
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
break;
}
@@ -139,7 +139,7 @@ static void spl_filesystem_object_free_storage(zend_object *object TSRMLS_DC) /*
- clone
- new
*/
-static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type)
{
spl_filesystem_object *intern;
@@ -148,7 +148,7 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS
intern->file_class = spl_ce_SplFileObject;
intern->info_class = spl_ce_SplFileInfo;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_filesystem_object_handlers;
@@ -158,22 +158,22 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type TS
/* {{{ spl_filesystem_object_new */
/* See spl_filesystem_object_new_ex */
-static zend_object *spl_filesystem_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new(zend_class_entry *class_type)
{
- return spl_filesystem_object_new_ex(class_type TSRMLS_CC);
+ return spl_filesystem_object_new_ex(class_type);
}
/* }}} */
/* {{{ spl_filesystem_object_new_check */
-static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_filesystem_object_new_check(zend_class_entry *class_type)
{
- spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type TSRMLS_CC));
+ spl_filesystem_object *ret = spl_filesystem_from_obj(spl_filesystem_object_new_ex(class_type));
ret->std.handlers = &spl_filesystem_object_check_handlers;
return &ret->std;
}
/* }}} */
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC) /* {{{ */
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len) /* {{{ */
{
#ifdef HAVE_GLOB
if (intern->type == SPL_FS_DIR) {
@@ -188,7 +188,7 @@ PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_
return intern->_path;
} /* }}} */
-static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *intern) /* {{{ */
{
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
@@ -196,18 +196,18 @@ static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *in
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized");
+ php_error_docref(NULL, E_ERROR, "Object not initialized");
break;
case SPL_FS_DIR:
intern->file_name_len = (int)spprintf(&intern->file_name, 0, "%s%c%s",
- spl_filesystem_object_get_path(intern, NULL TSRMLS_CC),
+ spl_filesystem_object_get_path(intern, NULL),
slash, intern->u.dir.entry.d_name);
break;
}
}
} /* }}} */
-static int spl_filesystem_dir_read(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static int spl_filesystem_dir_read(spl_filesystem_object *intern) /* {{{ */
{
if (!intern->u.dir.dirp || !php_stream_readdir(intern->u.dir.dirp, &intern->u.dir.entry)) {
intern->u.dir.entry.d_name[0] = '\0';
@@ -228,7 +228,7 @@ static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */
/* {{{ spl_filesystem_dir_open */
/* open a directory resource */
-static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TSRMLS_DC)
+static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path)
{
int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS);
@@ -252,23 +252,23 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS
}
} else {
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
}
/* }}} */
-static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent) /* {{{ */
{
zval tmp;
intern->type = SPL_FS_FILE;
- php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp TSRMLS_CC);
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp);
if (Z_TYPE(tmp) == IS_TRUE) {
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Cannot use SplFileObject with directories");
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Cannot use SplFileObject with directories");
return FAILURE;
}
@@ -277,7 +277,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
if (!intern->file_name_len || !intern->u.file.stream) {
if (!EG(exception)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : "");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot open file '%s'", intern->file_name_len ? intern->file_name : "");
}
intern->file_name = NULL; /* until here it is not a copy */
intern->u.file.open_mode = NULL;
@@ -322,7 +322,7 @@ static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_inclu
Open the directory
Clone other members (properties)
*/
-static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_filesystem_object_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
@@ -332,7 +332,7 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
old_object = Z_OBJ_P(zobject);
source = spl_filesystem_from_obj(old_object);
- new_object = spl_filesystem_object_new_ex(old_object->ce TSRMLS_CC);
+ new_object = spl_filesystem_object_new_ex(old_object->ce);
intern = spl_filesystem_from_obj(new_object);
intern->flags = source->flags;
@@ -345,18 +345,18 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
intern->file_name = estrndup(source->file_name, intern->file_name_len);
break;
case SPL_FS_DIR:
- spl_filesystem_dir_open(intern, source->_path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, source->_path);
/* read until we hit the position in which we were before */
skip_dots = SPL_HAS_FLAG(source->flags, SPL_FILE_DIR_SKIPDOTS);
for(index = 0; index < source->u.dir.index; ++index) {
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
intern->u.dir.index = index;
break;
case SPL_FS_FILE:
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val);
+ php_error_docref(NULL, E_ERROR, "An object of class %s cannot be cloned", old_object->ce->name->val);
break;
}
@@ -365,17 +365,17 @@ static zend_object *spl_filesystem_object_clone(zval *zobject TSRMLS_DC)
intern->oth = source->oth;
intern->oth_handler = source->oth_handler;
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
if (intern->oth_handler && intern->oth_handler->clone) {
- intern->oth_handler->clone(source, intern TSRMLS_CC);
+ intern->oth_handler->clone(source, intern);
}
return new_object;
}
/* }}} */
-void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy TSRMLS_DC) /* {{{ */
+void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, size_t len, size_t use_copy) /* {{{ */
{
char *p1, *p2;
@@ -409,7 +409,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path,
intern->_path = estrndup(path, intern->_path_len);
} /* }}} */
-static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */
+static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_object *source, char *file_path, int file_path_len, int use_copy, zend_class_entry *ce, zval *return_value) /* {{{ */
{
spl_filesystem_object *intern;
zval arg1;
@@ -417,7 +417,7 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
if (!file_path || !file_path_len) {
#if defined(PHP_WIN32)
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot create SplFileInfo for empty path");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot create SplFileInfo for empty path");
if (file_path && !use_copy) {
efree(file_path);
}
@@ -431,13 +431,13 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
return NULL;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
ce = ce ? ce : source->info_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
if (ce->constructor->common.scope != spl_ce_SplFileInfo) {
@@ -445,21 +445,21 @@ static spl_filesystem_object *spl_filesystem_object_create_info(spl_filesystem_o
zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1);
zval_ptr_dtor(&arg1);
} else {
- spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy TSRMLS_CC);
+ spl_filesystem_info_set_filename(intern, file_path, file_path_len, use_copy);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return intern;
} /* }}} */
-static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value TSRMLS_DC) /* {{{ */
+static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_filesystem_object *source, int type, zend_class_entry *ce, zval *return_value) /* {{{ */
{
spl_filesystem_object *intern;
zend_bool use_include_path = 0;
zval arg1, arg2;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
switch (source->type) {
case SPL_FS_INFO:
@@ -467,8 +467,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
break;
case SPL_FS_DIR:
if (!source->u.dir.entry.d_name[0]) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Could not open file");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Could not open file");
+ zend_restore_error_handling(&error_handling);
return NULL;
}
}
@@ -477,12 +477,12 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
case SPL_FS_INFO:
ce = ce ? ce : source->info_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
- spl_filesystem_object_get_file_name(source TSRMLS_CC);
+ spl_filesystem_object_get_file_name(source);
if (ce->constructor->common.scope != spl_ce_SplFileInfo) {
ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len);
zend_call_method_with_1_params(return_value, ce, &ce->constructor, "__construct", NULL, &arg1);
@@ -490,20 +490,20 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
} else {
intern->file_name = estrndup(source->file_name, source->file_name_len);
intern->file_name_len = source->file_name_len;
- intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC);
+ intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len);
intern->_path = estrndup(intern->_path, intern->_path_len);
}
break;
case SPL_FS_FILE:
ce = ce ? ce : source->file_class;
- zend_update_class_constants(ce TSRMLS_CC);
+ zend_update_class_constants(ce);
- intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce TSRMLS_CC));
+ intern = spl_filesystem_from_obj(spl_filesystem_object_new_ex(ce));
ZVAL_OBJ(return_value, &intern->std);
- spl_filesystem_object_get_file_name(source TSRMLS_CC);
+ spl_filesystem_object_get_file_name(source);
if (ce->constructor->common.scope != spl_ce_SplFileObject) {
ZVAL_STRINGL(&arg1, source->file_name, source->file_name_len);
@@ -514,16 +514,16 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
} else {
intern->file_name = source->file_name;
intern->file_name_len = source->file_name_len;
- intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len TSRMLS_CC);
+ intern->_path = spl_filesystem_object_get_path(source, &intern->_path_len);
intern->_path = estrndup(intern->_path, intern->_path_len);
intern->u.file.open_mode = "r";
intern->u.file.open_mode_len = 1;
- if (ht && zend_parse_parameters(ht TSRMLS_CC, "|sbr",
+ if (ht && zend_parse_parameters(ht, "|sbr",
&intern->u.file.open_mode, &intern->u.file.open_mode_len,
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
zval_ptr_dtor(return_value);
@@ -531,8 +531,8 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
return NULL;
}
- if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (spl_filesystem_file_open(intern, use_include_path, 0) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
zval_ptr_dtor(return_value);
ZVAL_NULL(return_value);
return NULL;
@@ -540,11 +540,11 @@ static spl_filesystem_object *spl_filesystem_object_create_type(int ht, spl_file
}
break;
case SPL_FS_DIR:
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Operation not supported");
+ zend_restore_error_handling(&error_handling);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Operation not supported");
return NULL;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
} /* }}} */
@@ -554,7 +554,7 @@ static int spl_filesystem_is_invalid_or_dot(const char * d_name) /* {{{ */
}
/* }}} */
-static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len TSRMLS_DC) { /* {{{ */
+static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, size_t *len) { /* {{{ */
switch (intern->type) {
case SPL_FS_INFO:
case SPL_FS_FILE:
@@ -562,7 +562,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s
return intern->file_name;
case SPL_FS_DIR:
if (intern->u.dir.entry.d_name[0]) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
*len = intern->file_name_len;
return intern->file_name;
}
@@ -572,7 +572,7 @@ static char *spl_filesystem_object_get_pathname(spl_filesystem_object *intern, s
}
/* }}} */
-static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_temp) /* {{{ */
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(object);
zval tmp;
@@ -592,15 +592,15 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_array_dup(rv, intern->std.properties);
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1 TSRMLS_CC);
- path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1);
+ path = spl_filesystem_object_get_pathname(intern, &path_len);
ZVAL_STRINGL(&tmp, path, path_len);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
if (intern->file_name) {
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1 TSRMLS_CC);
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
ZVAL_STRINGL(&tmp, intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1));
@@ -612,7 +612,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
}
if (intern->type == SPL_FS_DIR) {
#ifdef HAVE_GLOB
- pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1);
if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) {
ZVAL_STRINGL(&tmp, intern->_path, intern->_path_len);
} else {
@@ -621,7 +621,7 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
#endif
- pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1);
if (intern->u.dir.sub_path) {
ZVAL_STRINGL(&tmp, intern->u.dir.sub_path, intern->u.dir.sub_path_len);
} else {
@@ -631,18 +631,18 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
zend_string_release(pnstr);
}
if (intern->type == SPL_FS_FILE) {
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1);
ZVAL_STRINGL(&tmp, intern->u.file.open_mode, intern->u.file.open_mode_len);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
stmp[1] = '\0';
stmp[0] = intern->u.file.delimiter;
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1);
ZVAL_STRINGL(&tmp, stmp, 1);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
stmp[0] = intern->u.file.enclosure;
- pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1);
ZVAL_STRINGL(&tmp, stmp, 1);
zend_symtable_update(rv, pnstr, &tmp);
zend_string_release(pnstr);
@@ -652,19 +652,19 @@ static HashTable *spl_filesystem_object_get_debug_info(zval *object, int *is_tem
}
/* }}} */
-zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
+zend_function *spl_filesystem_object_get_method_check(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
spl_filesystem_object *fsobj = spl_filesystem_from_obj(*object);
if (fsobj->u.dir.entry.d_name[0] == '\0' && fsobj->orig_path == NULL) {
zend_function *func;
zend_string *tmp = zend_string_init("_bad_state_ex", sizeof("_bad_state_ex") - 1, 0);
- func = zend_get_std_object_handlers()->get_method(object, tmp, NULL TSRMLS_CC);
+ func = zend_get_std_object_handlers()->get_method(object, tmp, NULL);
zend_string_release(tmp);
return func;
}
- return zend_get_std_object_handlers()->get_method(object, method, key TSRMLS_CC);
+ return zend_get_std_object_handlers()->get_method(object, method, key);
}
/* }}} */
@@ -679,14 +679,14 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
zend_long flags;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_FLAGS)) {
flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_FILEINFO;
- parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &len, &flags);
+ parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &len, &flags);
} else {
flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF;
- parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len);
+ parsed = zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len);
}
if (SPL_HAS_FLAG(ctor_flags, SPL_FILE_DIR_SKIPDOTS)) {
flags |= SPL_FILE_DIR_SKIPDOTS;
@@ -695,38 +695,38 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
flags |= SPL_FILE_DIR_UNIXPATHS;
}
if (parsed == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return;
}
if (!len) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Directory name must not be empty.");
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Directory name must not be empty.");
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLFILESYSTEM_P(getThis());
if (intern->_path) {
/* object is alreay initialized */
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized");
+ zend_restore_error_handling(&error_handling);
+ php_error_docref(NULL, E_WARNING, "Directory object is already initialized");
return;
}
intern->flags = flags;
#ifdef HAVE_GLOB
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) {
spprintf(&path, 0, "glob://%s", path);
- spl_filesystem_dir_open(intern, path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, path);
efree(path);
} else
#endif
{
- spl_filesystem_dir_open(intern, path TSRMLS_CC);
+ spl_filesystem_dir_open(intern, path);
}
- intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0;
+ intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator) ? 1 : 0;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -752,7 +752,7 @@ SPL_METHOD(DirectoryIterator, rewind)
if (intern->u.dir.dirp) {
php_stream_rewinddir(intern->u.dir.dirp);
}
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
}
/* }}} */
@@ -798,7 +798,7 @@ SPL_METHOD(DirectoryIterator, next)
intern->u.dir.index++;
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
if (intern->file_name) {
efree(intern->file_name);
@@ -815,7 +815,7 @@ SPL_METHOD(DirectoryIterator, seek)
zval retval;
zend_long pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) {
return;
}
@@ -828,7 +828,7 @@ SPL_METHOD(DirectoryIterator, seek)
int valid = 0;
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval);
if (!Z_ISUNDEF(retval)) {
- valid = zend_is_true(&retval TSRMLS_CC);
+ valid = zend_is_true(&retval);
zval_ptr_dtor(&retval);
}
if (!valid) {
@@ -864,7 +864,7 @@ SPL_METHOD(SplFileInfo, getPath)
return;
}
- path = spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ path = spl_filesystem_object_get_path(intern, &path_len);
RETURN_STRINGL(path, path_len);
}
/* }}} */
@@ -880,7 +880,7 @@ SPL_METHOD(SplFileInfo, getFilename)
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
RETURN_STRINGL(intern->file_name + path_len + 1, intern->file_name_len - (path_len + 1));
@@ -920,7 +920,7 @@ SPL_METHOD(SplFileInfo, getExtension)
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
fname = intern->file_name + path_len + 1;
@@ -930,7 +930,7 @@ SPL_METHOD(SplFileInfo, getExtension)
flen = intern->file_name_len;
}
- ret = php_basename(fname, flen, NULL, 0 TSRMLS_CC);
+ ret = php_basename(fname, flen, NULL, 0);
p = zend_memrchr(ret->val, '.', ret->len);
if (p) {
@@ -959,7 +959,7 @@ SPL_METHOD(DirectoryIterator, getExtension)
return;
}
- fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0 TSRMLS_CC);
+ fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), NULL, 0);
p = zend_memrchr(fname->val, '.', fname->len);
if (p) {
@@ -983,11 +983,11 @@ SPL_METHOD(SplFileInfo, getBasename)
size_t flen;
size_t slen = 0, path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) {
return;
}
- spl_filesystem_object_get_path(intern, &path_len TSRMLS_CC);
+ spl_filesystem_object_get_path(intern, &path_len);
if (path_len && path_len < intern->file_name_len) {
fname = intern->file_name + path_len + 1;
@@ -997,7 +997,7 @@ SPL_METHOD(SplFileInfo, getBasename)
flen = intern->file_name_len;
}
- RETURN_STR(php_basename(fname, flen, suffix, slen TSRMLS_CC));
+ RETURN_STR(php_basename(fname, flen, suffix, slen));
}
/* }}}*/
@@ -1010,11 +1010,11 @@ SPL_METHOD(DirectoryIterator, getBasename)
size_t slen = 0;
zend_string *fname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &suffix, &slen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &suffix, &slen) == FAILURE) {
return;
}
- fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen TSRMLS_CC);
+ fname = php_basename(intern->u.dir.entry.d_name, strlen(intern->u.dir.entry.d_name), suffix, slen);
RETVAL_STR(fname);
}
@@ -1031,7 +1031,7 @@ SPL_METHOD(SplFileInfo, getPathname)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ path = spl_filesystem_object_get_pathname(intern, &path_len);
if (path != NULL) {
RETURN_STRINGL(path, path_len);
} else {
@@ -1053,7 +1053,7 @@ SPL_METHOD(FilesystemIterator, key)
if (SPL_FILE_DIR_KEY(intern, SPL_FILE_DIR_KEY_AS_FILENAME)) {
RETURN_STRING(intern->u.dir.entry.d_name);
} else {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
RETURN_STRINGL(intern->file_name, intern->file_name_len);
}
}
@@ -1070,11 +1070,11 @@ SPL_METHOD(FilesystemIterator, current)
}
if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
RETURN_STRINGL(intern->file_name, intern->file_name_len);
} else if (SPL_FILE_DIR_CURRENT(intern, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
- spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
+ spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value);
} else {
RETURN_ZVAL(getThis(), 1, 0);
/*RETURN_STRING(intern->u.dir.entry.d_name, 1);*/
@@ -1112,18 +1112,18 @@ SPL_METHOD(SplFileInfo, __construct)
size_t len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &len) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &len) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLFILESYSTEM_P(getThis());
- spl_filesystem_info_set_filename(intern, path, len, 1 TSRMLS_CC);
+ spl_filesystem_info_set_filename(intern, path, len, 1);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
/* intern->type = SPL_FS_INFO; already set */
}
@@ -1139,10 +1139,10 @@ SPL_METHOD(SplFileInfo, func_name) \
return; \
} \
\
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);\
- spl_filesystem_object_get_file_name(intern TSRMLS_CC); \
- php_stat(intern->file_name, intern->file_name_len, func_num, return_value TSRMLS_CC); \
- zend_restore_error_handling(&error_handling TSRMLS_CC); \
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);\
+ spl_filesystem_object_get_file_name(intern); \
+ php_stat(intern->file_name, intern->file_name_len, func_num, return_value); \
+ zend_restore_error_handling(&error_handling); \
}
/* }}} */
@@ -1234,16 +1234,16 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
return;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
#if defined(PHP_WIN32) || HAVE_SYMLINK
if (intern->file_name == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty filename");
+ php_error_docref(NULL, E_WARNING, "Empty filename");
RETURN_FALSE;
} else if (!IS_ABSOLUTE_PATH(intern->file_name, intern->file_name_len)) {
char expanded_path[MAXPATHLEN];
- if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_with_mode(intern->file_name, expanded_path, NULL, 0, CWD_EXPAND )) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
ret = php_sys_readlink(expanded_path, buff, MAXPATHLEN - 1);
@@ -1255,7 +1255,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
#endif
if (ret == -1) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Unable to read link %s, error: %s", intern->file_name, strerror(errno));
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Unable to read link %s, error: %s", intern->file_name, strerror(errno));
RETVAL_FALSE;
} else {
/* Append NULL to the end of the string */
@@ -1264,7 +1264,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
RETVAL_STRINGL(buff, ret);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1282,10 +1282,10 @@ SPL_METHOD(SplFileInfo, getRealPath)
return;
}
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
if (intern->type == SPL_FS_DIR && !intern->file_name && intern->u.dir.entry.d_name[0]) {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
}
if (intern->orig_path) {
@@ -1306,7 +1306,7 @@ SPL_METHOD(SplFileInfo, getRealPath)
RETVAL_FALSE;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
#endif
@@ -1317,7 +1317,7 @@ SPL_METHOD(SplFileInfo, openFile)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value TSRMLS_CC);
+ spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value);
}
/* }}} */
@@ -1329,13 +1329,13 @@ SPL_METHOD(SplFileInfo, setFileClass)
zend_class_entry *ce = spl_ce_SplFileObject;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
intern->file_class = ce;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1347,13 +1347,13 @@ SPL_METHOD(SplFileInfo, setInfoClass)
zend_class_entry *ce = spl_ce_SplFileInfo;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling );
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
intern->info_class = ce;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1365,13 +1365,13 @@ SPL_METHOD(SplFileInfo, getFileInfo)
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
- spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
+ spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_INFO, ce, return_value);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1383,27 +1383,27 @@ SPL_METHOD(SplFileInfo, getPathInfo)
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &ce) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &ce) == SUCCESS) {
size_t path_len;
- char *path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ char *path = spl_filesystem_object_get_pathname(intern, &path_len);
if (path) {
char *dpath = estrndup(path, path_len);
path_len = php_dirname(dpath, path_len);
- spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value TSRMLS_CC);
+ spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value);
efree(dpath);
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
/* {{{ proto SplFileInfo::_bad_state_ex(void) */
SPL_METHOD(SplFileInfo, _bad_state_ex)
{
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The parent constructor was not called: the object is in an "
"invalid state ");
}
@@ -1433,7 +1433,7 @@ SPL_METHOD(FilesystemIterator, rewind)
php_stream_rewinddir(intern->u.dir.dirp);
}
do {
- spl_filesystem_dir_read(intern TSRMLS_CC);
+ spl_filesystem_dir_read(intern);
} while (skip_dots && spl_filesystem_is_dot(intern->u.dir.entry.d_name));
}
/* }}} */
@@ -1458,7 +1458,7 @@ SPL_METHOD(FilesystemIterator, setFlags)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -1473,20 +1473,20 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
zend_bool allow_links = 0;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &allow_links) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) {
return;
}
if (spl_filesystem_is_invalid_or_dot(intern->u.dir.entry.d_name)) {
RETURN_FALSE;
} else {
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) {
- php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC);
- if (zend_is_true(return_value TSRMLS_CC)) {
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value);
+ if (zend_is_true(return_value)) {
RETURN_FALSE;
}
}
- php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value TSRMLS_CC);
+ php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, return_value);
}
}
/* }}} */
@@ -1504,11 +1504,11 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
return;
}
- spl_filesystem_object_get_file_name(intern TSRMLS_CC);
+ spl_filesystem_object_get_file_name(intern);
ZVAL_LONG(&zflags, intern->flags);
ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len);
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &zpath, &zflags);
zval_ptr_dtor(&zpath);
zval_ptr_dtor(&zflags);
@@ -1599,19 +1599,19 @@ SPL_METHOD(GlobIterator, count)
RETURN_LONG(php_glob_stream_get_count(intern->u.dir.dirp, NULL));
} else {
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "GlobIterator lost glob state");
+ php_error_docref(NULL, E_ERROR, "GlobIterator lost glob state");
}
}
/* }}} */
#endif /* HAVE_GLOB */
/* {{{ forward declarations to the iterator handlers */
-static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC);
-static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC);
-static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC);
-static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC);
-static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC);
-static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC);
+static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter);
+static int spl_filesystem_dir_it_valid(zend_object_iterator *iter);
+static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter);
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key);
+static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter);
+static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter);
/* iterator handler table */
zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
@@ -1625,7 +1625,7 @@ zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
/* }}} */
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
@@ -1634,7 +1634,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
+ iterator = spl_filesystem_object_to_iterator(dir_object);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
/* ->current must be initialized; rewind doesn't set it and valid
@@ -1646,7 +1646,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
/* }}} */
/* {{{ spl_filesystem_dir_it_dtor */
-static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1663,16 +1663,16 @@ static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ spl_filesystem_dir_it_valid */
-static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
+static int spl_filesystem_dir_it_valid(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE;
}
/* }}} */
/* {{{ spl_filesystem_dir_it_current_data */
-static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1681,21 +1681,21 @@ static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRML
/* }}} */
/* {{{ spl_filesystem_dir_it_current_key */
-static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
ZVAL_LONG(key, object->u.dir.index);
}
/* }}} */
/* {{{ spl_filesystem_dir_it_move_forward */
-static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
object->u.dir.index++;
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
if (object->file_name) {
efree(object->file_name);
object->file_name = NULL;
@@ -1704,20 +1704,20 @@ static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS
/* }}} */
/* {{{ spl_filesystem_dir_it_rewind */
-static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
php_stream_rewinddir(object->u.dir.dirp);
}
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
}
/* }}} */
/* {{{ spl_filesystem_tree_it_dtor */
-static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
@@ -1734,21 +1734,21 @@ static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
/* }}} */
/* {{{ spl_filesystem_tree_it_current_data */
-static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
if (Z_ISUNDEF(iterator->current)) {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
ZVAL_STRINGL(&iterator->current, object->file_name, object->file_name_len);
}
return &iterator->current;
} else if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_FILEINFO)) {
if (Z_ISUNDEF(iterator->current)) {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
- spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
+ spl_filesystem_object_create_type(0, object, SPL_FS_INFO, NULL, &iterator->current);
}
return &iterator->current;
} else {
@@ -1758,28 +1758,28 @@ static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRM
/* }}} */
/* {{{ spl_filesystem_tree_it_current_key */
-static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
ZVAL_STRING(key, object->u.dir.entry.d_name);
} else {
- spl_filesystem_object_get_file_name(object TSRMLS_CC);
+ spl_filesystem_object_get_file_name(object);
ZVAL_STRINGL(key, object->file_name, object->file_name_len);
}
}
/* }}} */
/* {{{ spl_filesystem_tree_it_move_forward */
-static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
object->u.dir.index++;
do {
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
} while (spl_filesystem_is_dot(object->u.dir.entry.d_name));
if (object->file_name) {
efree(object->file_name);
@@ -1793,17 +1793,17 @@ static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRML
/* }}} */
/* {{{ spl_filesystem_tree_it_rewind */
-static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
php_stream_rewinddir(object->u.dir.dirp);
}
do {
- spl_filesystem_dir_read(object TSRMLS_CC);
+ spl_filesystem_dir_read(object);
} while (spl_filesystem_is_dot(object->u.dir.entry.d_name));
if (!Z_ISUNDEF(iterator->current)) {
zval_ptr_dtor(&iterator->current);
@@ -1824,7 +1824,7 @@ zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
/* }}} */
/* {{{ spl_ce_dir_get_iterator */
-zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
+zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zval *object, int by_ref)
{
spl_filesystem_iterator *iterator;
spl_filesystem_object *dir_object;
@@ -1833,7 +1833,7 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
+ iterator = spl_filesystem_object_to_iterator(dir_object);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
@@ -1843,13 +1843,13 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
/* }}} */
/* {{{ spl_filesystem_object_cast */
-static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
+static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(readobj);
if (type == IS_STRING) {
if (Z_OBJCE_P(readobj)->__tostring) {
- return std_object_handlers.cast_object(readobj, writeobj, type TSRMLS_CC);
+ return std_object_handlers.cast_object(readobj, writeobj, type);
}
switch (intern->type) {
@@ -2020,17 +2020,17 @@ static const zend_function_entry spl_GlobIterator_functions[] = {
#endif
/* }}} */
-static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent) /* {{{ */
{
char *buf;
size_t line_len = 0;
zend_long line_add = (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) ? 1 : 0;
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (php_stream_eof(intern->u.file.stream)) {
if (!silent) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name);
}
return FAILURE;
}
@@ -2064,7 +2064,7 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TS
return SUCCESS;
} /* }}} */
-static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2 TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function *func_ptr, int pass_num_args, zval *return_value, zval *arg2) /* {{{ */
{
zend_fcall_info fci;
zend_fcall_info_cache fcic;
@@ -2100,7 +2100,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
fcic.called_scope = NULL;
fcic.object = NULL;
- result = zend_call_function(&fci, &fcic TSRMLS_CC);
+ result = zend_call_function(&fci, &fcic);
if (result == FAILURE || Z_ISUNDEF(retval)) {
RETVAL_FALSE;
@@ -2117,18 +2117,18 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
zend_function *func_ptr; \
func_ptr = (zend_function *)zend_hash_str_find_ptr(EG(function_table), #func_name, sizeof(#func_name) - 1); \
if (func_ptr == NULL) { \
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Internal error, function '%s' not found. Please report", #func_name); \
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Internal error, function '%s' not found. Please report", #func_name); \
return; \
} \
- spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \
+ spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2); \
} /* }}} */
-static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value) /* {{{ */
{
int ret = SUCCESS;
do {
- ret = spl_filesystem_file_read(intern, 1 TSRMLS_CC);
+ ret = spl_filesystem_file_read(intern, 1);
} while (ret == SUCCESS && !intern->u.file.current_line_len && SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY));
if (ret == SUCCESS) {
@@ -2140,7 +2140,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli
ZVAL_UNDEF(&intern->u.file.current_zval);
}
- php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval TSRMLS_CC);
+ php_fgetcsv(intern->u.file.stream, delimiter, enclosure, escape, buf_len, buf, &intern->u.file.current_zval);
if (return_value) {
if (Z_TYPE_P(return_value) != IS_NULL) {
zval_dtor(return_value);
@@ -2153,7 +2153,7 @@ static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char deli
}
/* }}} */
-static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */
{
zval retval;
@@ -2161,12 +2161,12 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || intern->u.file.func_getCurr->common.scope != spl_ce_SplFileObject) {
if (php_stream_eof(intern->u.file.stream)) {
if (!silent) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot read from file %s", intern->file_name);
}
return FAILURE;
}
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV)) {
- return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC);
+ return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL);
} else {
zend_execute_data *execute_data = EG(current_execute_data);
zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
@@ -2175,7 +2175,7 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) {
intern->u.file.current_line_num++;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (Z_TYPE(retval) == IS_STRING) {
intern->u.file.current_line = estrndup(Z_STRVAL(retval), Z_STRLEN(retval));
intern->u.file.current_line_len = Z_STRLEN(retval);
@@ -2188,11 +2188,11 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
return FAILURE;
}
} else {
- return spl_filesystem_file_read(intern, silent TSRMLS_CC);
+ return spl_filesystem_file_read(intern, silent);
}
} /* }}} */
-static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern) /* {{{ */
{
if (intern->u.file.current_line) {
return intern->u.file.current_line_len == 0;
@@ -2224,33 +2224,33 @@ static int spl_filesystem_file_is_empty_line(spl_filesystem_object *intern TSRML
}
/* }}} */
-static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */
{
- int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+ int ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent);
- while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern TSRMLS_CC)) {
- spl_filesystem_file_free_line(intern TSRMLS_CC);
- ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent TSRMLS_CC);
+ while (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_SKIP_EMPTY) && ret == SUCCESS && spl_filesystem_file_is_empty_line(intern)) {
+ spl_filesystem_file_free_line(intern);
+ ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent);
}
return ret;
}
/* }}} */
-static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern TSRMLS_DC) /* {{{ */
+static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *intern) /* {{{ */
{
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (-1 == php_stream_rewind(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot rewind file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Cannot rewind file %s", intern->file_name);
} else {
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num = 0;
}
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
- spl_filesystem_file_read_line(this_ptr, intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(this_ptr, intern, 1);
}
} /* }}} */
@@ -2265,18 +2265,18 @@ SPL_METHOD(SplFileObject, __construct)
size_t tmp_path_len;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
intern->u.file.open_mode = NULL;
intern->u.file.open_mode_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|sbr!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|sbr!",
&intern->file_name, &intern->file_name_len,
&intern->u.file.open_mode, &intern->u.file.open_mode_len,
&use_include_path, &intern->u.file.zcontext) == FAILURE) {
intern->u.file.open_mode = NULL;
intern->file_name = NULL;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -2285,7 +2285,7 @@ SPL_METHOD(SplFileObject, __construct)
intern->u.file.open_mode_len = 1;
}
- if (spl_filesystem_file_open(intern, use_include_path, 0 TSRMLS_CC) == SUCCESS) {
+ if (spl_filesystem_file_open(intern, use_include_path, 0) == SUCCESS) {
tmp_path_len = strlen(intern->u.file.stream->orig_path);
if (tmp_path_len > 1 && IS_SLASH_AT(intern->u.file.stream->orig_path, tmp_path_len-1)) {
@@ -2311,7 +2311,7 @@ SPL_METHOD(SplFileObject, __construct)
intern->_path = estrndup(intern->u.file.stream->orig_path, intern->_path_len);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
} /* }}} */
@@ -2324,10 +2324,10 @@ SPL_METHOD(SplTempFileObject, __construct)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_RuntimeException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_memory) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_memory) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -2344,11 +2344,11 @@ SPL_METHOD(SplTempFileObject, __construct)
intern->u.file.open_mode = "wb";
intern->u.file.open_mode_len = 1;
- if (spl_filesystem_file_open(intern, 0, 0 TSRMLS_CC) == SUCCESS) {
+ if (spl_filesystem_file_open(intern, 0, 0) == SUCCESS) {
intern->_path_len = 0;
intern->_path = estrndup("", 0);
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
} /* }}} */
/* {{{ proto void SplFileObject::rewind()
@@ -2361,7 +2361,7 @@ SPL_METHOD(SplFileObject, rewind)
return;
}
- spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
+ spl_filesystem_file_rewind(getThis(), intern);
} /* }}} */
/* {{{ proto void SplFileObject::eof()
@@ -2375,7 +2375,7 @@ SPL_METHOD(SplFileObject, eof)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2413,11 +2413,11 @@ SPL_METHOD(SplFileObject, fgets)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- if (spl_filesystem_file_read(intern, 0 TSRMLS_CC) == FAILURE) {
+ if (spl_filesystem_file_read(intern, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@@ -2434,12 +2434,12 @@ SPL_METHOD(SplFileObject, current)
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
}
if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) {
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@@ -2461,7 +2461,7 @@ SPL_METHOD(SplFileObject, key)
/* Do not read the next line to support correct counting with fgetc()
if (!intern->current_line) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
} */
RETURN_LONG(intern->u.file.current_line_num);
} /* }}} */
@@ -2476,9 +2476,9 @@ SPL_METHOD(SplFileObject, next)
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
- spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC);
+ spl_filesystem_file_read_line(getThis(), intern, 1);
}
intern->u.file.current_line_num++;
} /* }}} */
@@ -2489,7 +2489,7 @@ SPL_METHOD(SplFileObject, setFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
}
} /* }}} */
@@ -2515,12 +2515,12 @@ SPL_METHOD(SplFileObject, setMaxLineLen)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &max_len) == FAILURE) {
return;
}
if (max_len < 0) {
- zend_throw_exception_ex(spl_ce_DomainException, 0 TSRMLS_CC, "Maximum line length must be greater than or equal zero");
+ zend_throw_exception_ex(spl_ce_DomainException, 0, "Maximum line length must be greater than or equal zero");
return;
}
@@ -2579,10 +2579,10 @@ SPL_METHOD(SplFileObject, fgetcsv)
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2590,21 +2590,21 @@ SPL_METHOD(SplFileObject, fgetcsv)
{
case 3:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 2:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 1:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2612,7 +2612,7 @@ SPL_METHOD(SplFileObject, fgetcsv)
case 0:
break;
}
- spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value TSRMLS_CC);
+ spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value);
}
}
/* }}} */
@@ -2628,26 +2628,26 @@ SPL_METHOD(SplFileObject, fputcsv)
zend_long ret;
zval *fields = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|sss", &fields, &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
case 4:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 3:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 2:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2656,7 +2656,7 @@ SPL_METHOD(SplFileObject, fputcsv)
case 0:
break;
}
- ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape TSRMLS_CC);
+ ret = php_fputcsv(intern->u.file.stream, fields, delimiter, enclosure, escape);
RETURN_LONG(ret);
}
}
@@ -2671,26 +2671,26 @@ SPL_METHOD(SplFileObject, setCsvControl)
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", &delim, &d_len, &enclo, &e_len, &esc, &esc_len) == SUCCESS) {
switch(ZEND_NUM_ARGS())
{
case 3:
if (esc_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
}
escape = esc[0];
/* no break */
case 2:
if (e_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
}
enclosure = enclo[0];
/* no break */
case 1:
if (d_len != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
}
delimiter = delim[0];
@@ -2736,7 +2736,7 @@ SPL_METHOD(SplFileObject, fflush)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2751,7 +2751,7 @@ SPL_METHOD(SplFileObject, ftell)
zend_long ret;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2771,16 +2771,16 @@ SPL_METHOD(SplFileObject, fseek)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long pos, whence = SEEK_SET;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &pos, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &pos, &whence) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, (int)whence));
} /* }}} */
@@ -2793,11 +2793,11 @@ SPL_METHOD(SplFileObject, fgetc)
int result;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
result = php_stream_getc(intern->u.file.stream);
@@ -2822,7 +2822,7 @@ SPL_METHOD(SplFileObject, fgetss)
zval arg2;
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2832,7 +2832,7 @@ SPL_METHOD(SplFileObject, fgetss)
ZVAL_LONG(&arg2, 1024);
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num++;
FileFunctionCall(fgetss, ZEND_NUM_ARGS(), &arg2);
@@ -2845,7 +2845,7 @@ SPL_METHOD(SplFileObject, fpassthru)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2859,11 +2859,11 @@ SPL_METHOD(SplFileObject, fscanf)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
- spl_filesystem_file_free_line(intern TSRMLS_CC);
+ spl_filesystem_file_free_line(intern);
intern->u.file.current_line_num++;
FileFunctionCall(fscanf, ZEND_NUM_ARGS(), NULL);
@@ -2879,12 +2879,12 @@ SPL_METHOD(SplFileObject, fwrite)
size_t str_len;
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &length) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
@@ -2908,17 +2908,17 @@ SPL_METHOD(SplFileObject, fread)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long length = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -2941,17 +2941,17 @@ SPL_METHOD(SplFileObject, ftruncate)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (!php_stream_truncate_supported(intern->u.file.stream)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't truncate file %s", intern->file_name);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't truncate file %s", intern->file_name);
RETURN_FALSE;
}
@@ -2965,23 +2965,23 @@ SPL_METHOD(SplFileObject, seek)
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
zend_long line_pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &line_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &line_pos) == FAILURE) {
return;
}
if(!intern->u.file.stream) {
- zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Object not initialized");
+ zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
return;
}
if (line_pos < 0) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Can't seek file %s to negative line %pd", intern->file_name, line_pos);
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "Can't seek file %s to negative line %pd", intern->file_name, line_pos);
RETURN_FALSE;
}
- spl_filesystem_file_rewind(getThis(), intern TSRMLS_CC);
+ spl_filesystem_file_rewind(getThis(), intern);
while(intern->u.file.current_line_num < line_pos) {
- if (spl_filesystem_file_read_line(getThis(), intern, 1 TSRMLS_CC) == FAILURE) {
+ if (spl_filesystem_file_read_line(getThis(), intern, 1) == FAILURE) {
break;
}
}
@@ -3117,7 +3117,7 @@ PHP_MINIT_FUNCTION(spl_directory)
REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_DirectoryIterator_functions);
- zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, zend_ce_iterator);
+ zend_class_implements(spl_ce_DirectoryIterator, 1, zend_ce_iterator);
REGISTER_SPL_IMPLEMENTS(DirectoryIterator, SeekableIterator);
spl_ce_DirectoryIterator->get_iterator = spl_filesystem_dir_get_iterator;
diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h
index b6c8b72933..f62306c2c6 100644
--- a/ext/spl/spl_directory.h
+++ b/ext/spl/spl_directory.h
@@ -42,10 +42,10 @@ typedef enum {
typedef struct _spl_filesystem_object spl_filesystem_object;
-typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC);
-typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC);
+typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object);
+typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst);
-PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len TSRMLS_DC);
+PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, size_t *len);
typedef struct _spl_other_handler {
spl_foreign_dtor_t dtor;
@@ -112,15 +112,15 @@ static inline spl_filesystem_object *spl_filesystem_from_obj(zend_object *obj) /
#define Z_SPLFILESYSTEM_P(zv) spl_filesystem_from_obj(Z_OBJ_P((zv)))
-static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj TSRMLS_DC)
+static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj)
{
obj->it = ecalloc(1, sizeof(spl_filesystem_iterator));
obj->it->object = (void *)obj;
- zend_iterator_init(&obj->it->intern TSRMLS_CC);
+ zend_iterator_init(&obj->it->intern);
return obj->it;
}
-static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it TSRMLS_DC)
+static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it)
{
return (spl_filesystem_object*)it->object;
}
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 8a61407589..b08623eb4d 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -68,8 +68,8 @@ typedef struct _spl_ptr_llist_element {
zval data;
} spl_ptr_llist_element;
-typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element * TSRMLS_DC);
-typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element * TSRMLS_DC);
+typedef void (*spl_ptr_llist_dtor_func)(spl_ptr_llist_element *);
+typedef void (*spl_ptr_llist_ctor_func)(spl_ptr_llist_element *);
typedef struct _spl_ptr_llist {
spl_ptr_llist_element *head;
@@ -113,7 +113,7 @@ static inline spl_dllist_object *spl_dllist_from_obj(zend_object *obj) /* {{{ */
#define Z_SPLDLLIST_P(zv) spl_dllist_from_obj(Z_OBJ_P((zv)))
/* {{{ spl_ptr_llist */
-static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem) { /* {{{ */
if (!Z_ISUNDEF(elem->data)) {
zval_ptr_dtor(&elem->data);
ZVAL_UNDEF(&elem->data);
@@ -121,7 +121,7 @@ static void spl_ptr_llist_zval_dtor(spl_ptr_llist_element *elem TSRMLS_DC) { /*
}
/* }}} */
-static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_llist_zval_ctor(spl_ptr_llist_element *elem) { /* {{{ */
if (Z_REFCOUNTED(elem->data)) {
Z_ADDREF(elem->data);
}
@@ -148,7 +148,7 @@ static zend_long spl_ptr_llist_count(spl_ptr_llist *llist) /* {{{ */
}
/* }}} */
-static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_destroy(spl_ptr_llist *llist) /* {{{ */
{
spl_ptr_llist_element *current = llist->head, *next;
spl_ptr_llist_dtor_func dtor = llist->dtor;
@@ -156,7 +156,7 @@ static void spl_ptr_llist_destroy(spl_ptr_llist *llist TSRMLS_DC) /* {{{ */
while (current) {
next = current->next;
if(current && dtor) {
- dtor(current TSRMLS_CC);
+ dtor(current);
}
SPL_LLIST_DELREF(current);
current = next;
@@ -191,7 +191,7 @@ static spl_ptr_llist_element *spl_ptr_llist_offset(spl_ptr_llist *llist, zend_lo
}
/* }}} */
-static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data) /* {{{ */
{
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -210,12 +210,12 @@ static void spl_ptr_llist_unshift(spl_ptr_llist *llist, zval *data TSRMLS_DC) /*
llist->count++;
if (llist->ctor) {
- llist->ctor(elem TSRMLS_CC);
+ llist->ctor(elem);
}
}
/* }}} */
-static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data) /* {{{ */
{
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -234,12 +234,12 @@ static void spl_ptr_llist_push(spl_ptr_llist *llist, zval *data TSRMLS_DC) /* {{
llist->count++;
if (llist->ctor) {
- llist->ctor(elem TSRMLS_CC);
+ llist->ctor(elem);
}
}
/* }}} */
-static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret) /* {{{ */
{
spl_ptr_llist_element *tail = llist->tail;
@@ -259,7 +259,7 @@ static void spl_ptr_llist_pop(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{
ZVAL_COPY(ret, &tail->data);
if (llist->dtor) {
- llist->dtor(tail TSRMLS_CC);
+ llist->dtor(tail);
}
ZVAL_UNDEF(&tail->data);
@@ -292,7 +292,7 @@ static zval *spl_ptr_llist_first(spl_ptr_llist *llist) /* {{{ */
}
/* }}} */
-static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret) /* {{{ */
{
spl_ptr_llist_element *head = llist->head;
@@ -312,7 +312,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
ZVAL_COPY(ret, &head->data);
if (llist->dtor) {
- llist->dtor(head TSRMLS_CC);
+ llist->dtor(head);
}
ZVAL_UNDEF(&head->data);
@@ -320,7 +320,7 @@ static void spl_ptr_llist_shift(spl_ptr_llist *llist, zval *ret TSRMLS_DC) /* {{
}
/* }}} */
-static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC) /* {{{ */
+static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to) /* {{{ */
{
spl_ptr_llist_element *current = from->head, *next;
//??? spl_ptr_llist_ctor_func ctor = from->ctor;
@@ -330,11 +330,11 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC)
/*??? FIXME
if (ctor) {
- ctor(current TSRMLS_CC);
+ ctor(current);
}
*/
- spl_ptr_llist_push(to, &current->data TSRMLS_CC);
+ spl_ptr_llist_push(to, &current->data);
current = next;
}
@@ -343,19 +343,19 @@ static void spl_ptr_llist_copy(spl_ptr_llist *from, spl_ptr_llist *to TSRMLS_DC)
/* }}} */
-static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_dllist_object_free_storage(zend_object *object) /* {{{ */
{
spl_dllist_object *intern = spl_dllist_from_obj(object);
zval tmp;
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
while (intern->llist->count > 0) {
- spl_ptr_llist_pop(intern->llist, &tmp TSRMLS_CC);
+ spl_ptr_llist_pop(intern->llist, &tmp);
zval_ptr_dtor(&tmp);
}
- spl_ptr_llist_destroy(intern->llist TSRMLS_CC);
+ spl_ptr_llist_destroy(intern->llist);
SPL_LLIST_CHECK_DELREF(intern->traverse_pointer);
if (intern->debug_info != NULL) {
@@ -365,9 +365,9 @@ static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{
}
/* }}} */
-zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_dllist_object *intern;
zend_class_entry *parent = class_type;
@@ -375,7 +375,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
intern = ecalloc(1, sizeof(spl_dllist_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->flags = 0;
@@ -388,7 +388,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
if (clone_orig) {
intern->llist = (spl_ptr_llist *)spl_ptr_llist_init(other->llist->ctor, other->llist->dtor);
- spl_ptr_llist_copy(other->llist, intern->llist TSRMLS_CC);
+ spl_ptr_llist_copy(other->llist, intern->llist);
intern->traverse_pointer = intern->llist->head;
SPL_LLIST_CHECK_ADDREF(intern->traverse_pointer);
} else {
@@ -423,7 +423,7 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplDoublyLinkedList");
}
if (inherited) {
intern->fptr_offset_get = zend_hash_str_find_ptr(&class_type->function_table, "offsetget", sizeof("offsetget") - 1);
@@ -452,27 +452,27 @@ static zend_object *spl_dllist_object_new_ex(zend_class_entry *class_type, zval
}
/* }}} */
-static zend_object *spl_dllist_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_dllist_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_dllist_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_dllist_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_dllist_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_dllist_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_dllist_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_dllist_object *intern = Z_SPLDLLIST_P(object);
@@ -493,7 +493,7 @@ static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRML
}
/* }}} */
-static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{{ */
+static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp) /* {{{{ */
{
spl_dllist_object *intern = Z_SPLDLLIST_P(obj);
spl_ptr_llist_element *current = intern->llist->head, *next;
@@ -515,7 +515,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML
}
zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
- pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1);
ZVAL_LONG(&tmp, intern->flags);
zend_hash_add(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
@@ -534,7 +534,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp TSRML
current = next;
}
- pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1);
zend_hash_add(intern->debug_info, pnstr, &dllist_array);
zend_string_release(pnstr);
}
@@ -550,12 +550,12 @@ SPL_METHOD(SplDoublyLinkedList, push)
zval *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
RETURN_TRUE;
}
@@ -568,12 +568,12 @@ SPL_METHOD(SplDoublyLinkedList, unshift)
zval *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_unshift(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_unshift(intern->llist, value);
RETURN_TRUE;
}
@@ -590,10 +590,10 @@ SPL_METHOD(SplDoublyLinkedList, pop)
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_pop(intern->llist, return_value TSRMLS_CC);
+ spl_ptr_llist_pop(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't pop from an empty datastructure", 0);
RETURN_NULL();
}
}
@@ -610,10 +610,10 @@ SPL_METHOD(SplDoublyLinkedList, shift)
}
intern = Z_SPLDLLIST_P(getThis());
- spl_ptr_llist_shift(intern->llist, return_value TSRMLS_CC);
+ spl_ptr_llist_shift(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't shift from an empty datastructure", 0);
RETURN_NULL();
}
}
@@ -634,7 +634,7 @@ SPL_METHOD(SplDoublyLinkedList, top)
value = spl_ptr_llist_last(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0);
return;
}
@@ -657,7 +657,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom)
value = spl_ptr_llist_first(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty datastructure", 0);
return;
}
@@ -691,7 +691,7 @@ SPL_METHOD(SplDoublyLinkedList, isEmpty)
return;
}
- spl_dllist_object_count_elements(getThis(), &count TSRMLS_CC);
+ spl_dllist_object_count_elements(getThis(), &count);
RETURN_BOOL(count == 0);
}
/* }}} */
@@ -703,7 +703,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
zend_long value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
return;
}
@@ -711,7 +711,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
if (intern->flags & SPL_DLLIST_IT_FIX
&& (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) {
- zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0);
return;
}
@@ -745,12 +745,12 @@ SPL_METHOD(SplDoublyLinkedList, offsetExists)
spl_dllist_object *intern;
zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
RETURN_BOOL(index >= 0 && index < intern->llist->count);
} /* }}} */
@@ -764,15 +764,15 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
spl_dllist_object *intern;
spl_ptr_llist_element *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -781,7 +781,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
if (element != NULL) {
RETURN_ZVAL(&element->data, 1, 0);
} else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
} /* }}} */
@@ -793,7 +793,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
zval *zindex, *value;
spl_dllist_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
@@ -801,17 +801,17 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
if (Z_TYPE_P(zindex) == IS_NULL) {
/* $obj[] = ... */
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
} else {
/* $obj[$foo] = ... */
zend_long index;
spl_ptr_llist_element *element;
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
zval_ptr_dtor(value);
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -820,7 +820,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
if (element != NULL) {
/* call dtor on the old element as in spl_ptr_llist_pop */
if (intern->llist->dtor) {
- intern->llist->dtor(element TSRMLS_CC);
+ intern->llist->dtor(element);
}
/* the element is replaced, delref the old one as in
@@ -830,11 +830,11 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
/* new element, call ctor as in spl_ptr_llist_push */
if (intern->llist->ctor) {
- intern->llist->ctor(element TSRMLS_CC);
+ intern->llist->ctor(element);
}
} else {
zval_ptr_dtor(value);
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
}
@@ -850,16 +850,16 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
spl_ptr_llist_element *element;
spl_ptr_llist *llist;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
llist = intern->llist;
if (index < 0 || index >= intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of range", 0);
return;
}
@@ -888,7 +888,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
llist->count--;
if(llist->dtor) {
- llist->dtor(element TSRMLS_CC);
+ llist->dtor(element);
}
if (intern->traverse_pointer == element) {
@@ -900,23 +900,23 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
SPL_LLIST_DELREF(element);
} else {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0);
return;
}
} /* }}} */
-static void spl_dllist_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
SPL_LLIST_CHECK_DELREF(iterator->traverse_pointer);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */
{
SPL_LLIST_CHECK_DELREF(*traverse_pointer_ptr);
@@ -932,7 +932,7 @@ static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer
}
/* }}} */
-static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags) /* {{{ */
{
if (*traverse_pointer_ptr) {
spl_ptr_llist_element *old = *traverse_pointer_ptr;
@@ -943,7 +943,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
if (flags & SPL_DLLIST_IT_DELETE) {
zval prev;
- spl_ptr_llist_pop(llist, &prev TSRMLS_CC);
+ spl_ptr_llist_pop(llist, &prev);
zval_ptr_dtor(&prev);
}
@@ -952,7 +952,7 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
if (flags & SPL_DLLIST_IT_DELETE) {
zval prev;
- spl_ptr_llist_shift(llist, &prev TSRMLS_CC);
+ spl_ptr_llist_shift(llist, &prev);
zval_ptr_dtor(&prev);
} else {
@@ -966,17 +966,17 @@ static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_p
}
/* }}} */
-static void spl_dllist_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data);
spl_ptr_llist *llist = object->llist;
- spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags TSRMLS_CC);
+ spl_dllist_it_helper_rewind(&iterator->traverse_pointer, &iterator->traverse_position, llist, object->flags);
}
/* }}} */
-static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_dllist_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_ptr_llist_element *element = iterator->traverse_pointer;
@@ -985,7 +985,7 @@ static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_ptr_llist_element *element = iterator->traverse_pointer;
@@ -998,7 +998,7 @@ static zval *spl_dllist_it_get_current_data(zend_object_iterator *iter TSRMLS_DC
}
/* }}} */
-static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
@@ -1006,14 +1006,14 @@ static void spl_dllist_it_get_current_key(zend_object_iterator *iter, zval *key
}
/* }}} */
-static void spl_dllist_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_dllist_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_dllist_it *iterator = (spl_dllist_it *)iter;
spl_dllist_object *object = Z_SPLDLLIST_P(&iter->data);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
- spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&iterator->traverse_pointer, &iterator->traverse_position, object->llist, object->flags);
}
/* }}} */
@@ -1041,7 +1041,7 @@ SPL_METHOD(SplDoublyLinkedList, prev)
return;
}
- spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags ^ SPL_DLLIST_IT_LIFO);
}
/* }}} */
@@ -1055,7 +1055,7 @@ SPL_METHOD(SplDoublyLinkedList, next)
return;
}
- spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC);
+ spl_dllist_it_helper_move_forward(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags);
}
/* }}} */
@@ -1083,7 +1083,7 @@ SPL_METHOD(SplDoublyLinkedList, rewind)
return;
}
- spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags TSRMLS_CC);
+ spl_dllist_it_helper_rewind(&intern->traverse_pointer, &intern->traverse_position, intern->llist, intern->flags);
}
/* }}} */
@@ -1124,7 +1124,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
/* flags */
ZVAL_LONG(&flags, intern->flags);
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
zval_ptr_dtor(&flags);
/* elements */
@@ -1132,7 +1132,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
smart_str_appendc(&buf, ':');
next = current->next;
- php_var_serialize(&buf, &current->data, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &current->data, &var_hash);
current = next;
}
@@ -1161,7 +1161,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -1173,7 +1173,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
PHP_VAR_UNSERIALIZE_INIT(var_hash);
/* flags */
- if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&flags, &p, s + buf_len, &var_hash)) {
goto error;
}
@@ -1188,11 +1188,11 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
/* elements */
while(*p == ':') {
++p;
- if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&elem, &p, s + buf_len, &var_hash)) {
goto error;
}
- spl_ptr_llist_push(intern->llist, &elem TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, &elem);
zval_ptr_dtor(&elem);
}
@@ -1205,7 +1205,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
error:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
@@ -1219,15 +1219,15 @@ SPL_METHOD(SplDoublyLinkedList, add)
spl_ptr_llist_element *element;
zend_long index;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_long(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex);
if (index < 0 || index > intern->llist->count) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0);
return;
}
@@ -1236,7 +1236,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
}
if (index == intern->llist->count) {
/* If index is the last entry+1 then we do a push because we're not inserting before any entry */
- spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+ spl_ptr_llist_push(intern->llist, value);
} else {
/* Create the new element we want to insert */
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
@@ -1261,7 +1261,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
intern->llist->count++;
if (intern->llist->ctor) {
- intern->llist->ctor(elem TSRMLS_CC);
+ intern->llist->ctor(elem);
}
}
} /* }}} */
@@ -1276,19 +1276,19 @@ zend_object_iterator_funcs spl_dllist_it_funcs = {
spl_dllist_it_rewind
}; /* }}} */
-zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_dllist_it *iterator;
spl_dllist_object *dllist_object = Z_SPLDLLIST_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_dllist_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_dllist_it_funcs;
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c
index 1e51484394..753ea2cd91 100644
--- a/ext/spl/spl_engine.c
+++ b/ext/spl/spl_engine.c
@@ -32,7 +32,7 @@
#include "spl_array.h"
/* {{{ spl_instantiate */
-PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
+PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object)
{
object_init_ex(object, pce);
Z_SET_REFCOUNT_P(object, 1);
@@ -40,7 +40,7 @@ PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
}
/* }}} */
-PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset) /* {{{ */
{
zend_ulong idx;
diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h
index 8fa5539ba5..5666033d75 100644
--- a/ext/spl/spl_engine.h
+++ b/ext/spl/spl_engine.h
@@ -25,41 +25,41 @@
#include "php_spl.h"
#include "zend_interfaces.h"
-PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
+PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object);
-PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC);
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset);
/* {{{ spl_instantiate_arg_ex1 */
-static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1 TSRMLS_DC)
+static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1)
{
zend_function *func = pce->constructor;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
- zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL TSRMLS_CC);
+ zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 1, arg1, NULL);
return 0;
}
/* }}} */
/* {{{ spl_instantiate_arg_ex2 */
-static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2 TSRMLS_DC)
+static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, zval *arg1, zval *arg2)
{
zend_function *func = pce->constructor;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
- zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2 TSRMLS_CC);
+ zend_call_method(retval, pce, &func, func->common.function_name->val, func->common.function_name->len, NULL, 2, arg1, arg2);
return 0;
}
/* }}} */
/* {{{ spl_instantiate_arg_n */
-static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv TSRMLS_DC)
+static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv)
{
zend_function *func = pce->constructor;
zend_fcall_info fci;
zend_fcall_info_cache fcc;
zval dummy;
- spl_instantiate(pce, retval TSRMLS_CC);
+ spl_instantiate(pce, retval);
fci.size = sizeof(zend_fcall_info);
fci.function_table = &pce->function_table;
@@ -77,7 +77,7 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in
fcc.called_scope = pce;
fcc.object = Z_OBJ_P(retval);
- zend_call_function(&fci, &fcc TSRMLS_CC);
+ zend_call_function(&fci, &fcc);
}
/* }}} */
diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c
index 3c6b724b5c..e0cc164c13 100644
--- a/ext/spl/spl_exceptions.c
+++ b/ext/spl/spl_exceptions.c
@@ -47,7 +47,7 @@ PHPAPI zend_class_entry *spl_ce_RangeException;
PHPAPI zend_class_entry *spl_ce_UnderflowException;
PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
-#define spl_ce_Exception zend_exception_get_default(TSRMLS_C)
+#define spl_ce_Exception zend_exception_get_default()
/* {{{ PHP_MINIT_FUNCTION(spl_exceptions) */
PHP_MINIT_FUNCTION(spl_exceptions)
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index d63ac2e6e6..d2105fb0fa 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -81,7 +81,7 @@ static inline spl_fixedarray_object *spl_fixed_array_from_obj(zend_object *obj)
#define Z_SPLFIXEDARRAY_P(zv) spl_fixed_array_from_obj(Z_OBJ_P((zv)))
-static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_init(spl_fixedarray *array, zend_long size) /* {{{ */
{
if (size > 0) {
array->size = 0; /* reset size in case ecalloc() fails */
@@ -94,7 +94,7 @@ static void spl_fixedarray_init(spl_fixedarray *array, zend_long size TSRMLS_DC)
}
/* }}} */
-static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size) /* {{{ */
{
if (size == array->size) {
/* nothing to do */
@@ -103,7 +103,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D
/* first initialization */
if (array->size == 0) {
- spl_fixedarray_init(array, size TSRMLS_CC);
+ spl_fixedarray_init(array, size);
return;
}
@@ -135,7 +135,7 @@ static void spl_fixedarray_resize(spl_fixedarray *array, zend_long size TSRMLS_D
}
/* }}} */
-static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from) /* {{{ */
{
int i;
for (i = 0; i < from->size; i++) {
@@ -144,10 +144,10 @@ static void spl_fixedarray_copy(spl_fixedarray *to, spl_fixedarray *from TSRMLS_
}
/* }}} */
-static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{{ */
+static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n) /* {{{{ */
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj);
- HashTable *ht = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht = zend_std_get_properties(obj);
if (intern->array) {
*table = intern->array->elements;
@@ -161,10 +161,10 @@ static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n T
}
/* }}}} */
-static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {{{{ */
+static HashTable* spl_fixedarray_object_get_properties(zval *obj) /* {{{{ */
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj);
- HashTable *ht = zend_std_get_properties(obj TSRMLS_CC);
+ HashTable *ht = zend_std_get_properties(obj);
zend_long i = 0;
if (intern->array) {
@@ -191,7 +191,7 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {
}
/* }}}} */
-static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_free_storage(zend_object *object) /* {{{ */
{
spl_fixedarray_object *intern = spl_fixed_array_from_obj(object);
zend_long i;
@@ -207,14 +207,14 @@ static void spl_fixedarray_object_free_storage(zend_object *object TSRMLS_DC) /*
efree(intern->array);
}
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zval_ptr_dtor(&intern->retval);
}
/* }}} */
-zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_fixedarray_object *intern;
zend_class_entry *parent = class_type;
@@ -222,7 +222,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
intern = ecalloc(1, sizeof(spl_fixedarray_object) + (sizeof(zval) * parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->current = 0;
@@ -233,11 +233,11 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
intern->ce_get_iterator = other->ce_get_iterator;
if (!other->array) {
/* leave a empty object, will be dtor later by CLONE handler */
- zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "The instance wasn't initialized properly", 0);
} else {
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, other->array->size TSRMLS_CC);
- spl_fixedarray_copy(intern->array, other->array TSRMLS_CC);
+ spl_fixedarray_init(intern->array, other->array->size);
+ spl_fixedarray_copy(intern->array, other->array);
}
}
@@ -253,7 +253,7 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplFixedArray");
}
if (!class_type->iterator_funcs.zf_current) {
@@ -306,45 +306,45 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
}
/* }}} */
-static zend_object *spl_fixedarray_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_fixedarray_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_fixedarray_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_fixedarray_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_fixedarray_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_fixedarray_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */
+static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */
{
zend_long index;
/* we have to return NULL on error here to avoid memleak because of
* ZE duplicating uninitialized_zval_ptr */
if (!offset) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return NULL;
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return NULL;
} else if (Z_ISUNDEF(intern->array->elements[index])) {
return NULL;
@@ -354,7 +354,7 @@ static inline zval *spl_fixedarray_object_read_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv TSRMLS_DC) /* {{{ */
+static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -378,28 +378,28 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in
return &EG(uninitialized_zval);
}
- return spl_fixedarray_object_read_dimension_helper(intern, offset TSRMLS_CC);
+ return spl_fixedarray_object_read_dimension_helper(intern, offset);
}
/* }}} */
-static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_object *intern, zval *offset, zval *value) /* {{{ */
{
zend_long index;
if (!offset) {
/* '$array[] = value' syntax is not supported */
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
} else {
if (!Z_ISUNDEF(intern->array->elements[index])) {
@@ -411,7 +411,7 @@ static inline void spl_fixedarray_object_write_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -432,22 +432,22 @@ static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zv
return;
}
- spl_fixedarray_object_write_dimension_helper(intern, offset, value TSRMLS_CC);
+ spl_fixedarray_object_write_dimension_helper(intern, offset, value);
}
/* }}} */
-static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset TSRMLS_DC) /* {{{ */
+static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_object *intern, zval *offset) /* {{{ */
{
zend_long index;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
if (index < 0 || intern->array == NULL || index >= intern->array->size) {
- zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Index invalid or out of range", 0);
return;
} else {
zval_ptr_dtor(&(intern->array->elements[index]));
@@ -456,7 +456,7 @@ static inline void spl_fixedarray_object_unset_dimension_helper(spl_fixedarray_o
}
/* }}} */
-static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -469,18 +469,18 @@ static void spl_fixedarray_object_unset_dimension(zval *object, zval *offset TSR
return;
}
- spl_fixedarray_object_unset_dimension_helper(intern, offset TSRMLS_CC);
+ spl_fixedarray_object_unset_dimension_helper(intern, offset);
}
/* }}} */
-static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_object *intern, zval *offset, int check_empty) /* {{{ */
{
zend_long index;
int retval;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_long(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset);
} else {
index = Z_LVAL_P(offset);
}
@@ -491,7 +491,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
if (Z_ISUNDEF(intern->array->elements[index])) {
retval = 0;
} else if (check_empty) {
- if (zend_is_true(&intern->array->elements[index] TSRMLS_CC)) {
+ if (zend_is_true(&intern->array->elements[index])) {
retval = 1;
} else {
retval = 0;
@@ -505,7 +505,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
}
/* }}} */
-static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -519,16 +519,16 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c
if (!Z_ISUNDEF(rv)) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- return zend_is_true(&intern->retval TSRMLS_CC);
+ return zend_is_true(&intern->retval);
}
return 0;
}
- return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty TSRMLS_CC);
+ return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty);
}
/* }}} */
-static int spl_fixedarray_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_fixedarray_object *intern;
@@ -561,12 +561,12 @@ SPL_METHOD(SplFixedArray, __construct)
spl_fixedarray_object *intern;
zend_long size = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &size) == FAILURE) {
return;
}
if (size < 0) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero");
return;
}
@@ -578,7 +578,7 @@ SPL_METHOD(SplFixedArray, __construct)
}
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, size TSRMLS_CC);
+ spl_fixedarray_init(intern->array, size);
}
/* }}} */
@@ -587,7 +587,7 @@ SPL_METHOD(SplFixedArray, __construct)
SPL_METHOD(SplFixedArray, __wakeup)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(getThis());
- HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC);
+ HashTable *intern_ht = zend_std_get_properties(getThis());
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
@@ -599,7 +599,7 @@ SPL_METHOD(SplFixedArray, __wakeup)
int size = zend_hash_num_elements(intern_ht);
intern->array = emalloc(sizeof(spl_fixedarray));
- spl_fixedarray_init(intern->array, size TSRMLS_CC);
+ spl_fixedarray_init(intern->array, size);
ZEND_HASH_FOREACH_VAL(intern_ht, data) {
if (Z_REFCOUNTED_P(data)) {
@@ -674,7 +674,7 @@ SPL_METHOD(SplFixedArray, fromArray)
int num;
zend_bool save_indexes = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &data, &save_indexes) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &data, &save_indexes) == FAILURE) {
return;
}
@@ -690,7 +690,7 @@ SPL_METHOD(SplFixedArray, fromArray)
ZEND_HASH_FOREACH_KEY(Z_ARRVAL_P(data), num_index, str_index) {
if (str_index != NULL || (zend_long)num_index < 0) {
efree(array);
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array must contain only positive integer keys");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array must contain only positive integer keys");
return;
}
@@ -702,10 +702,10 @@ SPL_METHOD(SplFixedArray, fromArray)
tmp = max_index + 1;
if (tmp <= 0) {
efree(array);
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "integer overflow detected");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "integer overflow detected");
return;
}
- spl_fixedarray_init(array, tmp TSRMLS_CC);
+ spl_fixedarray_init(array, tmp);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_index, str_index, element) {
ZVAL_DEREF(element);
@@ -716,7 +716,7 @@ SPL_METHOD(SplFixedArray, fromArray)
zval *element;
zend_long i = 0;
- spl_fixedarray_init(array, num TSRMLS_CC);
+ spl_fixedarray_init(array, num);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), element) {
ZVAL_DEREF(element);
@@ -724,7 +724,7 @@ SPL_METHOD(SplFixedArray, fromArray)
i++;
} ZEND_HASH_FOREACH_END();
} else {
- spl_fixedarray_init(array, 0 TSRMLS_CC);
+ spl_fixedarray_init(array, 0);
}
object_init_ex(return_value, spl_ce_SplFixedArray);
@@ -761,12 +761,12 @@ SPL_METHOD(SplFixedArray, setSize)
spl_fixedarray_object *intern;
zend_long size;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) {
return;
}
if (size < 0) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero");
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "array size cannot be less than zero");
return;
}
@@ -775,7 +775,7 @@ SPL_METHOD(SplFixedArray, setSize)
intern->array = ecalloc(1, sizeof(spl_fixedarray));
}
- spl_fixedarray_resize(intern->array, size TSRMLS_CC);
+ spl_fixedarray_resize(intern->array, size);
RETURN_TRUE;
}
/* }}} */
@@ -787,13 +787,13 @@ SPL_METHOD(SplFixedArray, offsetExists)
zval *zindex;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0 TSRMLS_CC));
+ RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0));
} /* }}} */
/* {{{ proto mixed SplFixedArray::offsetGet(mixed $index)
@@ -803,12 +803,12 @@ SPL_METHOD(SplFixedArray, offsetGet)
zval *zindex, *value;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- value = spl_fixedarray_object_read_dimension_helper(intern, zindex TSRMLS_CC);
+ value = spl_fixedarray_object_read_dimension_helper(intern, zindex);
if (value) {
RETURN_ZVAL(value, 1, 0);
@@ -823,12 +823,12 @@ SPL_METHOD(SplFixedArray, offsetSet)
zval *zindex, *value;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- spl_fixedarray_object_write_dimension_helper(intern, zindex, value TSRMLS_CC);
+ spl_fixedarray_object_write_dimension_helper(intern, zindex, value);
} /* }}} */
@@ -839,42 +839,42 @@ SPL_METHOD(SplFixedArray, offsetUnset)
zval *zindex;
spl_fixedarray_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zindex) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zindex) == FAILURE) {
return;
}
intern = Z_SPLFIXEDARRAY_P(getThis());
- spl_fixedarray_object_unset_dimension_helper(intern, zindex TSRMLS_CC);
+ spl_fixedarray_object_unset_dimension_helper(intern, zindex);
} /* }}} */
-static void spl_fixedarray_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter;
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_rewind(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) {
- zend_user_it_rewind(iter TSRMLS_CC);
+ zend_user_it_rewind(iter);
} else {
object->current = 0;
}
}
/* }}} */
-static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_fixedarray_it_valid(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_VALID) {
- return zend_user_it_valid(iter TSRMLS_CC);
+ return zend_user_it_valid(iter);
}
if (object->current >= 0 && object->array && object->current < object->array->size) {
@@ -885,19 +885,19 @@ static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{
}
/* }}} */
-static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
zval zindex;
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_CURRENT) {
- return zend_user_it_get_current_data(iter TSRMLS_CC);
+ return zend_user_it_get_current_data(iter);
} else {
zval *data;
ZVAL_LONG(&zindex, object->current);
- data = spl_fixedarray_object_read_dimension_helper(object, &zindex TSRMLS_CC);
+ data = spl_fixedarray_object_read_dimension_helper(object, &zindex);
zval_ptr_dtor(&zindex);
if (data == NULL) {
@@ -908,26 +908,26 @@ static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRML
}
/* }}} */
-static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) {
- zend_user_it_get_current_key(iter, key TSRMLS_CC);
+ zend_user_it_get_current_key(iter, key);
} else {
ZVAL_LONG(key, object->current);
}
}
/* }}} */
-static void spl_fixedarray_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_NEXT) {
- zend_user_it_move_forward(iter TSRMLS_CC);
+ zend_user_it_move_forward(iter);
} else {
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
object->current++;
}
}
@@ -1002,7 +1002,7 @@ SPL_METHOD(SplFixedArray, current)
ZVAL_LONG(&zindex, intern->current);
- value = spl_fixedarray_object_read_dimension_helper(intern, &zindex TSRMLS_CC);
+ value = spl_fixedarray_object_read_dimension_helper(intern, &zindex);
zval_ptr_dtor(&zindex);
@@ -1023,18 +1023,18 @@ zend_object_iterator_funcs spl_fixedarray_it_funcs = {
spl_fixedarray_it_rewind
};
-zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_fixedarray_it *iterator;
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_fixedarray_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_fixedarray_it_funcs;
diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c
index f409927271..c9b9642c6e 100644
--- a/ext/spl/spl_functions.c
+++ b/ext/spl/spl_functions.c
@@ -28,22 +28,22 @@
#include "php_spl.h"
/* {{{ spl_register_interface */
-void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions TSRMLS_DC)
+void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry * functions)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), functions);
- *ppce = zend_register_internal_interface(&ce TSRMLS_CC);
+ *ppce = zend_register_internal_interface(&ce);
}
/* }}} */
/* {{{ spl_register_std_class */
-PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list TSRMLS_DC)
+PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name, void * obj_ctor, const zend_function_entry * function_list)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list);
- *ppce = zend_register_internal_class(&ce TSRMLS_CC);
+ *ppce = zend_register_internal_class(&ce);
/* entries changed by initialize */
if (obj_ctor) {
@@ -53,12 +53,12 @@ PHPAPI void spl_register_std_class(zend_class_entry ** ppce, char * class_name,
/* }}} */
/* {{{ spl_register_sub_class */
-PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list TSRMLS_DC)
+PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, void *obj_ctor, const zend_function_entry * function_list)
{
zend_class_entry ce;
INIT_CLASS_ENTRY_EX(ce, class_name, strlen(class_name), function_list);
- *ppce = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+ *ppce = zend_register_internal_class_ex(&ce, parent_ce);
/* entries changed by initialize */
if (obj_ctor) {
@@ -70,14 +70,14 @@ PHPAPI void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry *
/* }}} */
/* {{{ spl_register_property */
-void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC)
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags)
{
- zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC);
+ zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags);
}
/* }}} */
/* {{{ spl_add_class_name */
-void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags)
{
if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
zval *tmp;
@@ -92,47 +92,47 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla
/* }}} */
/* {{{ spl_add_interfaces */
-void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags)
{
uint32_t num_interfaces;
for (num_interfaces = 0; num_interfaces < pce->num_interfaces; num_interfaces++) {
- spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags);
}
}
/* }}} */
/* {{{ spl_add_traits */
-void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)
+void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags)
{
uint32_t num_traits;
for (num_traits = 0; num_traits < pce->num_traits; num_traits++) {
- spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags);
}
}
/* }}} */
/* {{{ spl_add_classes */
-int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC)
+int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags)
{
if (!pce) {
return 0;
}
- spl_add_class_name(list, pce, allow, ce_flags TSRMLS_CC);
+ spl_add_class_name(list, pce, allow, ce_flags);
if (sub) {
- spl_add_interfaces(list, pce, allow, ce_flags TSRMLS_CC);
+ spl_add_interfaces(list, pce, allow, ce_flags);
while (pce->parent) {
pce = pce->parent;
- spl_add_classes(pce, list, sub, allow, ce_flags TSRMLS_CC);
+ spl_add_classes(pce, list, sub, allow, ce_flags);
}
}
return 0;
}
/* }}} */
-zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC) /* {{{ */
+zend_string * spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len) /* {{{ */
{
return zend_mangle_property_name(ce->name->val, ce->name->len, prop_name, prop_len, 0);
}
diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h
index 3381975e6c..942aed27e2 100644
--- a/ext/spl/spl_functions.h
+++ b/ext/spl/spl_functions.h
@@ -23,50 +23,50 @@
#include "php.h"
-typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type TSRMLS_DC);
+typedef zend_object* (*create_object_func_t)(zend_class_entry *class_type);
#define REGISTER_SPL_STD_CLASS(class_name, obj_ctor) \
- spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL TSRMLS_CC);
+ spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, NULL);
#define REGISTER_SPL_STD_CLASS_EX(class_name, obj_ctor, funcs) \
- spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs TSRMLS_CC);
+ spl_register_std_class(&spl_ce_ ## class_name, # class_name, obj_ctor, funcs);
#define REGISTER_SPL_SUB_CLASS_EX(class_name, parent_class_name, obj_ctor, funcs) \
- spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs TSRMLS_CC);
+ spl_register_sub_class(&spl_ce_ ## class_name, spl_ce_ ## parent_class_name, # class_name, obj_ctor, funcs);
#define REGISTER_SPL_INTERFACE(class_name) \
- spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name TSRMLS_CC);
+ spl_register_interface(&spl_ce_ ## class_name, # class_name, spl_funcs_ ## class_name);
#define REGISTER_SPL_IMPLEMENTS(class_name, interface_name) \
- zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, spl_ce_ ## interface_name);
+ zend_class_implements(spl_ce_ ## class_name, 1, spl_ce_ ## interface_name);
#define REGISTER_SPL_ITERATOR(class_name) \
- zend_class_implements(spl_ce_ ## class_name TSRMLS_CC, 1, zend_ce_iterator);
+ zend_class_implements(spl_ce_ ## class_name, 1, zend_ce_iterator);
#define REGISTER_SPL_PROPERTY(class_name, prop_name, prop_flags) \
- spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags TSRMLS_CC);
+ spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags);
#define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \
- zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (zend_long)value);
-void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC);
-void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list TSRMLS_DC);
-void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions TSRMLS_DC);
+void spl_register_std_class(zend_class_entry ** ppce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list);
+void spl_register_sub_class(zend_class_entry ** ppce, zend_class_entry * parent_ce, char * class_name, create_object_func_t ctor, const zend_function_entry * function_list);
+void spl_register_interface(zend_class_entry ** ppce, char * class_name, const zend_function_entry *functions);
-void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC);
+void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags);
/* sub: whether to allow subclasses/interfaces
allow = 0: allow all classes and interfaces
allow > 0: allow all that match and mask ce_flags
allow < 0: disallow all that match and mask ce_flags
*/
-void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC);
-int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC);
+void spl_add_class_name(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+void spl_add_interfaces(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+void spl_add_traits(zval * list, zend_class_entry * pce, int allow, int ce_flags);
+int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags);
/* caller must efree(return) */
-zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len TSRMLS_DC);
+zend_string *spl_gen_private_prop_name(zend_class_entry *ce, char *prop_name, int prop_len);
#define SPL_ME(class_name, function_name, arg_info, flags) \
PHP_ME( spl_ ## class_name, function_name, arg_info, flags)
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index b421c03757..c13cd2f298 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -50,9 +50,9 @@ PHPAPI zend_class_entry *spl_ce_SplMinHeap;
PHPAPI zend_class_entry *spl_ce_SplPriorityQueue;
-typedef void (*spl_ptr_heap_dtor_func)(zval * TSRMLS_DC);
-typedef void (*spl_ptr_heap_ctor_func)(zval * TSRMLS_DC);
-typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval * TSRMLS_DC);
+typedef void (*spl_ptr_heap_dtor_func)(zval *);
+typedef void (*spl_ptr_heap_ctor_func)(zval *);
+typedef int (*spl_ptr_heap_cmp_func)(zval *, zval *, zval *);
typedef struct _spl_ptr_heap {
zval *elements;
@@ -91,21 +91,21 @@ static inline spl_heap_object *spl_heap_from_obj(zend_object *obj) /* {{{ */ {
#define Z_SPLHEAP_P(zv) spl_heap_from_obj(Z_OBJ_P((zv)))
-static void spl_ptr_heap_zval_dtor(zval *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_zval_dtor(zval *elem) { /* {{{ */
if (!Z_ISUNDEF_P(elem)) {
zval_ptr_dtor(elem);
}
}
/* }}} */
-static void spl_ptr_heap_zval_ctor(zval *elem TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_zval_ctor(zval *elem) { /* {{{ */
if (Z_REFCOUNTED_P(elem)) {
Z_ADDREF_P(elem);
}
}
/* }}} */
-static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_cmp_cb_helper(zval *object, spl_heap_object *heap_object, zval *a, zval *b, zend_long *result) { /* {{{ */
zval zresult;
zend_call_method_with_2_params(object, heap_object->std.ce, &heap_object->fptr_cmp, "compare", &zresult, a, b);
@@ -145,7 +145,7 @@ static zval *spl_pqueue_extract_helper(zval *value, int flags) /* {{{ */
}
/* }}} */
-static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
if (EG(exception)) {
@@ -156,7 +156,7 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -164,12 +164,12 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
}
}
- compare_function(&result, a, b TSRMLS_CC);
+ compare_function(&result, a, b);
return (int)Z_LVAL(result);
}
/* }}} */
-static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
if (EG(exception)) {
@@ -180,7 +180,7 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper(object, heap_object, a, b, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -188,12 +188,12 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
}
}
- compare_function(&result, b, a TSRMLS_CC);
+ compare_function(&result, b, a);
return (int)Z_LVAL(result);
}
/* }}} */
-static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* {{{ */
+static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object) { /* {{{ */
zval result;
zval *a_priority_p = spl_pqueue_extract_helper(a, SPL_PQUEUE_EXTR_PRIORITY);
zval *b_priority_p = spl_pqueue_extract_helper(b, SPL_PQUEUE_EXTR_PRIORITY);
@@ -211,7 +211,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (heap_object->fptr_cmp) {
zend_long lval = 0;
- if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval TSRMLS_CC) == FAILURE) {
+ if (spl_ptr_heap_cmp_cb_helper((zval *)object, heap_object, a_priority_p, b_priority_p, &lval) == FAILURE) {
/* exception or call failure */
return 0;
}
@@ -219,7 +219,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /
}
}
- compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC);
+ compare_function(&result, a_priority_p, b_priority_p);
return (int)Z_LVAL(result);
}
/* }}} */
@@ -240,7 +240,7 @@ static spl_ptr_heap *spl_ptr_heap_init(spl_ptr_heap_cmp_func cmp, spl_ptr_heap_c
}
/* }}} */
-static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */
int i;
if (heap->count+1 > heap->max_size) {
@@ -250,10 +250,10 @@ static void spl_ptr_heap_insert(spl_ptr_heap *heap, zval *elem, void *cmp_userda
heap->max_size *= 2;
}
- heap->ctor(elem TSRMLS_CC);
+ heap->ctor(elem);
/* sifting up */
- for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) {
+ for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) {
heap->elements[i] = heap->elements[(i-1)/2];
}
@@ -275,7 +275,7 @@ static zval *spl_ptr_heap_top(spl_ptr_heap *heap) { /* {{{ */
}
/* }}} */
-static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_userdata) { /* {{{ */
int i, j;
const int limit = (heap->count-1)/2;
zval *bottom;
@@ -291,12 +291,12 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us
for (i = 0; i < limit; i = j) {
/* Find smaller child */
j = i * 2 + 1;
- if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata TSRMLS_CC) > 0) {
+ if(j != heap->count && heap->cmp(&heap->elements[j+1], &heap->elements[j], cmp_userdata) > 0) {
j++; /* next child is bigger */
}
/* swap elements between two levels */
- if(heap->cmp(bottom, &heap->elements[j], cmp_userdata TSRMLS_CC) < 0) {
+ if(heap->cmp(bottom, &heap->elements[j], cmp_userdata) < 0) {
heap->elements[i] = heap->elements[j];
} else {
break;
@@ -309,11 +309,11 @@ static void spl_ptr_heap_delete_top(spl_ptr_heap *heap, zval *elem, void *cmp_us
}
ZVAL_COPY_VALUE(&heap->elements[i], bottom);
- heap->dtor(elem TSRMLS_CC);
+ heap->dtor(elem);
}
/* }}} */
-static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ */
+static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from) { /* {{{ */
int i;
spl_ptr_heap *heap = emalloc(sizeof(spl_ptr_heap));
@@ -329,18 +329,18 @@ static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ *
memcpy(heap->elements, from->elements, sizeof(zval)*from->max_size);
for (i=0; i < heap->count; ++i) {
- heap->ctor(&heap->elements[i] TSRMLS_CC);
+ heap->ctor(&heap->elements[i]);
}
return heap;
}
/* }}} */
-static void spl_ptr_heap_destroy(spl_ptr_heap *heap TSRMLS_DC) { /* {{{ */
+static void spl_ptr_heap_destroy(spl_ptr_heap *heap) { /* {{{ */
int i;
for (i=0; i < heap->count; ++i) {
- heap->dtor(&heap->elements[i] TSRMLS_CC);
+ heap->dtor(&heap->elements[i]);
}
efree(heap->elements);
@@ -354,14 +354,14 @@ static int spl_ptr_heap_count(spl_ptr_heap *heap) { /* {{{ */
/* }}} */
/* }}} */
-zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
+zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
-static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void spl_heap_object_free_storage(zend_object *object) /* {{{ */
{
int i;
spl_heap_object *intern = spl_heap_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
for (i = 0; i < intern->heap->count; ++i) {
if (!Z_ISUNDEF(intern->heap->elements[i])) {
@@ -369,7 +369,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
}
}
- spl_ptr_heap_destroy(intern->heap TSRMLS_CC);
+ spl_ptr_heap_destroy(intern->heap);
zval_ptr_dtor(&intern->retval);
@@ -380,7 +380,7 @@ static void spl_heap_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ *
}
/* }}} */
-static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *orig, int clone_orig) /* {{{ */
{
spl_heap_object *intern;
zend_class_entry *parent = class_type;
@@ -388,7 +388,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
intern = ecalloc(1, sizeof(spl_heap_object) + sizeof(zval) * (parent->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->flags = 0;
@@ -401,7 +401,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
if (clone_orig) {
int i;
- intern->heap = spl_ptr_heap_clone(other->heap TSRMLS_CC);
+ intern->heap = spl_ptr_heap_clone(other->heap);
for (i = 0; i < intern->heap->count; ++i) {
if (Z_REFCOUNTED(intern->heap->elements[i])) {
Z_ADDREF(intern->heap->elements[i]);
@@ -445,7 +445,7 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
}
if (!parent) { /* this must never happen */
- php_error_docref(NULL TSRMLS_CC, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap");
+ php_error_docref(NULL, E_COMPILE_ERROR, "Internal compiler error, Class is not child of SplHeap");
}
if (inherited) {
@@ -463,27 +463,27 @@ static zend_object *spl_heap_object_new_ex(zend_class_entry *class_type, zval *o
}
/* }}} */
-static zend_object *spl_heap_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_new(zend_class_entry *class_type) /* {{{ */
{
- return spl_heap_object_new_ex(class_type, NULL, 0 TSRMLS_CC);
+ return spl_heap_object_new_ex(class_type, NULL, 0);
}
/* }}} */
-static zend_object *spl_heap_object_clone(zval *zobject TSRMLS_DC) /* {{{ */
+static zend_object *spl_heap_object_clone(zval *zobject) /* {{{ */
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1 TSRMLS_CC);
+ new_object = spl_heap_object_new_ex(old_object->ce, zobject, 1);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
+static int spl_heap_object_count_elements(zval *object, zend_long *count) /* {{{ */
{
spl_heap_object *intern = Z_SPLHEAP_P(object);
@@ -507,7 +507,7 @@ static int spl_heap_object_count_elements(zval *object, zend_long *count TSRMLS_
}
/* }}} */
-static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp TSRMLS_DC) { /* {{{ */
+static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zval *obj, int *is_temp) { /* {{{ */
spl_heap_object *intern = Z_SPLHEAP_P(obj);
zval tmp, heap_array;
zend_string *pnstr;
@@ -528,12 +528,12 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
- pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1);
ZVAL_LONG(&tmp, intern->flags);
zend_hash_update(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
- pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1);
ZVAL_BOOL(&tmp, intern->heap->flags&SPL_HEAP_CORRUPTED);
zend_hash_update(intern->debug_info, pnstr, &tmp);
zend_string_release(pnstr);
@@ -547,7 +547,7 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
}
}
- pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1 TSRMLS_CC);
+ pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1);
zend_hash_update(intern->debug_info, pnstr, &heap_array);
zend_string_release(pnstr);
}
@@ -556,15 +556,15 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
}
/* }}} */
-static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_heap_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp TSRMLS_CC);
+ return spl_heap_object_get_debug_info_helper(spl_ce_SplHeap, obj, is_temp);
}
/* }}} */
-static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp) /* {{{ */
{
- return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp TSRMLS_CC);
+ return spl_heap_object_get_debug_info_helper(spl_ce_SplPriorityQueue, obj, is_temp);
}
/* }}} */
@@ -605,19 +605,19 @@ SPL_METHOD(SplHeap, insert)
zval *value;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- spl_ptr_heap_insert(intern->heap, value, getThis() TSRMLS_CC);
+ spl_ptr_heap_insert(intern->heap, value, getThis());
RETURN_TRUE;
}
@@ -637,14 +637,14 @@ SPL_METHOD(SplHeap, extract)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &value, getThis());
if (Z_ISUNDEF(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
return;
}
@@ -659,14 +659,14 @@ SPL_METHOD(SplPriorityQueue, insert)
zval *data, *priority, elem;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &data, &priority) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &data, &priority) == FAILURE) {
return;
}
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
@@ -677,7 +677,7 @@ SPL_METHOD(SplPriorityQueue, insert)
add_assoc_zval_ex(&elem, "data", sizeof("data") - 1, data);
add_assoc_zval_ex(&elem, "priority", sizeof("priority") - 1, priority);
- spl_ptr_heap_insert(intern->heap, &elem, getThis() TSRMLS_CC);
+ spl_ptr_heap_insert(intern->heap, &elem, getThis());
RETURN_TRUE;
}
@@ -697,14 +697,14 @@ SPL_METHOD(SplPriorityQueue, extract)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(intern->heap, &value, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &value, getThis());
if (Z_ISUNDEF(value)) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
return;
}
@@ -739,14 +739,14 @@ SPL_METHOD(SplPriorityQueue, top)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
value = spl_ptr_heap_top(intern->heap);
if (!value) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0);
return;
}
@@ -769,7 +769,7 @@ SPL_METHOD(SplPriorityQueue, setExtractFlags)
zend_long value;
spl_heap_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
return;
}
@@ -837,11 +837,11 @@ SPL_METHOD(SplPriorityQueue, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL));
}
/* }}} */
@@ -859,14 +859,14 @@ SPL_METHOD(SplHeap, top)
intern = Z_SPLHEAP_P(getThis());
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
value = spl_ptr_heap_top(intern->heap);
if (!value) {
- zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Can't peek at an empty heap", 0);
return;
}
@@ -880,11 +880,11 @@ SPL_METHOD(SplMinHeap, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_min_cmp(a, b, NULL));
}
/* }}} */
@@ -894,42 +894,42 @@ SPL_METHOD(SplMaxHeap, compare)
{
zval *a, *b;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a, &b) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a, &b) == FAILURE) {
return;
}
- RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL TSRMLS_CC));
+ RETURN_LONG(spl_ptr_heap_zval_max_cmp(a, b, NULL));
}
/* }}} */
-static void spl_heap_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_dtor(zend_object_iterator *iter) /* {{{ */
{
spl_heap_it *iterator = (spl_heap_it *)iter;
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
zval_ptr_dtor(&iterator->intern.it.data);
}
/* }}} */
-static void spl_heap_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_rewind(zend_object_iterator *iter) /* {{{ */
{
/* do nothing, the iterator always points to the top element */
}
/* }}} */
-static int spl_heap_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static int spl_heap_it_valid(zend_object_iterator *iter) /* {{{ */
{
return ((Z_SPLHEAP_P(&iter->data))->heap->count != 0 ? SUCCESS : FAILURE);
}
/* }}} */
-static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_heap_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval *element = &object->heap->elements[0];
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return NULL;
}
@@ -941,13 +941,13 @@ static zval *spl_heap_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
}
/* }}} */
-static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval *element = &object->heap->elements[0];
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return NULL;
}
@@ -963,7 +963,7 @@ static zval *spl_pqueue_it_get_current_data(zend_object_iterator *iter TSRMLS_DC
}
/* }}} */
-static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
+static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
@@ -971,21 +971,21 @@ static void spl_heap_it_get_current_key(zend_object_iterator *iter, zval *key TS
}
/* }}} */
-static void spl_heap_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
+static void spl_heap_it_move_forward(zend_object_iterator *iter) /* {{{ */
{
spl_heap_object *object = Z_SPLHEAP_P(&iter->data);
zval elem;
if (object->heap->flags & SPL_HEAP_CORRUPTED) {
- zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
- spl_ptr_heap_delete_top(object->heap, &elem, &iter->data TSRMLS_CC);
+ spl_ptr_heap_delete_top(object->heap, &elem, &iter->data);
zval_ptr_dtor(&elem);
- zend_user_it_invalidate_current(iter TSRMLS_CC);
+ zend_user_it_invalidate_current(iter);
}
/* }}} */
@@ -1009,7 +1009,7 @@ SPL_METHOD(SplHeap, next)
{
spl_heap_object *intern = Z_SPLHEAP_P(getThis());
zval elem;
- spl_ptr_heap_delete_top(intern->heap, &elem, getThis() TSRMLS_CC);
+ spl_ptr_heap_delete_top(intern->heap, &elem, getThis());
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -1108,19 +1108,19 @@ zend_object_iterator_funcs spl_pqueue_it_funcs = {
spl_heap_it_rewind
};
-zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_heap_it *iterator;
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_heap_it));
- zend_iterator_init(&iterator->intern.it TSRMLS_CC);
+ zend_iterator_init(&iterator->intern.it);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_heap_it_funcs;
@@ -1132,19 +1132,19 @@ zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object,
}
/* }}} */
-zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */
+zend_object_iterator *spl_pqueue_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
{
spl_heap_it *iterator;
spl_heap_object *heap_object = Z_SPLHEAP_P(object);
if (by_ref) {
- zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0);
return NULL;
}
iterator = emalloc(sizeof(spl_heap_it));
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.it.data, object);
iterator->intern.it.funcs = &spl_pqueue_it_funcs;
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index c129115eeb..02bdcf8e61 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -138,7 +138,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
do { \
spl_dual_it_object *it = Z_SPLDUAL_IT_P(objzval); \
if (it->dit_type == DIT_Unknown) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -148,7 +148,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ELEMENT(var, object, element) \
do { \
if(!(object)->iterators) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -158,7 +158,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ELEMENT_ADDR(var, object, element) \
do { \
if(!(object)->iterators) { \
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, \
+ zend_throw_exception_ex(spl_ce_LogicException, 0, \
"The object is in an invalid state as the parent constructor was not called"); \
return; \
} \
@@ -168,7 +168,7 @@ static inline spl_recursive_it_object *spl_recursive_it_from_obj(zend_object *ob
#define SPL_FETCH_SUB_ITERATOR(var, object) SPL_FETCH_SUB_ELEMENT(var, object, iterator)
-static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
+static void spl_recursive_it_dtor(zend_object_iterator *_iter)
{
spl_recursive_it_iterator *iter = (spl_recursive_it_iterator*)_iter;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->intern.data);
@@ -176,7 +176,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
while (object->level > 0) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator));
@@ -185,7 +185,7 @@ static void spl_recursive_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
zval_ptr_dtor(&iter->intern.data);
}
-static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *sub_iter;
int level = object->level;
@@ -195,7 +195,7 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi
}
while (level >=0) {
sub_iter = object->iterators[level].iterator;
- if (sub_iter->funcs->valid(sub_iter TSRMLS_CC) == SUCCESS) {
+ if (sub_iter->funcs->valid(sub_iter) == SUCCESS) {
return SUCCESS;
}
level--;
@@ -207,32 +207,32 @@ static int spl_recursive_it_valid_ex(spl_recursive_it_object *object, zval *zthi
return FAILURE;
}
-static int spl_recursive_it_valid(zend_object_iterator *iter TSRMLS_DC)
+static int spl_recursive_it_valid(zend_object_iterator *iter)
{
- return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ return spl_recursive_it_valid_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter TSRMLS_DC)
+static zval *spl_recursive_it_get_current_data(zend_object_iterator *iter)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data);
zend_object_iterator *sub_iter = object->iterators[object->level].iterator;
- return sub_iter->funcs->get_current_data(sub_iter TSRMLS_CC);
+ return sub_iter->funcs->get_current_data(sub_iter);
}
-static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
+static void spl_recursive_it_get_current_key(zend_object_iterator *iter, zval *key)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&iter->data);
zend_object_iterator *sub_iter = object->iterators[object->level].iterator;
if (sub_iter->funcs->get_current_key) {
- sub_iter->funcs->get_current_key(sub_iter, key TSRMLS_CC);
+ sub_iter->funcs->get_current_key(sub_iter, key);
} else {
ZVAL_LONG(key, iter->index);
}
}
-static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static void spl_recursive_it_move_forward_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *iterator;
zval *zobject;
@@ -248,17 +248,17 @@ next_step:
iterator = object->iterators[object->level].iterator;
switch (object->iterators[object->level].state) {
case RS_NEXT:
- iterator->funcs->move_forward(iterator TSRMLS_CC);
+ iterator->funcs->move_forward(iterator);
if (EG(exception)) {
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
/* fall through */
case RS_START:
- if (iterator->funcs->valid(iterator TSRMLS_CC) == FAILURE) {
+ if (iterator->funcs->valid(iterator) == FAILURE) {
break;
}
object->iterators[object->level].state = RS_TEST;
@@ -276,11 +276,11 @@ next_step:
object->iterators[object->level].state = RS_NEXT;
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
if (Z_TYPE(retval) != IS_UNDEF) {
- has_children = zend_is_true(&retval TSRMLS_CC);
+ has_children = zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (has_children) {
if (object->max_depth == -1 || object->max_depth > object->level) {
@@ -311,7 +311,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
return /* self */;
@@ -338,7 +338,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
zval_ptr_dtor(&child);
object->iterators[object->level].state = RS_NEXT;
goto next_step;
@@ -346,9 +346,9 @@ next_step:
}
if (Z_TYPE(child) == IS_UNDEF || Z_TYPE(child) != IS_OBJECT ||
- !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator TSRMLS_CC))) {
+ !((ce = Z_OBJCE(child)) && instanceof_function(ce, spl_ce_RecursiveIterator))) {
zval_ptr_dtor(&child);
- zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_UnexpectedValueException, "Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator", 0);
return;
}
@@ -358,13 +358,13 @@ next_step:
object->iterators[object->level].state = RS_NEXT;
}
object->iterators = erealloc(object->iterators, sizeof(spl_sub_iterator) * (++object->level+1));
- sub_iter = ce->get_iterator(ce, &child, 0 TSRMLS_CC);
+ sub_iter = ce->get_iterator(ce, &child, 0);
ZVAL_COPY_VALUE(&object->iterators[object->level].zobject, &child);
object->iterators[object->level].iterator = sub_iter;
object->iterators[object->level].ce = ce;
object->iterators[object->level].state = RS_START;
if (sub_iter->funcs->rewind) {
- sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
+ sub_iter->funcs->rewind(sub_iter);
}
if (object->beginChildren) {
zend_call_method_with_0_params(zthis, object->ce, &object->beginChildren, "beginchildren", NULL);
@@ -372,7 +372,7 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
}
@@ -386,11 +386,11 @@ next_step:
if (!(object->flags & RIT_CATCH_GET_CHILD)) {
return;
} else {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
}
}
}
- zend_iterator_dtor(iterator TSRMLS_CC);
+ zend_iterator_dtor(iterator);
zval_ptr_dtor(&object->iterators[object->level].zobject);
object->level--;
} else {
@@ -399,7 +399,7 @@ next_step:
}
}
-static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis TSRMLS_DC)
+static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zthis)
{
zend_object_iterator *sub_iter;
@@ -407,7 +407,7 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
while (object->level) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
if (!EG(exception) && (!object->endChildren || object->endChildren->common.scope != spl_ce_RecursiveIteratorIterator)) {
zend_call_method_with_0_params(zthis, object->ce, &object->endChildren, "endchildren", NULL);
@@ -417,26 +417,26 @@ static void spl_recursive_it_rewind_ex(spl_recursive_it_object *object, zval *zt
object->iterators[0].state = RS_START;
sub_iter = object->iterators[0].iterator;
if (sub_iter->funcs->rewind) {
- sub_iter->funcs->rewind(sub_iter TSRMLS_CC);
+ sub_iter->funcs->rewind(sub_iter);
}
if (!EG(exception) && object->beginIteration && !object->in_iteration) {
zend_call_method_with_0_params(zthis, object->ce, &object->beginIteration, "beginIteration", NULL);
}
object->in_iteration = 1;
- spl_recursive_it_move_forward_ex(object, zthis TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(object, zthis);
}
-static void spl_recursive_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
+static void spl_recursive_it_move_forward(zend_object_iterator *iter)
{
- spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static void spl_recursive_it_rewind(zend_object_iterator *iter TSRMLS_DC)
+static void spl_recursive_it_rewind(zend_object_iterator *iter)
{
- spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data TSRMLS_CC);
+ spl_recursive_it_rewind_ex(Z_SPLRECURSIVE_IT_P(&iter->data), &iter->data);
}
-static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref TSRMLS_DC)
+static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce, zval *zobject, int by_ref)
{
spl_recursive_it_iterator *iterator;
spl_recursive_it_object *object;
@@ -451,7 +451,7 @@ static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce,
"the parent constructor has not been called");
}
- zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC);
+ zend_iterator_init((zend_object_iterator*)iterator);
ZVAL_COPY(&iterator->intern.data, zobject);
iterator->intern.funcs = ce->iterator_funcs.funcs;
@@ -477,7 +477,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
int inc_refcount = 1;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
switch (rit_type) {
case RIT_RecursiveTreeIterator: {
@@ -486,8 +486,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
mode = RIT_SELF_FIRST;
flags = RTIT_BYPASS_KEY;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) {
- if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) {
+ if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
zval *aggregate = iterator;
zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator);
//??? inc_refcount = 0;
@@ -498,7 +498,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
} else {
ZVAL_LONG(&caching_it_flags, CIT_CATCH_GET_CHILD);
}
- spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags TSRMLS_CC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &caching_it, iterator, &caching_it_flags);
zval_ptr_dtor(&caching_it_flags);
if (inc_refcount == 0 && iterator) {
zval_ptr_dtor(iterator);
@@ -515,8 +515,8 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
mode = RIT_LEAVES_ONLY;
flags = 0;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) {
- if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "o|ll", &iterator, &mode, &flags) == SUCCESS) {
+ if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate)) {
zval *aggregate = iterator;
zend_call_method_with_0_params(aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", iterator);
//??? inc_refcount = 0;
@@ -527,12 +527,12 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
break;
}
}
- if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator TSRMLS_CC)) {
+ if (!iterator || !instanceof_function(Z_OBJCE_P(iterator), spl_ce_RecursiveIterator)) {
if (iterator && !inc_refcount) {
zval_ptr_dtor(iterator);
}
- zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "An instance of RecursiveIterator or IteratorAggregate creating it is required", 0);
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -575,7 +575,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
}
ce_iterator = Z_OBJCE_P(iterator); /* respect inheritance, don't use spl_ce_RecursiveIterator */
- intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0 TSRMLS_CC);
+ intern->iterators[0].iterator = ce_iterator->get_iterator(ce_iterator, iterator, 0);
//??? if (inc_refcount) {
ZVAL_COPY(&intern->iterators[0].zobject, iterator);
//??? } else {
@@ -584,14 +584,14 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
intern->iterators[0].ce = ce_iterator;
intern->iterators[0].state = RS_START;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (EG(exception)) {
zend_object_iterator *sub_iter;
while (intern->level >= 0) {
sub_iter = intern->iterators[intern->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&intern->iterators[intern->level--].zobject);
}
efree(intern->iterators);
@@ -616,7 +616,7 @@ SPL_METHOD(RecursiveIteratorIterator, rewind)
return;
}
- spl_recursive_it_rewind_ex(object, getThis() TSRMLS_CC);
+ spl_recursive_it_rewind_ex(object, getThis());
} /* }}} */
/* {{{ proto bool RecursiveIteratorIterator::valid()
@@ -629,7 +629,7 @@ SPL_METHOD(RecursiveIteratorIterator, valid)
return;
}
- RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis() TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_recursive_it_valid_ex(object, getThis()) == SUCCESS);
} /* }}} */
/* {{{ proto mixed RecursiveIteratorIterator::key()
@@ -646,7 +646,7 @@ SPL_METHOD(RecursiveIteratorIterator, key)
SPL_FETCH_SUB_ITERATOR(iterator, object);
if (iterator->funcs->get_current_key) {
- iterator->funcs->get_current_key(iterator, return_value TSRMLS_CC);
+ iterator->funcs->get_current_key(iterator, return_value);
} else {
RETURN_NULL();
}
@@ -666,7 +666,7 @@ SPL_METHOD(RecursiveIteratorIterator, current)
SPL_FETCH_SUB_ITERATOR(iterator, object);
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -682,7 +682,7 @@ SPL_METHOD(RecursiveIteratorIterator, next)
return;
}
- spl_recursive_it_move_forward_ex(object, getThis() TSRMLS_CC);
+ spl_recursive_it_move_forward_ex(object, getThis());
} /* }}} */
/* {{{ proto int RecursiveIteratorIterator::getDepth()
@@ -705,7 +705,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
zend_long level = object->level;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &level) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &level) == FAILURE) {
return;
}
if (level < 0 || level > object->level) {
@@ -713,7 +713,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
@@ -848,11 +848,11 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
zend_long max_depth = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &max_depth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_depth) == FAILURE) {
return;
}
if (max_depth < -1) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0);
return;
} else if (max_depth > INT_MAX) {
max_depth = INT_MAX;
@@ -878,7 +878,7 @@ SPL_METHOD(RecursiveIteratorIterator, getMaxDepth)
}
} /* }}} */
-static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key TSRMLS_DC)
+static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key)
{
union _zend_function *function_handler;
spl_recursive_it_object *object = spl_recursive_it_from_obj(*zobject);
@@ -886,16 +886,16 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject,
zval *zobj;
if (!object->iterators) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val);
+ php_error_docref(NULL, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val);
}
zobj = &object->iterators[level].zobject;
- function_handler = std_object_handlers.get_method(zobject, method, key TSRMLS_CC);
+ function_handler = std_object_handlers.get_method(zobject, method, key);
if (!function_handler) {
if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) {
if (Z_OBJ_HT_P(zobj)->get_method) {
*zobject = Z_OBJ_P(zobj);
- function_handler = (*zobject)->handlers->get_method(zobject, method, key TSRMLS_CC);
+ function_handler = (*zobject)->handlers->get_method(zobject, method, key);
}
} else {
*zobject = Z_OBJ_P(zobj);
@@ -905,18 +905,18 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject,
}
/* {{{ spl_RecursiveIteratorIterator_dtor */
-static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC)
+static void spl_RecursiveIteratorIterator_dtor(zend_object *_object)
{
spl_recursive_it_object *object = spl_recursive_it_from_obj(_object);
zend_object_iterator *sub_iter;
/* call standard dtor */
- zend_objects_destroy_object(_object TSRMLS_CC);
+ zend_objects_destroy_object(_object);
if (object->iterators) {
while (object->level >= 0) {
sub_iter = object->iterators[object->level].iterator;
- zend_iterator_dtor(sub_iter TSRMLS_CC);
+ zend_iterator_dtor(sub_iter);
zval_ptr_dtor(&object->iterators[object->level--].zobject);
}
efree(object->iterators);
@@ -926,11 +926,11 @@ static void spl_RecursiveIteratorIterator_dtor(zend_object *_object TSRMLS_DC)
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_free_storage */
-static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRMLS_DC)
+static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object)
{
spl_recursive_it_object *object = spl_recursive_it_from_obj(_object);
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
smart_str_free(&object->prefix[0]);
smart_str_free(&object->prefix[1]);
smart_str_free(&object->prefix[2]);
@@ -943,7 +943,7 @@ static void spl_RecursiveIteratorIterator_free_storage(zend_object *_object TSRM
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_new_ex */
-static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix TSRMLS_DC)
+static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class_type, int init_prefix)
{
spl_recursive_it_object *intern;
@@ -960,7 +960,7 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class
smart_str_appendl(&intern->postfix[0], "", 0);
}
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_handlers_rec_it_it;
@@ -969,16 +969,16 @@ static zend_object *spl_RecursiveIteratorIterator_new_ex(zend_class_entry *class
/* }}} */
/* {{{ spl_RecursiveIteratorIterator_new */
-static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_RecursiveIteratorIterator_new(zend_class_entry *class_type)
{
- return spl_RecursiveIteratorIterator_new_ex(class_type, 0 TSRMLS_CC);
+ return spl_RecursiveIteratorIterator_new_ex(class_type, 0);
}
/* }}} */
/* {{{ spl_RecursiveTreeIterator_new */
-static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_RecursiveTreeIterator_new(zend_class_entry *class_type)
{
- return spl_RecursiveIteratorIterator_new_ex(class_type, 1 TSRMLS_CC);
+ return spl_RecursiveIteratorIterator_new_ex(class_type, 1);
}
/* }}} */
@@ -1018,7 +1018,7 @@ static const zend_function_entry spl_funcs_RecursiveIteratorIterator[] = {
PHP_FE_END
};
-static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *object, zval *return_value)
{
smart_str str = {0};
zval has_next;
@@ -1053,15 +1053,15 @@ static void spl_recursive_tree_iterator_get_prefix(spl_recursive_it_object *obje
RETURN_STR(str.s);
}
-static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *object, zval *return_value)
{
zend_object_iterator *iterator = object->iterators[object->level].iterator;
zval *data;
zend_error_handling error_handling;
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
- zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling);
if (data) {
RETVAL_ZVAL(data, 1, 0);
if (Z_TYPE_P(return_value) == IS_ARRAY) {
@@ -1071,10 +1071,10 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object *objec
convert_to_string(return_value);
}
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
-static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value TSRMLS_DC)
+static void spl_recursive_tree_iterator_get_postfix(spl_recursive_it_object *object, zval *return_value)
{
RETVAL_STR(object->postfix[0].s);
Z_ADDREF_P(return_value);
@@ -1096,12 +1096,12 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart)
size_t prefix_len;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &part, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &part, &prefix, &prefix_len) == FAILURE) {
return;
}
if (0 > part || part > 5) {
- zend_throw_exception_ex(spl_ce_OutOfRangeException, 0 TSRMLS_CC, "Use RecursiveTreeIterator::PREFIX_* constant");
+ zend_throw_exception_ex(spl_ce_OutOfRangeException, 0, "Use RecursiveTreeIterator::PREFIX_* constant");
return;
}
@@ -1120,12 +1120,12 @@ SPL_METHOD(RecursiveTreeIterator, getPrefix)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_prefix(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, return_value);
} /* }}} */
/* {{{ proto void RecursiveTreeIterator::setPostfix(string prefix)
@@ -1136,7 +1136,7 @@ SPL_METHOD(RecursiveTreeIterator, setPostfix)
char* postfix;
size_t postfix_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &postfix, &postfix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &postfix, &postfix_len) == FAILURE) {
return;
}
@@ -1155,12 +1155,12 @@ SPL_METHOD(RecursiveTreeIterator, getEntry)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_entry(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_entry(object, return_value);
} /* }}} */
/* {{{ proto string RecursiveTreeIterator::getPostfix()
@@ -1174,12 +1174,12 @@ SPL_METHOD(RecursiveTreeIterator, getPostfix)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
- spl_recursive_tree_iterator_get_postfix(object, return_value TSRMLS_CC);
+ spl_recursive_tree_iterator_get_postfix(object, return_value);
} /* }}} */
/* {{{ proto mixed RecursiveTreeIterator::current()
@@ -1196,7 +1196,7 @@ SPL_METHOD(RecursiveTreeIterator, current)
}
if(!object->iterators) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC,
+ zend_throw_exception_ex(spl_ce_LogicException, 0,
"The object is in an invalid state as the parent constructor was not called");
return;
}
@@ -1206,7 +1206,7 @@ SPL_METHOD(RecursiveTreeIterator, current)
zval *data;
SPL_FETCH_SUB_ITERATOR(iterator, object);
- data = iterator->funcs->get_current_data(iterator TSRMLS_CC);
+ data = iterator->funcs->get_current_data(iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
} else {
@@ -1216,14 +1216,14 @@ SPL_METHOD(RecursiveTreeIterator, current)
ZVAL_NULL(&prefix);
ZVAL_NULL(&entry);
- spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC);
- spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, &prefix);
+ spl_recursive_tree_iterator_get_entry(object, &entry);
if (Z_TYPE(entry) != IS_STRING) {
zval_ptr_dtor(&prefix);
zval_ptr_dtor(&entry);
RETURN_NULL();
}
- spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC);
+ spl_recursive_tree_iterator_get_postfix(object, &postfix);
str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix), 0);
ptr = str->val;
@@ -1260,7 +1260,7 @@ SPL_METHOD(RecursiveTreeIterator, key)
SPL_FETCH_SUB_ITERATOR(iterator, object);
if (iterator->funcs->get_current_key) {
- iterator->funcs->get_current_key(iterator, &key TSRMLS_CC);
+ iterator->funcs->get_current_key(iterator, &key);
} else {
ZVAL_NULL(&key);
}
@@ -1273,13 +1273,13 @@ SPL_METHOD(RecursiveTreeIterator, key)
}
if (Z_TYPE(key) != IS_STRING) {
- if (zend_make_printable_zval(&key, &key_copy TSRMLS_CC)) {
+ if (zend_make_printable_zval(&key, &key_copy)) {
key = key_copy;
}
}
- spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC);
- spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, &prefix);
+ spl_recursive_tree_iterator_get_postfix(object, &postfix);
str = zend_string_alloc(Z_STRLEN(prefix) + Z_STRLEN(key) + Z_STRLEN(postfix), 0);
ptr = str->val;
@@ -1334,7 +1334,7 @@ static const zend_function_entry spl_funcs_RecursiveTreeIterator[] = {
};
#if MBO_0
-static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)
+static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_entry *class_type)
{
class_type->iterator_funcs.zf_valid = NULL;
class_type->iterator_funcs.zf_current = NULL;
@@ -1349,19 +1349,19 @@ static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_
}
#endif
-static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC)
+static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key)
{
union _zend_function *function_handler;
spl_dual_it_object *intern;
intern = spl_dual_it_from_obj(*object);
- function_handler = std_object_handlers.get_method(object, method, key TSRMLS_CC);
+ function_handler = std_object_handlers.get_method(object, method, key);
if (!function_handler && intern->inner.ce) {
if ((function_handler = zend_hash_find_ptr(&intern->inner.ce->function_table, method)) == NULL) {
if (Z_OBJ_HT(intern->inner.zobject)->get_method) {
*object = Z_OBJ(intern->inner.zobject);
- function_handler = (*object)->handlers->get_method(object, method, key TSRMLS_CC);
+ function_handler = (*object)->handlers->get_method(object, method, key);
}
} else {
*object = Z_OBJ(intern->inner.zobject);
@@ -1384,8 +1384,8 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
intern = Z_SPLDUAL_IT_P(getThis());
ZVAL_STRING(&func, method, 0);
- if (!zend_is_callable(&func, 0, &method TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method);
+ if (!zend_is_callable(&func, 0, &method)) {
+ php_error_docref(NULL, E_ERROR, "Method %s::%s() does not exist", intern->inner.ce->name, method);
return FAILURE;
}
@@ -1401,12 +1401,12 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
}
arg_count = current; /* restore */
- if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (call_user_function_ex(EG(function_table), NULL, &func, &retval, arg_count, func_params, 0, NULL) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
RETURN_ZVAL(&retval, 0, 0);
success = SUCCESS;
} else {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method);
+ php_error_docref(NULL, E_ERROR, "Unable to call %s::%s()", intern->inner.ce->name, method);
success = FAILURE;
}
@@ -1417,14 +1417,14 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
#define SPL_CHECK_CTOR(intern, classname) \
if (intern->dit_type == DIT_Unknown) { \
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Classes derived from %s must call %s::__construct()", \
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Classes derived from %s must call %s::__construct()", \
(spl_ce_##classname)->name->val, (spl_ce_##classname)->name->val); \
return; \
}
#define APPENDIT_CHECK_CTOR(intern) SPL_CHECK_CTOR(intern, AppendIterator)
-static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC);
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more);
static inline int spl_cit_check_flags(zend_long flags)
{
@@ -1449,29 +1449,29 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern = Z_SPLDUAL_IT_P(getThis());
if (intern->dit_type != DIT_Unknown) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s::getIterator() must be called exactly once per instance", ce_base->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called exactly once per instance", ce_base->name->val);
return NULL;
}
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
intern->dit_type = dit_type;
switch (dit_type) {
case DIT_LimitIterator: {
intern->u.limit.offset = 0; /* start at beginning */
intern->u.limit.count = -1; /* get all */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (intern->u.limit.offset < 0) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (intern->u.limit.count < 0 && intern->u.limit.count != -1) {
- zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_OutOfRangeException, "Parameter count must either be -1 or a value greater than or equal 0", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
break;
@@ -1479,13 +1479,13 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
case DIT_CachingIterator:
case DIT_RecursiveCachingIterator: {
zend_long flags = CIT_CALL_TOSTRING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|l", &zobject, ce_inner, &flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &zobject, ce_inner, &flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (spl_cit_check_flags(flags) != SUCCESS) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.caching.flags |= flags & CIT_PUBLIC;
@@ -1496,33 +1496,33 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
zend_class_entry *ce_cast;
zend_string *class_name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|S", &zobject, ce_inner, &class_name) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S", &zobject, ce_inner, &class_name) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
ce = Z_OBJCE_P(zobject);
- if (!instanceof_function(ce, zend_ce_iterator TSRMLS_CC)) {
+ if (!instanceof_function(ce, zend_ce_iterator)) {
if (ZEND_NUM_ARGS() > 1) {
- if (!(ce_cast = zend_lookup_class(class_name TSRMLS_CC))
- || !instanceof_function(ce, ce_cast TSRMLS_CC)
+ if (!(ce_cast = zend_lookup_class(class_name))
+ || !instanceof_function(ce, ce_cast)
|| !ce_cast->get_iterator
) {
- zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception(spl_ce_LogicException, "Class to downcast to not found or not base class or does not implement Traversable", 0);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
ce = ce_cast;
}
- if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) {
+ if (instanceof_function(ce, zend_ce_aggregate)) {
zend_call_method_with_0_params(zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval);
if (EG(exception)) {
zval_ptr_dtor(&retval);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
- if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "%s::getIterator() must return an object that implements Traversable", ce->name->val);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (Z_TYPE(retval) != IS_OBJECT || !instanceof_function(Z_OBJCE(retval), zend_ce_traversable)) {
+ zend_throw_exception_ex(spl_ce_LogicException, 0, "%s::getIterator() must return an object that implements Traversable", ce->name->val);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
zobject = &retval;
@@ -1533,10 +1533,10 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
break;
}
case DIT_AppendIterator:
- spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit TSRMLS_CC);
+ spl_instantiate(spl_ce_ArrayIterator, &intern->u.append.zarrayit);
zend_call_method_with_0_params(&intern->u.append.zarrayit, spl_ce_ArrayIterator, &spl_ce_ArrayIterator->constructor, "__construct", NULL);
- intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0 TSRMLS_CC);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0);
+ zend_restore_error_handling(&error_handling);
return intern;
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
case DIT_RegexIterator:
@@ -1547,21 +1547,21 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern->u.regex.use_flags = ZEND_NUM_ARGS() >= 5;
intern->u.regex.flags = 0;
intern->u.regex.preg_flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OS|lll", &zobject, ce_inner, &regex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS|lll", &zobject, ce_inner, &regex, &mode, &intern->u.regex.flags, &intern->u.regex.preg_flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
if (mode < 0 || mode >= REGIT_MODE_MAX) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode);
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.regex.mode = mode;
intern->u.regex.regex = zend_string_copy(regex);
- intern->u.regex.pce = pcre_get_compiled_regex_cache(regex TSRMLS_CC);
+ intern->u.regex.pce = pcre_get_compiled_regex_cache(regex);
if (intern->u.regex.pce == NULL) {
/* pcre_get_compiled_regex_cache has already sent error */
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
return NULL;
}
intern->u.regex.pce->refcount++;
@@ -1572,8 +1572,8 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
case DIT_RecursiveCallbackFilterIterator: {
_spl_cbfilter_it_intern *cfi = emalloc(sizeof(*cfi));
cfi->fci.object = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of", &zobject, ce_inner, &cfi->fci, &cfi->fcc) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
efree(cfi);
return NULL;
}
@@ -1586,14 +1586,14 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
break;
}
default:
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobject, ce_inner) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zobject, ce_inner) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return NULL;
}
break;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (inc_refcount) {
ZVAL_COPY(&intern->inner.zobject, zobject);
@@ -1603,7 +1603,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
intern->inner.ce = dit_type == DIT_IteratorIterator ? ce : Z_OBJCE_P(zobject);
intern->inner.object = Z_OBJ_P(zobject);
- intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0 TSRMLS_CC);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, zobject, 0);
return intern;
}
@@ -1644,17 +1644,17 @@ SPL_METHOD(dual_it, getInnerIterator)
}
} /* }}} */
-static inline void spl_dual_it_require(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_require(spl_dual_it_object *intern)
{
if (!intern->inner.iterator) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "The inner constructor wasn't initialized with an iterator instance");
+ php_error_docref(NULL, E_ERROR, "The inner constructor wasn't initialized with an iterator instance");
}
}
-static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_free(spl_dual_it_object *intern)
{
if (intern->inner.iterator && intern->inner.iterator->funcs->invalidate_current) {
- intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->invalidate_current(intern->inner.iterator);
}
if (Z_TYPE(intern->current.data) != IS_UNDEF) {
zval_ptr_dtor(&intern->current.data);
@@ -1676,37 +1676,37 @@ static inline void spl_dual_it_free(spl_dual_it_object *intern TSRMLS_DC)
}
}
-static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_dual_it_rewind(spl_dual_it_object *intern)
{
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
intern->current.pos = 0;
if (intern->inner.iterator->funcs->rewind) {
- intern->inner.iterator->funcs->rewind(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->rewind(intern->inner.iterator);
}
}
-static inline int spl_dual_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_dual_it_valid(spl_dual_it_object *intern)
{
if (!intern->inner.iterator) {
return FAILURE;
}
/* FAILURE / SUCCESS */
- return intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC);
+ return intern->inner.iterator->funcs->valid(intern->inner.iterator);
}
-static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC)
+static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more)
{
zval *data;
- spl_dual_it_free(intern TSRMLS_CC);
- if (!check_more || spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC);
+ spl_dual_it_free(intern);
+ if (!check_more || spl_dual_it_valid(intern) == SUCCESS) {
+ data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator);
if (data) {
ZVAL_COPY(&intern->current.data, data);
}
if (intern->inner.iterator->funcs->get_current_key) {
- intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, &intern->current.key);
if (EG(exception)) {
zval_ptr_dtor(&intern->current.key);
ZVAL_UNDEF(&intern->current.key);
@@ -1719,14 +1719,14 @@ static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more T
return FAILURE;
}
-static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free TSRMLS_DC)
+static inline void spl_dual_it_next(spl_dual_it_object *intern, int do_free)
{
if (do_free) {
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
} else {
- spl_dual_it_require(intern TSRMLS_CC);
+ spl_dual_it_require(intern);
}
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
intern->current.pos++;
}
@@ -1744,8 +1744,8 @@ SPL_METHOD(dual_it, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_dual_it_fetch(intern, 1);
} /* }}} */
/* {{{ proto bool FilterIterator::valid()
@@ -1829,18 +1829,18 @@ SPL_METHOD(dual_it, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ spl_dual_it_fetch(intern, 1);
} /* }}} */
-static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern)
{
zval retval;
- while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
+ while (spl_dual_it_fetch(intern, 1) == SUCCESS) {
zend_call_method_with_0_params(zthis, intern->std.ce, NULL, "accept", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
- if (zend_is_true(&retval TSRMLS_CC)) {
+ if (zend_is_true(&retval)) {
zval_ptr_dtor(&retval);
return;
}
@@ -1849,21 +1849,21 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T
if (EG(exception)) {
return;
}
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
}
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
}
-static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_rewind(zval *zthis, spl_dual_it_object *intern)
{
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_filter_it_fetch(zthis, intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_filter_it_fetch(zthis, intern);
}
-static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_filter_it_next(zval *zthis, spl_dual_it_object *intern)
{
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- spl_filter_it_fetch(zthis, intern TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ spl_filter_it_fetch(zthis, intern);
}
/* {{{ proto void FilterIterator::rewind()
@@ -1877,7 +1877,7 @@ SPL_METHOD(FilterIterator, rewind)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_filter_it_rewind(getThis(), intern TSRMLS_CC);
+ spl_filter_it_rewind(getThis(), intern);
} /* }}} */
/* {{{ proto void FilterIterator::next()
@@ -1891,7 +1891,7 @@ SPL_METHOD(FilterIterator, next)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_filter_it_next(getThis(), intern TSRMLS_CC);
+ spl_filter_it_next(getThis(), intern);
} /* }}} */
/* {{{ proto void RecursiveCallbackFilterIterator::__construct(RecursiveIterator it, callback)
@@ -1945,7 +1945,7 @@ SPL_METHOD(RecursiveFilterIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
- spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval TSRMLS_CC);
+ spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, &retval);
}
zval_ptr_dtor(&retval);
} /* }}} */
@@ -1965,7 +1965,7 @@ SPL_METHOD(RecursiveCallbackFilterIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name TSRMLS_CC);
+ spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, &intern->u.cbfilter->fci.function_name);
}
zval_ptr_dtor(&retval);
} /* }}} */
@@ -2011,7 +2011,7 @@ SPL_METHOD(CallbackFilterIterator, accept)
fci->params = params;
fci->no_separation = 0;
- if (zend_call_function(fci, fcc TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ if (zend_call_function(fci, fcc) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
RETURN_FALSE;
}
if (EG(exception)) {
@@ -2051,7 +2051,7 @@ SPL_METHOD(RegexIterator, accept)
}
ZVAL_UNDEF(&subject_copy);
- use_copy = zend_make_printable_zval(subject_ptr, &subject_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(subject_ptr, &subject_copy);
if (use_copy) {
subject = Z_STRVAL(subject_copy);
subject_len = (int)Z_STRLEN(subject_copy);
@@ -2078,7 +2078,7 @@ SPL_METHOD(RegexIterator, accept)
zval_ptr_dtor(&intern->current.data);
ZVAL_UNDEF(&intern->current.data);
php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount,
- &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
+ &intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0);
RETVAL_BOOL(Z_LVAL(zcount) > 0);
break;
@@ -2089,20 +2089,20 @@ SPL_METHOD(RegexIterator, accept)
}
zval_ptr_dtor(&intern->current.data);
ZVAL_UNDEF(&intern->current.data);
- php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC);
+ php_pcre_split_impl(intern->u.regex.pce, subject, subject_len, &intern->current.data, -1, intern->u.regex.preg_flags);
count = zend_hash_num_elements(Z_ARRVAL(intern->current.data));
RETVAL_BOOL(count > 1);
break;
case REGIT_MODE_REPLACE:
- replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1 TSRMLS_CC);
+ replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1);
if (Z_TYPE_P(replacement) != IS_STRING) {
tmp_replacement = *replacement;
zval_copy_ctor(&tmp_replacement);
convert_to_string(&tmp_replacement);
replacement = &tmp_replacement;
}
- result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count TSRMLS_CC);
+ result = php_pcre_replace_impl(intern->u.regex.pce, subject, subject_len, replacement, 0, -1, &count);
if (intern->u.regex.flags & REGIT_USE_KEY) {
zval_ptr_dtor(&intern->current.key);
@@ -2165,12 +2165,12 @@ SPL_METHOD(RegexIterator, setMode)
spl_dual_it_object *intern;
zend_long mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &mode) == FAILURE) {
return;
}
if (mode < 0 || mode >= REGIT_MODE_MAX) {
- zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "Illegal mode %pd", mode);
+ zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Illegal mode %pd", mode);
return;/* NULL */
}
@@ -2201,7 +2201,7 @@ SPL_METHOD(RegexIterator, setFlags)
spl_dual_it_object *intern;
zend_long flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
@@ -2236,7 +2236,7 @@ SPL_METHOD(RegexIterator, setPregFlags)
spl_dual_it_object *intern;
zend_long preg_flags;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &preg_flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &preg_flags) == FAILURE) {
return;
}
@@ -2276,7 +2276,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
ZVAL_LONG(&args[3], intern->u.regex.flags);
ZVAL_LONG(&args[4], intern->u.regex.preg_flags);
- spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args TSRMLS_CC);
+ spl_instantiate_arg_n(Z_OBJCE_P(getThis()), return_value, 5, args);
zval_ptr_dtor(&args[1]);
}
@@ -2305,23 +2305,23 @@ SPL_METHOD(RecursiveRegexIterator, accept)
#endif
/* {{{ spl_dual_it_dtor */
-static void spl_dual_it_dtor(zend_object *_object TSRMLS_DC)
+static void spl_dual_it_dtor(zend_object *_object)
{
spl_dual_it_object *object = spl_dual_it_from_obj(_object);
/* call standard dtor */
- zend_objects_destroy_object(_object TSRMLS_CC);
+ zend_objects_destroy_object(_object);
- spl_dual_it_free(object TSRMLS_CC);
+ spl_dual_it_free(object);
if (object->inner.iterator) {
- zend_iterator_dtor(object->inner.iterator TSRMLS_CC);
+ zend_iterator_dtor(object->inner.iterator);
}
}
/* }}} */
/* {{{ spl_dual_it_free_storage */
-static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
+static void spl_dual_it_free_storage(zend_object *_object)
{
spl_dual_it_object *object = spl_dual_it_from_obj(_object);
@@ -2331,7 +2331,7 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
}
if (object->dit_type == DIT_AppendIterator) {
- zend_iterator_dtor(object->u.append.iterator TSRMLS_CC);
+ zend_iterator_dtor(object->u.append.iterator);
if (Z_TYPE(object->u.append.zarrayit) != IS_UNDEF) {
zval_ptr_dtor(&object->u.append.zarrayit);
}
@@ -2367,19 +2367,19 @@ static void spl_dual_it_free_storage(zend_object *_object TSRMLS_DC)
}
}
- zend_object_std_dtor(&object->std TSRMLS_CC);
+ zend_object_std_dtor(&object->std);
}
/* }}} */
/* {{{ spl_dual_it_new */
-static zend_object *spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_dual_it_new(zend_class_entry *class_type)
{
spl_dual_it_object *intern;
intern = ecalloc(1, sizeof(spl_dual_it_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->dit_type = DIT_Unknown;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &spl_handlers_dual_it;
@@ -2494,51 +2494,51 @@ static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
};
#endif
-static inline int spl_limit_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_limit_it_valid(spl_dual_it_object *intern)
{
/* FAILURE / SUCCESS */
if (intern->u.limit.count != -1 && intern->current.pos >= intern->u.limit.offset + intern->u.limit.count) {
return FAILURE;
} else {
- return spl_dual_it_valid(intern TSRMLS_CC);
+ return spl_dual_it_valid(intern);
}
}
-static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos TSRMLS_DC)
+static inline void spl_limit_it_seek(spl_dual_it_object *intern, zend_long pos)
{
zval zpos;
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
if (pos < intern->u.limit.offset) {
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is below the offset %pd", pos, intern->u.limit.offset);
return;
}
if (pos >= intern->u.limit.offset + intern->u.limit.count && intern->u.limit.count != -1) {
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Cannot seek to %pd which is behind offset %pd plus count %pd", pos, intern->u.limit.offset, intern->u.limit.count);
return;
}
- if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator TSRMLS_CC)) {
+ if (pos != intern->current.pos && instanceof_function(intern->inner.ce, spl_ce_SeekableIterator)) {
ZVAL_LONG(&zpos, pos);
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
zend_call_method_with_1_params(&intern->inner.zobject, intern->inner.ce, NULL, "seek", NULL, &zpos);
zval_ptr_dtor(&zpos);
if (!EG(exception)) {
intern->current.pos = pos;
- if (spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ if (spl_limit_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
}
}
} else {
/* emulate the forward seek, by next() calls */
/* a back ward seek is done by a previous rewind() */
if (pos < intern->current.pos) {
- spl_dual_it_rewind(intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
}
- while (pos > intern->current.pos && spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ while (pos > intern->current.pos && spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_next(intern, 1);
}
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 1);
}
}
}
@@ -2557,8 +2557,8 @@ SPL_METHOD(LimitIterator, rewind)
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_rewind(intern TSRMLS_CC);
- spl_limit_it_seek(intern, intern->u.limit.offset TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ spl_limit_it_seek(intern, intern->u.limit.offset);
} /* }}} */
/* {{{ proto bool LimitIterator::valid()
@@ -2569,7 +2569,7 @@ SPL_METHOD(LimitIterator, valid)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
-/* RETURN_BOOL(spl_limit_it_valid(intern TSRMLS_CC) == SUCCESS);*/
+/* RETURN_BOOL(spl_limit_it_valid(intern) == SUCCESS);*/
RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && Z_TYPE(intern->current.data) != IS_UNDEF);
} /* }}} */
@@ -2581,9 +2581,9 @@ SPL_METHOD(LimitIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
if (intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) {
- spl_dual_it_fetch(intern, 1 TSRMLS_CC);
+ spl_dual_it_fetch(intern, 1);
}
} /* }}} */
@@ -2594,12 +2594,12 @@ SPL_METHOD(LimitIterator, seek)
spl_dual_it_object *intern;
zend_long pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) {
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_limit_it_seek(intern, pos TSRMLS_CC);
+ spl_limit_it_seek(intern, pos);
RETURN_LONG(intern->current.pos);
} /* }}} */
@@ -2644,19 +2644,19 @@ static const zend_function_entry spl_funcs_LimitIterator[] = {
PHP_FE_END
};
-static inline int spl_caching_it_valid(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_caching_it_valid(spl_dual_it_object *intern)
{
return intern->u.caching.flags & CIT_VALID ? SUCCESS : FAILURE;
}
-static inline int spl_caching_it_has_next(spl_dual_it_object *intern TSRMLS_DC)
+static inline int spl_caching_it_has_next(spl_dual_it_object *intern)
{
- return spl_dual_it_valid(intern TSRMLS_CC);
+ return spl_dual_it_valid(intern);
}
-static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_caching_it_next(spl_dual_it_object *intern)
{
- if (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
+ if (spl_dual_it_fetch(intern, 1) == SUCCESS) {
intern->u.caching.flags |= CIT_VALID;
/* Full cache ? */
if (intern->u.caching.flags & CIT_FULL_CACHE) {
@@ -2665,7 +2665,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
ZVAL_ZVAL(&zcacheval, &intern->current.data, 1, 0);
- array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval TSRMLS_CC);
+ array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval);
zval_ptr_dtor(&zcacheval);
}
@@ -2676,31 +2676,31 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
if (EG(exception)) {
zval_ptr_dtor(&retval);
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
return;
}
} else {
- if (zend_is_true(&retval TSRMLS_CC)) {
+ if (zend_is_true(&retval)) {
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren);
if (EG(exception)) {
zval_ptr_dtor(&zchildren);
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
zval_ptr_dtor(&retval);
return;
}
} else {
ZVAL_LONG(&zflags, intern->u.caching.flags & CIT_PUBLIC);
- spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags TSRMLS_CC);
+ spl_instantiate_arg_ex2(spl_ce_RecursiveCachingIterator, &intern->u.caching.zchildren, &zchildren, &zflags);
zval_ptr_dtor(&zchildren);
}
}
zval_ptr_dtor(&retval);
if (EG(exception)) {
if (intern->u.caching.flags & CIT_CATCH_GET_CHILD) {
- zend_clear_exception(TSRMLS_C);
+ zend_clear_exception();
} else {
return;
}
@@ -2715,24 +2715,24 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
} else {
ZVAL_COPY_VALUE(&intern->u.caching.zstr, &intern->current.data);
}
- use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy TSRMLS_CC);
+ use_copy = zend_make_printable_zval(&intern->u.caching.zstr, &expr_copy);
if (use_copy) {
ZVAL_COPY_VALUE(&intern->u.caching.zstr, &expr_copy);
} else if (Z_REFCOUNTED(intern->u.caching.zstr)) {
Z_ADDREF(intern->u.caching.zstr);
}
}
- spl_dual_it_next(intern, 0 TSRMLS_CC);
+ spl_dual_it_next(intern, 0);
} else {
intern->u.caching.flags &= ~CIT_VALID;
}
}
-static inline void spl_caching_it_rewind(spl_dual_it_object *intern TSRMLS_DC)
+static inline void spl_caching_it_rewind(spl_dual_it_object *intern)
{
- spl_dual_it_rewind(intern TSRMLS_CC);
+ spl_dual_it_rewind(intern);
zend_hash_clean(HASH_OF(&intern->u.caching.zcache));
- spl_caching_it_next(intern TSRMLS_CC);
+ spl_caching_it_next(intern);
}
/* {{{ proto void CachingIterator::__construct(Iterator it [, flags = CIT_CALL_TOSTRING])
@@ -2754,7 +2754,7 @@ SPL_METHOD(CachingIterator, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_caching_it_rewind(intern TSRMLS_CC);
+ spl_caching_it_rewind(intern);
} /* }}} */
/* {{{ proto bool CachingIterator::valid()
@@ -2769,7 +2769,7 @@ SPL_METHOD(CachingIterator, valid)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(spl_caching_it_valid(intern TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_caching_it_valid(intern) == SUCCESS);
} /* }}} */
/* {{{ proto void CachingIterator::next()
@@ -2784,7 +2784,7 @@ SPL_METHOD(CachingIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_caching_it_next(intern TSRMLS_CC);
+ spl_caching_it_next(intern);
} /* }}} */
/* {{{ proto bool CachingIterator::hasNext()
@@ -2799,7 +2799,7 @@ SPL_METHOD(CachingIterator, hasNext)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(spl_caching_it_has_next(intern TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(spl_caching_it_has_next(intern) == SUCCESS);
} /* }}} */
/* {{{ proto string CachingIterator::__toString()
@@ -2811,7 +2811,7 @@ SPL_METHOD(CachingIterator, __toString)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
@@ -2841,11 +2841,11 @@ SPL_METHOD(CachingIterator, offsetSet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &key, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &key, &value) == FAILURE) {
return;
}
@@ -2867,11 +2867,11 @@ SPL_METHOD(CachingIterator, offsetGet)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2894,11 +2894,11 @@ SPL_METHOD(CachingIterator, offsetUnset)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2916,11 +2916,11 @@ SPL_METHOD(CachingIterator, offsetExists)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &key) == FAILURE) {
return;
}
@@ -2941,7 +2941,7 @@ SPL_METHOD(CachingIterator, getCache)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
@@ -2974,20 +2974,20 @@ SPL_METHOD(CachingIterator, setFlags)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
}
if (spl_cit_check_flags(flags) != SUCCESS) {
- zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException , "Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER", 0);
return;
}
if ((intern->u.caching.flags & CIT_CALL_TOSTRING) != 0 && (flags & CIT_CALL_TOSTRING) == 0) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag CALL_TO_STRING is not possible", 0);
return;
}
if ((intern->u.caching.flags & CIT_TOSTRING_USE_INNER) != 0 && (flags & CIT_TOSTRING_USE_INNER) == 0) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Unsetting flag TOSTRING_USE_INNER is not possible", 0);
return;
}
if ((flags & CIT_FULL_CACHE) != 0 && (intern->u.caching.flags & CIT_FULL_CACHE) == 0) {
@@ -3011,7 +3011,7 @@ SPL_METHOD(CachingIterator, count)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%v does not use a full cache (see CachingIterator::__construct)", Z_OBJCE_P(getThis())->name->val);
return;
}
@@ -3161,7 +3161,7 @@ SPL_METHOD(NoRewindIterator, valid)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator TSRMLS_CC) == SUCCESS);
+ RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator) == SUCCESS);
} /* }}} */
/* {{{ proto mixed NoRewindIterator::key()
@@ -3177,7 +3177,7 @@ SPL_METHOD(NoRewindIterator, key)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
if (intern->inner.iterator->funcs->get_current_key) {
- intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value TSRMLS_CC);
+ intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value);
} else {
RETURN_NULL();
}
@@ -3195,7 +3195,7 @@ SPL_METHOD(NoRewindIterator, current)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator TSRMLS_CC);
+ data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator);
if (data) {
RETURN_ZVAL(data, 1, 0);
}
@@ -3212,7 +3212,7 @@ SPL_METHOD(NoRewindIterator, next)
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- intern->inner.iterator->funcs->move_forward(intern->inner.iterator TSRMLS_CC);
+ intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
} /* }}} */
ZEND_BEGIN_ARG_INFO(arginfo_norewind_it___construct, 0)
@@ -3249,13 +3249,13 @@ SPL_METHOD(InfiniteIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_dual_it_next(intern, 1 TSRMLS_CC);
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_next(intern, 1);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
} else {
- spl_dual_it_rewind(intern TSRMLS_CC);
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_rewind(intern);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_fetch(intern, 0);
}
}
} /* }}} */
@@ -3292,7 +3292,7 @@ SPL_METHOD(EmptyIterator, key)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the key of an EmptyIterator", 0);
} /* }}} */
/* {{{ proto void EmptyIterator::current()
@@ -3302,7 +3302,7 @@ SPL_METHOD(EmptyIterator, current)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_BadMethodCallException, "Accessing the value of an EmptyIterator", 0);
} /* }}} */
/* {{{ proto void EmptyIterator::next()
@@ -3323,50 +3323,50 @@ static const zend_function_entry spl_funcs_EmptyIterator[] = {
PHP_FE_END
};
-int spl_append_it_next_iterator(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+int spl_append_it_next_iterator(spl_dual_it_object *intern) /* {{{*/
{
- spl_dual_it_free(intern TSRMLS_CC);
+ spl_dual_it_free(intern);
if (!Z_ISUNDEF(intern->inner.zobject)) {
zval_ptr_dtor(&intern->inner.zobject);
ZVAL_UNDEF(&intern->inner.zobject);
intern->inner.ce = NULL;
if (intern->inner.iterator) {
- zend_iterator_dtor(intern->inner.iterator TSRMLS_CC);
+ zend_iterator_dtor(intern->inner.iterator);
intern->inner.iterator = NULL;
}
}
- if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) == SUCCESS) {
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) == SUCCESS) {
zval *it;
- it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator TSRMLS_CC);
+ it = intern->u.append.iterator->funcs->get_current_data(intern->u.append.iterator);
ZVAL_COPY(&intern->inner.zobject, it);
intern->inner.ce = Z_OBJCE_P(it);
- intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0 TSRMLS_CC);
- spl_dual_it_rewind(intern TSRMLS_CC);
+ intern->inner.iterator = intern->inner.ce->get_iterator(intern->inner.ce, it, 0);
+ spl_dual_it_rewind(intern);
return SUCCESS;
} else {
return FAILURE;
}
} /* }}} */
-void spl_append_it_fetch(spl_dual_it_object *intern TSRMLS_DC) /* {{{*/
+void spl_append_it_fetch(spl_dual_it_object *intern) /* {{{*/
{
- while (spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
- intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator TSRMLS_CC);
- if (spl_append_it_next_iterator(intern TSRMLS_CC) != SUCCESS) {
+ while (spl_dual_it_valid(intern) != SUCCESS) {
+ intern->u.append.iterator->funcs->move_forward(intern->u.append.iterator);
+ if (spl_append_it_next_iterator(intern) != SUCCESS) {
return;
}
}
- spl_dual_it_fetch(intern, 0 TSRMLS_CC);
+ spl_dual_it_fetch(intern, 0);
} /* }}} */
-void spl_append_it_next(spl_dual_it_object *intern TSRMLS_DC) /* {{{ */
+void spl_append_it_next(spl_dual_it_object *intern) /* {{{ */
{
- if (spl_dual_it_valid(intern TSRMLS_CC) == SUCCESS) {
- spl_dual_it_next(intern, 1 TSRMLS_CC);
+ if (spl_dual_it_valid(intern) == SUCCESS) {
+ spl_dual_it_next(intern, 1);
}
- spl_append_it_fetch(intern TSRMLS_CC);
+ spl_append_it_fetch(intern);
} /* }}} */
/* {{{ proto void AppendIterator::__construct()
@@ -3385,19 +3385,19 @@ SPL_METHOD(AppendIterator, append)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "O", &it, zend_ce_iterator) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &it, zend_ce_iterator) == FAILURE) {
return;
}
- spl_array_iterator_append(&intern->u.append.zarrayit, it TSRMLS_CC);
+ spl_array_iterator_append(&intern->u.append.zarrayit, it);
- if (!intern->inner.iterator || spl_dual_it_valid(intern TSRMLS_CC) != SUCCESS) {
- if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator TSRMLS_CC) != SUCCESS) {
- intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
+ if (!intern->inner.iterator || spl_dual_it_valid(intern) != SUCCESS) {
+ if (intern->u.append.iterator->funcs->valid(intern->u.append.iterator) != SUCCESS) {
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator);
}
do {
- spl_append_it_next_iterator(intern TSRMLS_CC);
+ spl_append_it_next_iterator(intern);
} while (Z_OBJ(intern->inner.zobject) != Z_OBJ_P(it));
- spl_append_it_fetch(intern TSRMLS_CC);
+ spl_append_it_fetch(intern);
}
} /* }}} */
@@ -3413,9 +3413,9 @@ SPL_METHOD(AppendIterator, rewind)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- intern->u.append.iterator->funcs->rewind(intern->u.append.iterator TSRMLS_CC);
- if (spl_append_it_next_iterator(intern TSRMLS_CC) == SUCCESS) {
- spl_append_it_fetch(intern TSRMLS_CC);
+ intern->u.append.iterator->funcs->rewind(intern->u.append.iterator);
+ if (spl_append_it_next_iterator(intern) == SUCCESS) {
+ spl_append_it_fetch(intern);
}
} /* }}} */
@@ -3446,7 +3446,7 @@ SPL_METHOD(AppendIterator, next)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
- spl_append_it_next(intern TSRMLS_CC);
+ spl_append_it_next(intern);
} /* }}} */
/* {{{ proto int AppendIterator::getIteratorIndex()
@@ -3462,7 +3462,7 @@ SPL_METHOD(AppendIterator, getIteratorIndex)
SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
APPENDIT_CHECK_CTOR(intern);
- spl_array_iterator_key(&intern->u.append.zarrayit, return_value TSRMLS_CC);
+ spl_array_iterator_key(&intern->u.append.zarrayit, return_value);
} /* }}} */
/* {{{ proto ArrayIterator AppendIterator::getArrayIterator()
@@ -3498,12 +3498,12 @@ static const zend_function_entry spl_funcs_AppendIterator[] = {
PHP_FE_END
};
-PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC)
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser)
{
zend_object_iterator *iter;
zend_class_entry *ce = Z_OBJCE_P(obj);
- iter = ce->get_iterator(ce, obj, 0 TSRMLS_CC);
+ iter = ce->get_iterator(ce, obj, 0);
if (EG(exception)) {
goto done;
@@ -3511,21 +3511,21 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
iter->index = 0;
if (iter->funcs->rewind) {
- iter->funcs->rewind(iter TSRMLS_CC);
+ iter->funcs->rewind(iter);
if (EG(exception)) {
goto done;
}
}
- while (iter->funcs->valid(iter TSRMLS_CC) == SUCCESS) {
+ while (iter->funcs->valid(iter) == SUCCESS) {
if (EG(exception)) {
goto done;
}
- if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) {
+ if (apply_func(iter, puser) == ZEND_HASH_APPLY_STOP || EG(exception)) {
goto done;
}
iter->index++;
- iter->funcs->move_forward(iter TSRMLS_CC);
+ iter->funcs->move_forward(iter);
if (EG(exception)) {
goto done;
}
@@ -3533,17 +3533,17 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
done:
if (iter) {
- zend_iterator_dtor(iter TSRMLS_CC);
+ zend_iterator_dtor(iter);
}
return EG(exception) ? FAILURE : SUCCESS;
}
/* }}} */
-static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *data, *return_value = (zval*)puser;
- data = iter->funcs->get_current_data(iter TSRMLS_CC);
+ data = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
@@ -3552,11 +3552,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
}
if (iter->funcs->get_current_key) {
zval key;
- iter->funcs->get_current_key(iter, &key TSRMLS_CC);
+ iter->funcs->get_current_key(iter, &key);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- array_set_zval_key(Z_ARRVAL_P(return_value), &key, data TSRMLS_CC);
+ array_set_zval_key(Z_ARRVAL_P(return_value), &key, data);
zval_dtor(&key);
} else {
Z_TRY_ADDREF_P(data);
@@ -3566,11 +3566,11 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
}
/* }}} */
-static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_to_values_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval *data, *return_value = (zval*)puser;
- data = iter->funcs->get_current_data(iter TSRMLS_CC);
+ data = iter->funcs->get_current_data(iter);
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
@@ -3592,19 +3592,19 @@ PHP_FUNCTION(iterator_to_array)
zval *obj;
zend_bool use_keys = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &obj, zend_ce_traversable, &use_keys) == FAILURE) {
RETURN_FALSE;
}
array_init(return_value);
- if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value TSRMLS_CC) != SUCCESS) {
+ if (spl_iterator_apply(obj, use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply, (void*)return_value) != SUCCESS) {
zval_dtor(return_value);
RETURN_NULL();
}
} /* }}} */
-static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
(*(zend_long*)puser)++;
return ZEND_HASH_APPLY_KEEP;
@@ -3618,11 +3618,11 @@ PHP_FUNCTION(iterator_count)
zval *obj;
zend_long count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, zend_ce_traversable) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, zend_ce_traversable) == FAILURE) {
RETURN_FALSE;
}
- if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count TSRMLS_CC) == SUCCESS) {
+ if (spl_iterator_apply(obj, spl_iterator_count_apply, (void*)&count) == SUCCESS) {
RETURN_LONG(count);
}
}
@@ -3636,16 +3636,16 @@ typedef struct {
zend_fcall_info_cache fcc;
} spl_iterator_apply_info;
-static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
+static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser) /* {{{ */
{
zval retval;
spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser;
int result;
apply_info->count++;
- zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC);
+ zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL);
if (Z_TYPE(retval) != IS_UNDEF) {
- result = zend_is_true(&retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ result = zend_is_true(&retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
zval_ptr_dtor(&retval);
} else {
result = ZEND_HASH_APPLY_STOP;
@@ -3661,18 +3661,18 @@ PHP_FUNCTION(iterator_apply)
spl_iterator_apply_info apply_info;
apply_info.args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Of|a!", &apply_info.obj, zend_ce_traversable, &apply_info.fci, &apply_info.fcc, &apply_info.args) == FAILURE) {
return;
}
apply_info.count = 0;
- zend_fcall_info_args(&apply_info.fci, apply_info.args TSRMLS_CC);
- if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info TSRMLS_CC) == SUCCESS) {
+ zend_fcall_info_args(&apply_info.fci, apply_info.args);
+ if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)&apply_info) == SUCCESS) {
RETVAL_LONG(apply_info.count);
} else {
RETVAL_FALSE;
}
- zend_fcall_info_args(&apply_info.fci, NULL TSRMLS_CC);
+ zend_fcall_info_args(&apply_info.fci, NULL);
}
/* }}} */
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index 76f0b45e57..a0a2893ef5 100644
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -173,9 +173,9 @@ static inline spl_dual_it_object *spl_dual_it_from_obj(zend_object *obj) /* {{{
#define Z_SPLDUAL_IT_P(zv) spl_dual_it_from_obj(Z_OBJ_P((zv)))
-typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser TSRMLS_DC);
+typedef int (*spl_iterator_apply_func_t)(zend_object_iterator *iter, void *puser);
-PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC);
+PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser);
#endif /* SPL_ITERATORS_H */
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index f7f884df18..4b63caaed0 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -102,11 +102,11 @@ static inline spl_SplObjectStorage *spl_object_storage_from_obj(zend_object *obj
#define Z_SPLOBJSTORAGE_P(zv) spl_object_storage_from_obj(Z_OBJ_P((zv)))
-void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+void spl_SplObjectStorage_free_storage(zend_object *object) /* {{{ */
{
spl_SplObjectStorage *intern = spl_object_storage_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zend_hash_destroy(&intern->storage);
@@ -116,7 +116,7 @@ void spl_SplObjectStorage_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
} /* }}} */
-static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) {
+static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj) {
if (intern->fptr_get_hash) {
zval rv;
zend_call_method_with_1_params(this, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj);
@@ -124,7 +124,7 @@ static zend_string *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zv
if (Z_TYPE(rv) == IS_STRING) {
return Z_STR(rv);
} else {
- zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Hash needs to be a string", 0);
zval_ptr_dtor(&rv);
return NULL;
@@ -190,21 +190,21 @@ static void spl_object_storage_dtor(zval *element) /* {{{ */
efree(el);
} /* }}} */
-spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash TSRMLS_DC) /* {{{ */
+spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, zend_string *hash) /* {{{ */
{
return (spl_SplObjectStorageElement*)zend_hash_find_ptr(&intern->storage, hash);
} /* }}} */
-spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf TSRMLS_DC) /* {{{ */
+spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf) /* {{{ */
{
spl_SplObjectStorageElement *pelement, element;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return NULL;
}
- pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
+ pelement = spl_object_storage_get(intern, hash);
if (pelement) {
zval_ptr_dtor(&pelement->inf);
@@ -228,10 +228,10 @@ spl_SplObjectStorageElement *spl_object_storage_attach(spl_SplObjectStorage *int
return pelement;
} /* }}} */
-int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */
+int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
{
int ret = FAILURE;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return ret;
}
@@ -241,17 +241,17 @@ int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *ob
return ret;
} /* }}}*/
-void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other TSRMLS_DC) { /* {{{ */
+void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *other) { /* {{{ */
spl_SplObjectStorageElement *element;
ZEND_HASH_FOREACH_PTR(&other->storage, element) {
- spl_object_storage_attach(intern, this, &element->obj, &element->inf TSRMLS_CC);
+ spl_object_storage_attach(intern, this, &element->obj, &element->inf);
} ZEND_HASH_FOREACH_END();
intern->index = 0;
} /* }}} */
-static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig TSRMLS_DC) /* {{{ */
+static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval *orig) /* {{{ */
{
spl_SplObjectStorage *intern;
zend_class_entry *parent = class_type;
@@ -260,7 +260,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
memset(intern, 0, sizeof(spl_SplObjectStorage) - sizeof(zval));
intern->pos = INVALID_IDX;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
zend_hash_init(&intern->storage, 0, NULL, spl_object_storage_dtor, 0);
@@ -269,7 +269,7 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
if (orig) {
spl_SplObjectStorage *other = Z_SPLOBJSTORAGE_P(orig);
- spl_object_storage_addall(intern, orig, other TSRMLS_CC);
+ spl_object_storage_addall(intern, orig, other);
}
while (parent) {
@@ -291,21 +291,21 @@ static zend_object *spl_object_storage_new_ex(zend_class_entry *class_type, zval
/* }}} */
/* {{{ spl_object_storage_clone */
-static zend_object *spl_object_storage_clone(zval *zobject TSRMLS_DC)
+static zend_object *spl_object_storage_clone(zval *zobject)
{
zend_object *old_object;
zend_object *new_object;
old_object = Z_OBJ_P(zobject);
- new_object = spl_object_storage_new_ex(old_object->ce, zobject TSRMLS_CC);
+ new_object = spl_object_storage_new_ex(old_object->ce, zobject);
- zend_objects_clone_members(new_object, old_object TSRMLS_CC);
+ zend_objects_clone_members(new_object, old_object);
return new_object;
}
/* }}} */
-static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* {{{ */
+static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp) /* {{{ */
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj);
spl_SplObjectStorageElement *element;
@@ -330,7 +330,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
array_init(&storage);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
- md5str = php_spl_object_hash(&element->obj TSRMLS_CC);
+ md5str = php_spl_object_hash(&element->obj);
array_init(&tmp);
/* Incrementing the refcount of obj and inf would confuse the garbage collector.
* Prefer to null the destructor */
@@ -341,7 +341,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
zend_string_release(md5str);
} ZEND_HASH_FOREACH_END();
- zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1 TSRMLS_CC);
+ zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1);
zend_symtable_update(intern->debug_info, zname, &storage);
zend_string_release(zname);
}
@@ -352,14 +352,14 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp TSRMLS_D
/* overriden for garbage collection
* This is very hacky */
-static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRMLS_DC) /* {{{ */
+static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n) /* {{{ */
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(obj);
spl_SplObjectStorageElement *element;
HashTable *props;
zval *gcdata_arr, tmp;
- props = std_object_handlers.get_properties(obj TSRMLS_CC);
+ props = std_object_handlers.get_properties(obj);
*table = NULL;
*n = 0;
@@ -388,13 +388,13 @@ static HashTable *spl_object_storage_get_gc(zval *obj, zval **table, int *n TSRM
}
/* }}} */
-static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{ */
+static int spl_object_storage_compare_info(zval *e1, zval *e2) /* {{{ */
{
spl_SplObjectStorageElement *s1 = (spl_SplObjectStorageElement*)Z_PTR_P(e1);
spl_SplObjectStorageElement *s2 = (spl_SplObjectStorageElement*)Z_PTR_P(e2);
zval result;
- if (compare_function(&result, &s1->inf, &s2->inf TSRMLS_CC) == FAILURE) {
+ if (compare_function(&result, &s1->inf, &s2->inf) == FAILURE) {
return 1;
}
@@ -402,7 +402,7 @@ static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{
}
/* }}} */
-static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+static int spl_object_storage_compare_objects(zval *o1, zval *o2) /* {{{ */
{
zend_object *zo1 = (zend_object *)Z_OBJ_P(o1);
zend_object *zo2 = (zend_object *)Z_OBJ_P(o2);
@@ -411,21 +411,21 @@ static int spl_object_storage_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {
return 1;
}
- return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0 TSRMLS_CC);
+ return zend_hash_compare(&(Z_SPLOBJSTORAGE_P(o1))->storage, &(Z_SPLOBJSTORAGE_P(o2))->storage, (compare_func_t)spl_object_storage_compare_info, 0);
}
/* }}} */
/* {{{ spl_array_object_new */
-static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *spl_SplObjectStorage_new(zend_class_entry *class_type)
{
- return spl_object_storage_new_ex(class_type, NULL TSRMLS_CC);
+ return spl_object_storage_new_ex(class_type, NULL);
}
/* }}} */
-int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{ */
+int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj) /* {{{ */
{
int found;
- zend_string *hash = spl_object_storage_get_hash(intern, this, obj TSRMLS_CC);
+ zend_string *hash = spl_object_storage_get_hash(intern, this, obj);
if (!hash) {
return 0;
}
@@ -443,10 +443,10 @@ SPL_METHOD(SplObjectStorage, attach)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|z!", &obj, &inf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|z!", &obj, &inf) == FAILURE) {
return;
}
- spl_object_storage_attach(intern, getThis(), obj, inf TSRMLS_CC);
+ spl_object_storage_attach(intern, getThis(), obj, inf);
} /* }}} */
/* {{{ proto void SplObjectStorage::detach($obj)
@@ -456,10 +456,10 @@ SPL_METHOD(SplObjectStorage, detach)
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- spl_object_storage_detach(intern, getThis(), obj TSRMLS_CC);
+ spl_object_storage_detach(intern, getThis(), obj);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
@@ -471,11 +471,11 @@ SPL_METHOD(SplObjectStorage, getHash)
{
zval *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_NEW_STR(php_spl_object_hash(obj TSRMLS_CC));
+ RETURN_NEW_STR(php_spl_object_hash(obj));
} /* }}} */
@@ -488,20 +488,20 @@ SPL_METHOD(SplObjectStorage, offsetGet)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zend_string *hash;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- hash = spl_object_storage_get_hash(intern, getThis(), obj TSRMLS_CC);
+ hash = spl_object_storage_get_hash(intern, getThis(), obj);
if (!hash) {
return;
}
- element = spl_object_storage_get(intern, hash TSRMLS_CC);
+ element = spl_object_storage_get(intern, hash);
spl_object_storage_free_hash(intern, hash);
if (!element) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Object not found");
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Object not found");
} else {
RETURN_ZVAL(&element->inf, 1, 0);
}
@@ -515,13 +515,13 @@ SPL_METHOD(SplObjectStorage, addAll)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
spl_SplObjectStorage *other;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
other = Z_SPLOBJSTORAGE_P(obj);
- spl_object_storage_addall(intern, getThis(), other TSRMLS_CC);
+ spl_object_storage_addall(intern, getThis(), other);
RETURN_LONG(zend_hash_num_elements(&intern->storage));
} /* }}} */
@@ -535,7 +535,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
@@ -543,7 +543,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
zend_hash_internal_pointer_reset(&other->storage);
while ((element = zend_hash_get_current_data_ptr(&other->storage)) != NULL) {
- if (spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC) == FAILURE) {
+ if (spl_object_storage_detach(intern, getThis(), &element->obj) == FAILURE) {
zend_hash_move_forward(&other->storage);
}
}
@@ -563,15 +563,15 @@ SPL_METHOD(SplObjectStorage, removeAllExcept)
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
return;
}
other = Z_SPLOBJSTORAGE_P(obj);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
- if (!spl_object_storage_contains(other, getThis(), &element->obj TSRMLS_CC)) {
- spl_object_storage_detach(intern, getThis(), &element->obj TSRMLS_CC);
+ if (!spl_object_storage_contains(other, getThis(), &element->obj)) {
+ spl_object_storage_detach(intern, getThis(), &element->obj);
}
} ZEND_HASH_FOREACH_END();
@@ -589,10 +589,10 @@ SPL_METHOD(SplObjectStorage, contains)
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &obj) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
- RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj TSRMLS_CC));
+ RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj));
} /* }}} */
/* {{{ proto int SplObjectStorage::count()
@@ -602,7 +602,7 @@ SPL_METHOD(SplObjectStorage, count)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zend_long mode = COUNT_NORMAL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
return;
}
@@ -611,7 +611,7 @@ SPL_METHOD(SplObjectStorage, count)
zval *element;
ZEND_HASH_FOREACH_VAL(&intern->storage, element) {
- ret += php_count_recursive(element, mode TSRMLS_CC);
+ ret += php_count_recursive(element, mode);
} ZEND_HASH_FOREACH_END();
RETURN_LONG(ret);
@@ -703,7 +703,7 @@ SPL_METHOD(SplObjectStorage, setInfo)
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis());
zval *inf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &inf) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &inf) == FAILURE) {
return;
}
@@ -749,7 +749,7 @@ SPL_METHOD(SplObjectStorage, serialize)
/* storage */
smart_str_appendl(&buf, "x:", 2);
ZVAL_LONG(&flags, zend_hash_num_elements(&intern->storage));
- php_var_serialize(&buf, &flags, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &flags, &var_hash);
zval_ptr_dtor(&flags);
zend_hash_internal_pointer_reset_ex(&intern->storage, &pos);
@@ -760,9 +760,9 @@ SPL_METHOD(SplObjectStorage, serialize)
PHP_VAR_SERIALIZE_DESTROY(var_hash);
RETURN_NULL();
}
- php_var_serialize(&buf, &element->obj, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &element->obj, &var_hash);
smart_str_appendc(&buf, ',');
- php_var_serialize(&buf, &element->inf, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, &element->inf, &var_hash);
smart_str_appendc(&buf, ';');
zend_hash_move_forward_ex(&intern->storage, &pos);
}
@@ -770,8 +770,8 @@ SPL_METHOD(SplObjectStorage, serialize)
/* members */
smart_str_appendl(&buf, "m:", 2);
ZVAL_NEW_ARR(&members);
- zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis() TSRMLS_CC));
- php_var_serialize(&buf, &members, &var_hash TSRMLS_CC); /* finishes the string */
+ zend_array_dup(Z_ARRVAL(members), zend_std_get_properties(getThis()));
+ php_var_serialize(&buf, &members, &var_hash); /* finishes the string */
zval_ptr_dtor(&members);
/* done */
@@ -799,7 +799,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
spl_SplObjectStorageElement *element;
zend_long count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buf, &buf_len) == FAILURE) {
return;
}
@@ -816,7 +816,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
}
++p;
- if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&pcount, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
if (Z_TYPE(pcount) != IS_LONG) {
@@ -839,7 +839,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
goto outexcept;
}
/* sore reference to allow cross-references between different elements */
- if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
if (Z_TYPE(entry) != IS_OBJECT) {
@@ -848,19 +848,19 @@ SPL_METHOD(SplObjectStorage, unserialize)
}
if (*p == ',') { /* new version has inf */
++p;
- if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&inf, &p, s + buf_len, &var_hash)) {
zval_ptr_dtor(&entry);
goto outexcept;
}
}
- hash = spl_object_storage_get_hash(intern, getThis(), &entry TSRMLS_CC);
+ hash = spl_object_storage_get_hash(intern, getThis(), &entry);
if (!hash) {
zval_ptr_dtor(&entry);
zval_ptr_dtor(&inf);
goto outexcept;
}
- pelement = spl_object_storage_get(intern, hash TSRMLS_CC);
+ pelement = spl_object_storage_get(intern, hash);
spl_object_storage_free_hash(intern, hash);
if (pelement) {
if (!Z_ISUNDEF(pelement->inf)) {
@@ -870,7 +870,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
var_push_dtor(&var_hash, &pelement->obj);
}
}
- element = spl_object_storage_attach(intern, getThis(), &entry, &inf TSRMLS_CC);
+ element = spl_object_storage_attach(intern, getThis(), &entry, &inf);
var_replace(&var_hash, &entry, &element->obj);
var_replace(&var_hash, &inf, &element->inf);
zval_ptr_dtor(&entry);
@@ -889,7 +889,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
++p;
ZVAL_UNDEF(&pmembers);
- if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash TSRMLS_CC) || Z_TYPE(pmembers) != IS_ARRAY) {
+ if (!php_var_unserialize(&pmembers, &p, s + buf_len, &var_hash) || Z_TYPE(pmembers) != IS_ARRAY) {
zval_ptr_dtor(&pmembers);
goto outexcept;
}
@@ -906,7 +906,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
outexcept:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */
@@ -986,16 +986,16 @@ SPL_METHOD(MultipleIterator, __construct)
zend_long flags = MIT_NEED_ALL|MIT_KEYS_NUMERIC;
zend_error_handling error_handling;
- zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
intern = Z_SPLOBJSTORAGE_P(getThis());
intern->flags = flags;
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
}
/* }}} */
@@ -1019,7 +1019,7 @@ SPL_METHOD(MultipleIterator, setFlags)
spl_SplObjectStorage *intern;
intern = Z_SPLOBJSTORAGE_P(getThis());
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
}
}
@@ -1032,7 +1032,7 @@ SPL_METHOD(MultipleIterator, attachIterator)
spl_SplObjectStorage *intern;
zval *iterator = NULL, *info = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|z!", &iterator, zend_ce_iterator, &info) == FAILURE) {
return;
}
@@ -1043,22 +1043,22 @@ SPL_METHOD(MultipleIterator, attachIterator)
zval compare_result;
if (Z_TYPE_P(info) != IS_LONG && Z_TYPE_P(info) != IS_STRING) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Info must be NULL, integer or string", 0);
return;
}
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
while ((element = zend_hash_get_current_data_ptr_ex(&intern->storage, &intern->pos)) != NULL) {
- is_identical_function(&compare_result, info, &element->inf TSRMLS_CC);
+ is_identical_function(&compare_result, info, &element->inf);
if (Z_TYPE(compare_result) == IS_TRUE) {
- zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Key duplication error", 0);
return;
}
zend_hash_move_forward_ex(&intern->storage, &intern->pos);
}
}
- spl_object_storage_attach(intern, getThis(), iterator, info TSRMLS_CC);
+ spl_object_storage_attach(intern, getThis(), iterator, info);
}
/* }}} */
@@ -1152,7 +1152,7 @@ SPL_METHOD(MultipleIterator, valid)
}
/* }}} */
-static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value TSRMLS_DC) /* {{{ */
+static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_value) /* {{{ */
{
spl_SplObjectStorageElement *element;
zval *it, retval;
@@ -1184,14 +1184,14 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_
zend_call_method_with_0_params(it, Z_OBJCE_P(it), &Z_OBJCE_P(it)->iterator_funcs.zf_key, "key", &retval);
}
if (Z_ISUNDEF(retval)) {
- zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Failed to call sub iterator method", 0);
return;
}
} else if (intern->flags & MIT_NEED_ALL) {
if (SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT == get_type) {
- zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Called current() with non valid sub iterator", 0);
} else {
- zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_RuntimeException, "Called key() with non valid sub iterator", 0);
}
return;
} else {
@@ -1208,7 +1208,7 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_
break;
default:
zval_ptr_dtor(&retval);
- zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0 TSRMLS_CC);
+ zend_throw_exception(spl_ce_InvalidArgumentException, "Sub-Iterator is associated with NULL", 0);
return;
}
} else {
@@ -1231,7 +1231,7 @@ SPL_METHOD(MultipleIterator, current)
return;
}
- spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value TSRMLS_CC);
+ spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value);
}
/* }}} */
@@ -1246,7 +1246,7 @@ SPL_METHOD(MultipleIterator, key)
return;
}
- spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value TSRMLS_CC);
+ spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value);
}
/* }}} */
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index a98b303547..ef823d9feb 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -48,16 +48,15 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
{
va_list arg;
char *message;
- TSRMLS_FETCH();
va_start(arg, format);
vspprintf(&message, 0, format, arg);
va_end(arg);
if (db_obj && db_obj->exception) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), message, 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), message, 0);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
+ php_error_docref(NULL, E_WARNING, "%s", message);
}
if (message) {
@@ -74,7 +73,7 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
#define SQLITE3_CHECK_INITIALIZED_STMT(member, class_name) \
if (!(member)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialised"); \
+ php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialised"); \
RETURN_FALSE; \
}
@@ -107,38 +106,38 @@ PHP_METHOD(sqlite3, open)
zend_error_handling error_handling;
db_obj = Z_SQLITE3_DB_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "p|ls", &filename, &filename_len, &flags, &encryption_key, &encryption_key_len)) {
+ zend_restore_error_handling(&error_handling);
return;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (db_obj->initialised) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "Already initialised DB Object", 0);
}
if (strlen(filename) != filename_len) {
return;
}
if (memcmp(filename, ":memory:", sizeof(":memory:")) != 0) {
- if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) {
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC);
+ if (!(fullpath = expand_filepath(filename, NULL))) {
+ zend_throw_exception(zend_exception_get_default(), "Unable to expand filepath", 0);
return;
}
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "safe_mode prohibits opening %s", fullpath);
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "safe_mode prohibits opening %s", fullpath);
efree(fullpath);
return;
}
#endif
- if (php_check_open_basedir(fullpath TSRMLS_CC)) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "open_basedir prohibits opening %s", fullpath);
+ if (php_check_open_basedir(fullpath)) {
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "open_basedir prohibits opening %s", fullpath);
efree(fullpath);
return;
}
@@ -151,7 +150,7 @@ PHP_METHOD(sqlite3, open)
#else
if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) {
#endif
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
if (fullpath) {
efree(fullpath);
}
@@ -161,7 +160,7 @@ PHP_METHOD(sqlite3, open)
#if SQLITE_HAS_CODEC
if (encryption_key_len > 0) {
if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) {
- zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
+ zend_throw_exception_ex(zend_exception_get_default(), 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db));
return;
}
}
@@ -224,7 +223,7 @@ PHP_METHOD(sqlite3, exec)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -321,7 +320,7 @@ PHP_METHOD(sqlite3, busyTimeout)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ms)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ms)) {
return;
}
@@ -350,7 +349,7 @@ PHP_METHOD(sqlite3, loadExtension)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension, &extension_len)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &extension, &extension_len)) {
return;
}
@@ -435,7 +434,7 @@ PHP_METHOD(sqlite3, escapeString)
zend_string *sql;
char *ret;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -466,7 +465,7 @@ PHP_METHOD(sqlite3, prepare)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -512,7 +511,7 @@ PHP_METHOD(sqlite3, query)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &sql)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S", &sql)) {
return;
}
@@ -618,7 +617,7 @@ PHP_METHOD(sqlite3, querySingle)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &sql, &entire_row)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &sql, &entire_row)) {
return;
}
@@ -676,7 +675,7 @@ PHP_METHOD(sqlite3, querySingle)
}
/* }}} */
-static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, sqlite3_value **argv, sqlite3_context *context, int is_agg TSRMLS_DC) /* {{{ */
+static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, sqlite3_value **argv, sqlite3_context *context, int is_agg) /* {{{ */
{
zval *zargs = NULL;
zval retval;
@@ -744,8 +743,8 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
fc->fci.params = zargs;
- if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
+ if ((ret = zend_call_function(&fc->fci, &fc->fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the callback");
}
/* clean up the params */
@@ -812,9 +811,8 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
static void php_sqlite3_callback_func(sqlite3_context *context, int argc, sqlite3_value **argv) /* {{{ */
{
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
- TSRMLS_FETCH();
- sqlite3_do_callback(&func->afunc, &func->func, argc, argv, context, 0 TSRMLS_CC);
+ sqlite3_do_callback(&func->afunc, &func->func, argc, argv, context, 0);
}
/* }}}*/
@@ -823,10 +821,9 @@ static void php_sqlite3_callback_step(sqlite3_context *context, int argc, sqlite
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
- TSRMLS_FETCH();
agg_context->row_count++;
- sqlite3_do_callback(&func->astep, &func->step, argc, argv, context, 1 TSRMLS_CC);
+ sqlite3_do_callback(&func->astep, &func->step, argc, argv, context, 1);
}
/* }}} */
@@ -835,10 +832,9 @@ static void php_sqlite3_callback_final(sqlite3_context *context) /* {{{ */
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
- TSRMLS_FETCH();
agg_context->row_count = 0;
- sqlite3_do_callback(&func->afini, &func->fini, 0, NULL, context, 1 TSRMLS_CC);
+ sqlite3_do_callback(&func->afini, &func->fini, 0, NULL, context, 1);
}
/* }}} */
@@ -849,7 +845,6 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
zval retval;
int ret;
- TSRMLS_FETCH();
collation->fci.fci.size = (sizeof(collation->fci.fci));
collation->fci.fci.function_table = EG(function_table);
@@ -865,8 +860,8 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
collation->fci.fci.params = zargs;
- if ((ret = zend_call_function(&collation->fci.fci, &collation->fci.fcc TSRMLS_CC)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the compare callback");
+ if ((ret = zend_call_function(&collation->fci.fci, &collation->fci.fcc)) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the compare callback");
}
zval_ptr_dtor(&zargs[0]);
@@ -877,7 +872,7 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
// (the result of a comparison, i.e. most likely -1, 0, or 1)
//I suppose we could accept any scalar return type, though.
if (Z_TYPE(retval) != IS_LONG){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the compare callback (invalid return type). Collation behaviour is undefined.");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the compare callback (invalid return type). Collation behaviour is undefined.");
}else{
ret = Z_LVAL(retval);
}
@@ -904,7 +899,7 @@ PHP_METHOD(sqlite3, createFunction)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &sql_func, &sql_func_len, &callback_func, &sql_func_num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|l", &sql_func, &sql_func_len, &callback_func, &sql_func_num_args) == FAILURE) {
return;
}
@@ -912,7 +907,7 @@ PHP_METHOD(sqlite3, createFunction)
RETURN_FALSE;
}
- if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(callback_func, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -954,7 +949,7 @@ PHP_METHOD(sqlite3, createAggregate)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l", &sql_func, &sql_func_len, &step_callback, &fini_callback, &sql_func_num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l", &sql_func, &sql_func_len, &step_callback, &fini_callback, &sql_func_num_args) == FAILURE) {
return;
}
@@ -962,14 +957,14 @@ PHP_METHOD(sqlite3, createAggregate)
RETURN_FALSE;
}
- if (!zend_is_callable(step_callback, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(step_callback, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
}
zend_string_release(callback_name);
- if (!zend_is_callable(fini_callback, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(fini_callback, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -1011,7 +1006,7 @@ PHP_METHOD(sqlite3, createCollation)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &collation_name, &collation_name_len, &callback_func) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz", &collation_name, &collation_name_len, &callback_func) == FAILURE) {
RETURN_FALSE;
}
@@ -1019,7 +1014,7 @@ PHP_METHOD(sqlite3, createCollation)
RETURN_FALSE;
}
- if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(callback_func, 0, &callback_name)) {
php_sqlite3_error(db_obj, "Not a valid callback function %s", callback_name->val);
zend_string_release(callback_name);
RETURN_FALSE;
@@ -1049,14 +1044,14 @@ typedef struct {
size_t size;
} php_stream_sqlite3_data;
-static size_t php_sqlite3_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_sqlite3_stream_write(php_stream *stream, const char *buf, size_t count)
{
/* php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract; */
return 0;
}
-static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t count)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1073,7 +1068,7 @@ static size_t php_sqlite3_stream_read(php_stream *stream, char *buf, size_t coun
return count;
}
-static int php_sqlite3_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_sqlite3_stream_close(php_stream *stream, int close_handle)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1086,14 +1081,14 @@ static int php_sqlite3_stream_close(php_stream *stream, int close_handle TSRMLS_
return 0;
}
-static int php_sqlite3_stream_flush(php_stream *stream TSRMLS_DC)
+static int php_sqlite3_stream_flush(php_stream *stream)
{
/* do nothing */
return 0;
}
/* {{{ */
-static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
@@ -1156,12 +1151,12 @@ static int php_sqlite3_stream_seek(php_stream *stream, zend_off_t offset, int wh
/* }}} */
-static int php_sqlite3_stream_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_sqlite3_stream_cast(php_stream *stream, int castas, void **ret)
{
return FAILURE;
}
-static int php_sqlite3_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_sqlite3_stream_stat(php_stream *stream, php_stream_statbuf *ssb)
{
php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream->abstract;
ssb->sb.st_size = sqlite3_stream->size;
@@ -1196,7 +1191,7 @@ PHP_METHOD(sqlite3, openBlob)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl|s", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssl|s", &table, &table_len, &column, &column_len, &rowid, &dbname, &dbname_len) == FAILURE) {
return;
}
@@ -1230,7 +1225,7 @@ PHP_METHOD(sqlite3, enableExceptions)
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &enableExceptions) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &enableExceptions) == FAILURE) {
return;
}
@@ -1346,7 +1341,7 @@ PHP_METHOD(sqlite3stmt, readOnly)
}
/* }}} */
-static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *param, php_sqlite3_stmt *stmt TSRMLS_DC) /* {{{ */
+static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *param, php_sqlite3_stmt *stmt) /* {{{ */
{
HashTable *hash;
hash = stmt->bound_params;
@@ -1404,8 +1399,8 @@ PHP_METHOD(sqlite3stmt, bindParam)
param.param_number = -1;
param.type = SQLITE3_TEXT;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "lz|l", &param.param_number, &parameter, &param.type) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &param.name, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz|l", &param.param_number, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &param.name, &parameter, &param.type) == FAILURE) {
return;
}
}
@@ -1414,7 +1409,7 @@ PHP_METHOD(sqlite3stmt, bindParam)
ZVAL_COPY(&param.parameter, parameter);
- if (!register_bound_parameter_to_sqlite(&param, stmt_obj TSRMLS_CC)) {
+ if (!register_bound_parameter_to_sqlite(&param, stmt_obj)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1438,8 +1433,8 @@ PHP_METHOD(sqlite3stmt, bindValue)
param.param_number = -1;
param.type = SQLITE3_TEXT;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "lz/|l", &param.param_number, &parameter, &param.type) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz/|l", &param.name, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz/|l", &param.param_number, &parameter, &param.type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz/|l", &param.name, &parameter, &param.type) == FAILURE) {
return;
}
}
@@ -1448,7 +1443,7 @@ PHP_METHOD(sqlite3stmt, bindValue)
ZVAL_COPY(&param.parameter, parameter);
- if (!register_bound_parameter_to_sqlite(&param, stmt_obj TSRMLS_CC)) {
+ if (!register_bound_parameter_to_sqlite(&param, stmt_obj)) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
ZVAL_UNDEF(&param.parameter);
@@ -1592,10 +1587,10 @@ PHP_METHOD(sqlite3stmt, __construct)
php_sqlite3_free_list *free_item;
stmt_obj = Z_SQLITE3_STMT_P(object);
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
+ zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OS", &db_zval, php_sqlite3_sc_entry, &sql) == FAILURE) {
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS", &db_zval, php_sqlite3_sc_entry, &sql) == FAILURE) {
+ zend_restore_error_handling(&error_handling);
return;
}
@@ -1603,7 +1598,7 @@ PHP_METHOD(sqlite3stmt, __construct)
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
- zend_restore_error_handling(&error_handling TSRMLS_CC);
+ zend_restore_error_handling(&error_handling);
if (!sql->len) {
RETURN_FALSE;
@@ -1659,7 +1654,7 @@ PHP_METHOD(sqlite3result, columnName)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &column) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &column) == FAILURE) {
return;
}
column_name = (char*) sqlite3_column_name(result_obj->stmt_obj->stmt, column);
@@ -1683,7 +1678,7 @@ PHP_METHOD(sqlite3result, columnType)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &column) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &column) == FAILURE) {
return;
}
@@ -1707,7 +1702,7 @@ PHP_METHOD(sqlite3result, fetchArray)
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
return;
}
@@ -1806,7 +1801,7 @@ PHP_METHOD(sqlite3result, finalize)
__constructor for SQLite3Result. */
PHP_METHOD(sqlite3result, __construct)
{
- zend_throw_exception(zend_exception_get_default(TSRMLS_C), "SQLite3Result cannot be directly instantiated", 0 TSRMLS_CC);
+ zend_throw_exception(zend_exception_get_default(), "SQLite3Result cannot be directly instantiated", 0);
}
/* }}} */
@@ -1966,15 +1961,14 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
case SQLITE_ATTACH:
{
if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
- TSRMLS_FETCH();
-
+
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return SQLITE_DENY;
}
#endif
- if (php_check_open_basedir(arg3 TSRMLS_CC)) {
+ if (php_check_open_basedir(arg3)) {
return SQLITE_DENY;
}
}
@@ -2014,7 +2008,7 @@ static int php_sqlite3_compare_stmt_free( php_sqlite3_free_list **free_list, sql
}
/* }}} */
-static void php_sqlite3_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_db_object *intern = php_sqlite3_db_from_obj(object);
php_sqlite3_func *func;
@@ -2063,11 +2057,11 @@ static void php_sqlite3_object_free_storage(zend_object *object TSRMLS_DC) /* {{
intern->initialised = 0;
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static void php_sqlite3_stmt_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_stmt_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_stmt *intern = php_sqlite3_stmt_from_obj(object);
@@ -2090,11 +2084,11 @@ static void php_sqlite3_stmt_object_free_storage(zend_object *object TSRMLS_DC)
zval_ptr_dtor(&intern->db_obj_zval);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static void php_sqlite3_result_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_sqlite3_result_object_free_storage(zend_object *object) /* {{{ */
{
php_sqlite3_result *intern = php_sqlite3_result_from_obj(object);
@@ -2110,11 +2104,11 @@ static void php_sqlite3_result_object_free_storage(zend_object *object TSRMLS_DC
zval_ptr_dtor(&intern->stmt_obj_zval);
}
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
}
/* }}} */
-static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_db_object *intern;
@@ -2124,7 +2118,7 @@ static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_D
/* Need to keep track of things to free */
zend_llist_init(&(intern->free_list), sizeof(php_sqlite3_free_list *), (llist_dtor_func_t)php_sqlite3_free_list_dtor, 0);
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_object_handlers;
@@ -2133,14 +2127,14 @@ static zend_object *php_sqlite3_object_new(zend_class_entry *class_type TSRMLS_D
}
/* }}} */
-static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_stmt *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_sqlite3_stmt) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_stmt_object_handlers;
@@ -2149,14 +2143,14 @@ static zend_object *php_sqlite3_stmt_object_new(zend_class_entry *class_type TSR
}
/* }}} */
-static zend_object *php_sqlite3_result_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_sqlite3_result_object_new(zend_class_entry *class_type) /* {{{ */
{
php_sqlite3_result *intern;
/* Allocate memory for it */
intern = ecalloc(1, sizeof(php_sqlite3_result) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &sqlite3_result_object_handlers;
@@ -2190,7 +2184,7 @@ PHP_MINIT_FUNCTION(sqlite3)
#if defined(ZTS)
/* Refuse to load if this wasn't a threasafe library loaded */
if (!sqlite3_threadsafe()) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A thread safe version of SQLite is required when using a thread safe version of PHP.");
+ php_error_docref(NULL, E_WARNING, "A thread safe version of SQLite is required when using a thread safe version of PHP.");
return FAILURE;
}
#endif
@@ -2205,7 +2199,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_object_handlers.offset = XtOffsetOf(php_sqlite3_db_object, zo);
sqlite3_object_handlers.clone_obj = NULL;
sqlite3_object_handlers.free_obj = php_sqlite3_object_free_storage;
- php_sqlite3_sc_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_sc_entry = zend_register_internal_class(&ce);
/* Register SQLite 3 Prepared Statement Class */
INIT_CLASS_ENTRY(ce, "SQLite3Stmt", php_sqlite3_stmt_class_methods);
@@ -2213,7 +2207,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_stmt_object_handlers.offset = XtOffsetOf(php_sqlite3_stmt, zo);
sqlite3_stmt_object_handlers.clone_obj = NULL;
sqlite3_stmt_object_handlers.free_obj = php_sqlite3_stmt_object_free_storage;
- php_sqlite3_stmt_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_stmt_entry = zend_register_internal_class(&ce);
/* Register SQLite 3 Result Class */
INIT_CLASS_ENTRY(ce, "SQLite3Result", php_sqlite3_result_class_methods);
@@ -2221,7 +2215,7 @@ PHP_MINIT_FUNCTION(sqlite3)
sqlite3_result_object_handlers.offset = XtOffsetOf(php_sqlite3_result, zo);
sqlite3_result_object_handlers.clone_obj = NULL;
sqlite3_result_object_handlers.free_obj = php_sqlite3_result_object_free_storage;
- php_sqlite3_result_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ php_sqlite3_result_entry = zend_register_internal_class(&ce);
REGISTER_INI_ENTRIES();
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 1f03e5acb8..998b568846 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -141,7 +141,7 @@ PHP_MSHUTDOWN_FUNCTION(array) /* {{{ */
}
/* }}} */
-static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */
+static void php_set_compare_func(zend_long sort_type) /* {{{ */
{
switch (sort_type & ~PHP_SORT_FLAG_CASE) {
case PHP_SORT_NUMERIC:
@@ -170,7 +170,7 @@ static void php_set_compare_func(zend_long sort_type TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -193,7 +193,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
ZVAL_STR(&second, s->key);
}
- if (ARRAYG(compare_func)(&result, &first, &second TSRMLS_CC) == FAILURE) {
+ if (ARRAYG(compare_func)(&result, &first, &second) == FAILURE) {
return 0;
}
@@ -207,9 +207,9 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
}
/* }}} */
-static int php_array_reverse_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_reverse_key_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_key_compare(a, b TSRMLS_CC) * -1;
+ return php_array_key_compare(a, b) * -1;
}
/* }}} */
@@ -220,13 +220,13 @@ PHP_FUNCTION(krsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -240,27 +240,27 @@ PHP_FUNCTION(ksort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* {{{ */
+PHPAPI zend_long php_count_recursive(zval *array, zend_long mode) /* {{{ */
{
zend_long cnt = 0;
zval *element;
if (Z_TYPE_P(array) == IS_ARRAY) {
if (Z_ARRVAL_P(array)->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
@@ -271,7 +271,7 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC) /* {
}
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC);
+ cnt += php_count_recursive(element, COUNT_RECURSIVE);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(array))) {
Z_ARRVAL_P(array)->u.v.nApplyCount--;
@@ -293,7 +293,7 @@ PHP_FUNCTION(count)
zval *element;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &array, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &array, &mode) == FAILURE) {
return;
}
#else
@@ -313,7 +313,7 @@ PHP_FUNCTION(count)
if (mode == COUNT_RECURSIVE) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE TSRMLS_CC);
+ cnt += php_count_recursive(element, COUNT_RECURSIVE);
} ZEND_HASH_FOREACH_END();
}
RETURN_LONG(cnt);
@@ -325,13 +325,13 @@ PHP_FUNCTION(count)
/* first, we check if the handler is defined */
if (Z_OBJ_HT_P(array)->count_elements) {
RETVAL_LONG(1);
- if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value) TSRMLS_CC)) {
+ if (SUCCESS == Z_OBJ_HT(*array)->count_elements(array, &Z_LVAL_P(return_value))) {
return;
}
}
#ifdef HAVE_SPL
/* if not and the object implements Countable we call its count() method */
- if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable)) {
zend_call_method_with_0_params(array, NULL, NULL, "count", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
RETVAL_LONG(zval_get_long(&retval));
@@ -354,7 +354,7 @@ PHP_FUNCTION(count)
*
* This is not correct any more, depends on what compare_func is set to.
*/
-static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_data_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -374,7 +374,7 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{
if (Z_TYPE_P(second) == IS_INDIRECT) {
second = Z_INDIRECT_P(second);
}
- if (ARRAYG(compare_func)(&result, first, second TSRMLS_CC) == FAILURE) {
+ if (ARRAYG(compare_func)(&result, first, second) == FAILURE) {
return 0;
}
@@ -388,13 +388,13 @@ static int php_array_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{
}
/* }}} */
-static int php_array_reverse_data_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_reverse_data_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_data_compare(a, b TSRMLS_CC) * -1;
+ return php_array_data_compare(a, b) * -1;
}
/* }}} */
-static int php_array_natural_general_compare(const void *a, const void *b, int fold_case TSRMLS_DC) /* {{{ */
+static int php_array_natural_general_compare(const void *a, const void *b, int fold_case) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -409,15 +409,15 @@ static int php_array_natural_general_compare(const void *a, const void *b, int f
}
/* }}} */
-static int php_array_natural_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_natural_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_natural_general_compare(a, b, 0 TSRMLS_CC);
+ return php_array_natural_general_compare(a, b, 0);
}
/* }}} */
-static int php_array_natural_case_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_natural_case_compare(const void *a, const void *b) /* {{{ */
{
- return php_array_natural_general_compare(a, b, 1 TSRMLS_CC);
+ return php_array_natural_general_compare(a, b, 1);
}
/* }}} */
@@ -425,16 +425,16 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) /* {{{ */
{
zval *array;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) {
return;
}
if (fold_case) {
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0) == FAILURE) {
return;
}
} else {
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0) == FAILURE) {
return;
}
}
@@ -466,13 +466,13 @@ PHP_FUNCTION(asort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -486,13 +486,13 @@ PHP_FUNCTION(arsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -506,13 +506,13 @@ PHP_FUNCTION(sort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -526,20 +526,20 @@ PHP_FUNCTION(rsort)
zval *array;
zend_long sort_type = PHP_SORT_REGULAR;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
RETURN_FALSE;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1) == FAILURE) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
-static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_user_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -556,7 +556,7 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{
BG(user_compare_fci).params = args;
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zend_long ret = zval_get_long(&retval);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&args[1]);
@@ -572,8 +572,8 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{
/* check if comparison function is valid */
#define PHP_ARRAY_CMP_FUNC_CHECK(func_name) \
- if (!zend_is_callable(*func_name, 0, NULL TSRMLS_CC)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function"); \
+ if (!zend_is_callable(*func_name, 0, NULL)) { \
+ php_error_docref(NULL, E_WARNING, "Invalid comparison function"); \
BG(user_compare_fci) = old_user_compare_fci; \
BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
RETURN_FALSE; \
@@ -610,7 +610,7 @@ PHP_FUNCTION(usort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -625,11 +625,11 @@ PHP_FUNCTION(usort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -655,7 +655,7 @@ PHP_FUNCTION(uasort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -670,11 +670,11 @@ PHP_FUNCTION(uasort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -689,7 +689,7 @@ PHP_FUNCTION(uasort)
}
/* }}} */
-static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_array_user_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f;
Bucket *s;
@@ -718,7 +718,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /*
BG(user_compare_fci).params = args;
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
result = zval_get_long(&retval);
zval_ptr_dtor(&retval);
} else {
@@ -743,7 +743,7 @@ PHP_FUNCTION(uksort)
PHP_ARRAY_CMP_FUNC_BACKUP();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/f", &array, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
PHP_ARRAY_CMP_FUNC_RESTORE();
return;
}
@@ -758,11 +758,11 @@ PHP_FUNCTION(uksort)
refcount = Z_REFCOUNT_P(array);
arr = Z_COUNTED_P(array);
- if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0) == FAILURE) {
RETVAL_FALSE;
} else {
if (refcount > Z_REFCOUNT_P(array)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function");
+ php_error_docref(NULL, E_WARNING, "Array was modified by the user comparison function");
if (--GC_REFCOUNT(arr) <= 0) {
_zval_dtor_func(arr ZEND_FILE_LINE_CC);
}
@@ -785,7 +785,7 @@ PHP_FUNCTION(end)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -818,7 +818,7 @@ PHP_FUNCTION(prev)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -851,7 +851,7 @@ PHP_FUNCTION(next)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -884,7 +884,7 @@ PHP_FUNCTION(reset)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -917,7 +917,7 @@ PHP_FUNCTION(current)
zval *entry;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -945,7 +945,7 @@ PHP_FUNCTION(key)
HashTable *array;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
return;
}
#else
@@ -965,24 +965,24 @@ PHP_FUNCTION(min)
int argc;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
- php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_REGULAR);
/* mixed min ( array $values ) */
if (argc == 1) {
zval *result;
if (Z_TYPE(args[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array");
+ php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array");
RETVAL_NULL();
} else {
- if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0 TSRMLS_CC)) != NULL) {
+ if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) {
RETVAL_ZVAL_FAST(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
+ php_error_docref(NULL, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
}
}
@@ -994,7 +994,7 @@ PHP_FUNCTION(min)
min = &args[0];
for (i = 1; i < argc; i++) {
- is_smaller_function(&result, &args[i], min TSRMLS_CC);
+ is_smaller_function(&result, &args[i], min);
if (Z_TYPE(result) == IS_TRUE) {
min = &args[i];
}
@@ -1012,24 +1012,24 @@ PHP_FUNCTION(max)
zval *args = NULL;
int argc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
- php_set_compare_func(PHP_SORT_REGULAR TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_REGULAR);
/* mixed max ( array $values ) */
if (argc == 1) {
zval *result;
if (Z_TYPE(args[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When only one parameter is given, it must be an array");
+ php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array");
RETVAL_NULL();
} else {
- if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1 TSRMLS_CC)) != NULL) {
+ if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) {
RETVAL_ZVAL_FAST(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain at least one element");
+ php_error_docref(NULL, E_WARNING, "Array must contain at least one element");
RETVAL_FALSE;
}
}
@@ -1041,7 +1041,7 @@ PHP_FUNCTION(max)
max = &args[0];
for (i = 1; i < argc; i++) {
- is_smaller_or_equal_function(&result, &args[i], max TSRMLS_CC);
+ is_smaller_or_equal_function(&result, &args[i], max);
if (Z_TYPE(result) == IS_FALSE) {
max = &args[i];
}
@@ -1052,7 +1052,7 @@ PHP_FUNCTION(max)
}
/* }}} */
-static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */
+static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive) /* {{{ */
{
zval args[3], /* Arguments to userland function */
retval, /* Return value - unused */
@@ -1094,7 +1094,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
thash = Z_ARRVAL_P(zv);
}
if (thash->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
if (userdata) {
zval_ptr_dtor(&args[2]);
}
@@ -1106,7 +1106,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
thash->u.v.nApplyCount++;
- php_array_walk(thash, userdata, recursive TSRMLS_CC);
+ php_array_walk(thash, userdata, recursive);
thash->u.v.nApplyCount--;
/* restore the fcall info and cache */
@@ -1121,7 +1121,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
zend_hash_get_current_key_zval(target_hash, &args[1]);
/* Call the userland function */
- if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache) TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&BG(array_walk_fci), &BG(array_walk_fci_cache)) == SUCCESS) {
if (!was_ref && Z_ISREF(args[0])) {
/* copy reference back */
zval garbage;
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(array_walk)
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
return;
@@ -1188,7 +1188,7 @@ PHP_FUNCTION(array_walk)
);
#endif
- php_array_walk(array, userdata, 0 TSRMLS_CC);
+ php_array_walk(array, userdata, 0);
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
RETURN_TRUE;
@@ -1207,13 +1207,13 @@ PHP_FUNCTION(array_walk_recursive)
orig_array_walk_fci = BG(array_walk_fci);
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
return;
}
- php_array_walk(array, userdata, 1 TSRMLS_CC);
+ php_array_walk(array, userdata, 1);
BG(array_walk_fci) = orig_array_walk_fci;
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
RETURN_TRUE;
@@ -1235,7 +1235,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
zend_bool strict = 0; /* strict comparison or not */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za|b", &value, &array, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "za|b", &value, &array, &strict) == FAILURE) {
return;
}
#else
@@ -1250,7 +1250,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
if (strict) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
ZVAL_DEREF(entry);
- is_identical_function(&res, value, entry TSRMLS_CC);
+ is_identical_function(&res, value, entry);
if (Z_TYPE(res) == IS_TRUE) {
if (behavior == 0) {
RETURN_TRUE;
@@ -1266,7 +1266,7 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) /* {{{
} ZEND_HASH_FOREACH_END();
} else {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
- if (fast_equal_check_function(&res, value, entry TSRMLS_CC)) {
+ if (fast_equal_check_function(&res, value, entry)) {
if (behavior == 0) {
RETURN_TRUE;
} else {
@@ -1338,7 +1338,7 @@ static int php_valid_var_name(char *var_name, size_t var_name_len) /* {{{ */
}
/* }}} */
-PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC) /* {{{ */
+PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore) /* {{{ */
{
ZVAL_NEW_STR(result, zend_string_alloc(Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len, 0));
memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix));
@@ -1366,7 +1366,7 @@ PHP_FUNCTION(extract)
int extract_refs = 0;
zend_array *symbol_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array, &extract_type, &prefix) == FAILURE) {
return;
}
@@ -1377,24 +1377,24 @@ PHP_FUNCTION(extract)
extract_type &= 0xff;
if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid extract type");
+ php_error_docref(NULL, E_WARNING, "Invalid extract type");
return;
}
if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS && ZEND_NUM_ARGS() < 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "specified extract type requires the prefix parameter");
+ php_error_docref(NULL, E_WARNING, "specified extract type requires the prefix parameter");
return;
}
if (prefix) {
convert_to_string(prefix);
if (Z_STRLEN_P(prefix) && !php_valid_var_name(Z_STRVAL_P(prefix), Z_STRLEN_P(prefix))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "prefix is not a valid identifier");
+ php_error_docref(NULL, E_WARNING, "prefix is not a valid identifier");
return;
}
}
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(var_array), num_key, var_name, entry) {
zval final_name;
@@ -1409,7 +1409,7 @@ PHP_FUNCTION(extract)
ZVAL_LONG(&num, num_key);
convert_to_string(&num);
- php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, Z_STRVAL(num), Z_STRLEN(num), 1);
zval_dtor(&num);
} else {
continue;
@@ -1433,7 +1433,7 @@ PHP_FUNCTION(extract)
case EXTR_PREFIX_IF_EXISTS:
if (var_exists) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
}
break;
@@ -1445,14 +1445,14 @@ PHP_FUNCTION(extract)
case EXTR_PREFIX_ALL:
if (Z_TYPE(final_name) == IS_NULL && var_name->len != 0) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
}
break;
case EXTR_PREFIX_INVALID:
if (Z_TYPE(final_name) == IS_NULL) {
if (!php_valid_var_name(var_name->val, var_name->len)) {
- php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1 TSRMLS_CC);
+ php_prefix_varname(&final_name, prefix, var_name->val, var_name->len, 1);
} else {
ZVAL_STR_COPY(&final_name, var_name);
}
@@ -1484,7 +1484,7 @@ PHP_FUNCTION(extract)
}
} else {
if (Z_REFCOUNTED_P(entry)) Z_ADDREF_P(entry);
- zend_set_local_var(Z_STR(final_name), entry, 1 TSRMLS_CC);
+ zend_set_local_var(Z_STR(final_name), entry, 1);
}
count++;
}
@@ -1495,7 +1495,7 @@ PHP_FUNCTION(extract)
}
/* }}} */
-static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry TSRMLS_DC) /* {{{ */
+static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_value, zval *entry) /* {{{ */
{
zval *value_ptr, data;
@@ -1507,7 +1507,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
if ((Z_ARRVAL_P(entry)->u.v.nApplyCount > 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return;
}
@@ -1515,7 +1515,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
Z_ARRVAL_P(entry)->u.v.nApplyCount++;
}
ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(entry), value_ptr) {
- php_compact_var(eg_active_symbol_table, return_value, value_ptr TSRMLS_CC);
+ php_compact_var(eg_active_symbol_table, return_value, value_ptr);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(entry))) {
Z_ARRVAL_P(entry)->u.v.nApplyCount--;
@@ -1532,11 +1532,11 @@ PHP_FUNCTION(compact)
uint32_t num_args, i;
zend_array *symbol_table;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
/* compact() is probably most used with a single array of var_names
or multiple string names, rather than a combination of both.
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(compact)
}
for (i=0; i<ZEND_NUM_ARGS(); i++) {
- php_compact_var(&symbol_table->ht, return_value, &args[i] TSRMLS_CC);
+ php_compact_var(&symbol_table->ht, return_value, &args[i]);
}
}
/* }}} */
@@ -1560,12 +1560,12 @@ PHP_FUNCTION(array_fill)
zval *val;
zend_long start_key, num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llz", &start_key, &num, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "llz", &start_key, &num, &val) == FAILURE) {
return;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements can't be negative");
+ php_error_docref(NULL, E_WARNING, "Number of elements can't be negative");
RETURN_FALSE;
}
@@ -1585,7 +1585,7 @@ PHP_FUNCTION(array_fill)
zval_add_ref(val);
} else {
zval_dtor(return_value);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied");
RETURN_FALSE;
}
}
@@ -1598,7 +1598,7 @@ PHP_FUNCTION(array_fill_keys)
{
zval *keys, *val, *entry;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "az", &keys, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "az", &keys, &val) == FAILURE) {
return;
}
@@ -1630,7 +1630,7 @@ PHP_FUNCTION(range)
int err = 0, is_step_double = 0;
double step = 1.0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &zlow, &zhigh, &zstep) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz|z", &zlow, &zhigh, &zstep) == FAILURE) {
RETURN_FALSE;
}
@@ -1778,14 +1778,14 @@ long_str:
}
err:
if (err) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "step exceeds the specified range");
+ php_error_docref(NULL, E_WARNING, "step exceeds the specified range");
zval_dtor(return_value);
RETURN_FALSE;
}
}
/* }}} */
-static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
+static void php_array_data_shuffle(zval *array) /* {{{ */
{
uint32_t idx, j, n_elems;
Bucket *p, temp;
@@ -1812,7 +1812,7 @@ static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */
}
}
while (--n_left) {
- rnd_idx = php_rand(TSRMLS_C);
+ rnd_idx = php_rand();
RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX);
if (rnd_idx != n_left) {
temp = hash->arData[n_left];
@@ -1847,11 +1847,11 @@ PHP_FUNCTION(shuffle)
{
zval *array;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &array) == FAILURE) {
RETURN_FALSE;
}
- php_array_data_shuffle(array TSRMLS_CC);
+ php_array_data_shuffle(array);
RETURN_TRUE;
}
@@ -1973,7 +1973,7 @@ PHP_FUNCTION(array_push)
argc; /* Number of function arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) {
return;
}
@@ -1983,7 +1983,7 @@ PHP_FUNCTION(array_push)
if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) {
if (Z_REFCOUNTED(new_var)) Z_DELREF(new_var);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
+ php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied");
RETURN_FALSE;
}
}
@@ -2003,7 +2003,7 @@ PHP_FUNCTION(array_pop)
Bucket *p;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
return;
}
#else
@@ -2042,7 +2042,7 @@ PHP_FUNCTION(array_pop)
/* Delete the last value */
if (p->key) {
if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(stack), p->key);
}
@@ -2064,7 +2064,7 @@ PHP_FUNCTION(array_shift)
Bucket *p;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
return;
}
#else
@@ -2099,7 +2099,7 @@ PHP_FUNCTION(array_shift)
/* Delete the first value */
if (p->key) {
if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(stack), p->key);
}
@@ -2161,7 +2161,7 @@ PHP_FUNCTION(array_unshift)
HashTable old_hash;
int argc; /* Number of function arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/+", &stack, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) {
return;
}
@@ -2196,7 +2196,7 @@ PHP_FUNCTION(array_splice)
repl_num = 0; /* Number of replacement elements */
int num_in; /* Number of elements in the input array */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/l|lz/", &array, &offset, &length, &repl_array) == FAILURE) {
return;
}
@@ -2276,7 +2276,7 @@ PHP_FUNCTION(array_slice)
zend_ulong num_key;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
return;
}
#else
@@ -2348,7 +2348,7 @@ PHP_FUNCTION(array_slice)
}
/* }}} */
-PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry, *dest_entry;
zend_string *string_key;
@@ -2366,7 +2366,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
ZVAL_DEREF(dest_zval);
thash = Z_TYPE_P(dest_zval) == IS_ARRAY ? Z_ARRVAL_P(dest_zval) : NULL;
if ((thash && thash->u.v.nApplyCount > 1) || (src_entry == dest_entry && Z_ISREF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
@@ -2397,7 +2397,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
thash->u.v.nApplyCount++;
}
- ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC);
+ ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
thash->u.v.nApplyCount--;
}
@@ -2428,7 +2428,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC)
}
/* }}} */
-PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_merge(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry;
zend_string *string_key;
@@ -2450,7 +2450,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
}
/* }}} */
-PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC) /* {{{ */
+PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ */
{
zval *src_entry, *dest_entry, *src_zval, *dest_zval;
zend_string *string_key;
@@ -2493,7 +2493,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC
if (Z_ARRVAL_P(dest_zval)->u.v.nApplyCount > 1 ||
Z_ARRVAL_P(src_zval)->u.v.nApplyCount > 1 ||
(Z_ISREF_P(src_entry) && Z_ISREF_P(dest_entry) && Z_REF_P(src_entry) == Z_REF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
SEPARATE_ZVAL(dest_zval);
@@ -2505,7 +2505,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC
Z_ARRVAL_P(src_zval)->u.v.nApplyCount++;
}
- ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval) TSRMLS_CC);
+ ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(dest_zval))) {
Z_ARRVAL_P(dest_zval)->u.v.nApplyCount--;
@@ -2530,7 +2530,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
int argc, i, init_size = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
#else
@@ -2544,7 +2544,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
ZVAL_DEREF(arg);
if (Z_TYPE_P(arg) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
} else {
int num = zend_hash_num_elements(Z_ARRVAL_P(arg));
@@ -2586,7 +2586,7 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_replace_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
} else {
for (i = 1; i < argc; i++) {
@@ -2623,13 +2623,13 @@ static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_merge_recursive(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
} else {
for (i = 1; i < argc; i++) {
arg = args + i;
ZVAL_DEREF(arg);
- php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg) TSRMLS_CC);
+ php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(arg));
}
}
}
@@ -2681,10 +2681,10 @@ PHP_FUNCTION(array_keys)
zend_bool strict = 0; /* do strict comparison */
zend_ulong num_idx;
zend_string *str_idx;
- int (*is_equal_func)(zval *, zval *, zval * TSRMLS_DC) = is_equal_function;
+ int (*is_equal_func)(zval *, zval *, zval *) = is_equal_function;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|zb", &input, &search_value, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &input, &search_value, &strict) == FAILURE) {
return;
}
#else
@@ -2711,7 +2711,7 @@ PHP_FUNCTION(array_keys)
/* Go through input array and add keys to the return array */
ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) {
if (search_value != NULL) {
- is_equal_func(&res, search_value, entry TSRMLS_CC);
+ is_equal_func(&res, search_value, entry);
add_key = zval_is_true(&res);
}
@@ -2734,7 +2734,7 @@ PHP_FUNCTION(array_values)
zval *input, /* Input array */
*entry; /* An entry in the input array */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -2758,7 +2758,7 @@ PHP_FUNCTION(array_count_values)
*tmp;
HashTable *myht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -2785,7 +2785,7 @@ PHP_FUNCTION(array_count_values)
Z_LVAL_P(tmp)++;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only count STRING and INTEGER values!");
+ php_error_docref(NULL, E_WARNING, "Can only count STRING and INTEGER values!");
}
} ZEND_HASH_FOREACH_END();
}
@@ -2796,7 +2796,7 @@ PHP_FUNCTION(array_count_values)
*/
static inline
zend_bool array_column_param_helper(zval *param,
- const char *name TSRMLS_DC) {
+ const char *name) {
switch (Z_TYPE_P(param)) {
case IS_DOUBLE:
convert_to_long_ex(param);
@@ -2811,7 +2811,7 @@ zend_bool array_column_param_helper(zval *param,
return 1;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The %s key should be either a string or an integer", name);
+ php_error_docref(NULL, E_WARNING, "The %s key should be either a string or an integer", name);
return 0;
}
}
@@ -2826,12 +2826,12 @@ PHP_FUNCTION(array_column)
zval *zcolval = NULL, *zkeyval = NULL;
HashTable *ht;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "hz!|z!", &arr_hash, &zcolumn, &zkey) == FAILURE) {
return;
}
- if ((zcolumn && !array_column_param_helper(zcolumn, "column" TSRMLS_CC)) ||
- (zkey && !array_column_param_helper(zkey, "index" TSRMLS_CC))) {
+ if ((zcolumn && !array_column_param_helper(zcolumn, "column")) ||
+ (zkey && !array_column_param_helper(zkey, "index"))) {
RETURN_FALSE;
}
@@ -2893,7 +2893,7 @@ PHP_FUNCTION(array_reverse)
zend_ulong num_key;
zend_bool preserve_keys = 0; /* whether to preserve keys */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|b", &input, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|b", &input, &preserve_keys) == FAILURE) {
return;
}
@@ -2932,7 +2932,7 @@ PHP_FUNCTION(array_pad)
int do_pad; /* Whether we should do padding at all */
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "alz", &input, &pad_size, &pad_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "alz", &input, &pad_size, &pad_value) == FAILURE) {
return;
}
@@ -2940,7 +2940,7 @@ PHP_FUNCTION(array_pad)
input_size = zend_hash_num_elements(Z_ARRVAL_P(input));
pad_size_abs = ZEND_ABS(pad_size);
if (pad_size_abs < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
+ php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2957,7 +2957,7 @@ PHP_FUNCTION(array_pad)
/* Populate the pads array */
num_pads = pad_size_abs - input_size;
if (num_pads > Z_L(1048576)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
+ php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time");
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -2992,7 +2992,7 @@ PHP_FUNCTION(array_flip)
zend_ulong num_idx;
zend_string *str_idx;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) {
return;
}
@@ -3014,7 +3014,7 @@ PHP_FUNCTION(array_flip)
}
zend_symtable_update(Z_ARRVAL_P(return_value), Z_STR_P(entry), &data);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only flip STRING and INTEGER values!");
+ php_error_docref(NULL, E_WARNING, "Can only flip STRING and INTEGER values!");
}
} ZEND_HASH_FOREACH_END();
}
@@ -3030,7 +3030,7 @@ PHP_FUNCTION(array_change_key_case)
zend_ulong num_key;
zend_long change_to_upper=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &change_to_upper) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &change_to_upper) == FAILURE) {
return;
}
@@ -3070,11 +3070,11 @@ PHP_FUNCTION(array_unique)
unsigned int i;
zend_long sort_type = PHP_SORT_STRING;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &sort_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &array, &sort_type) == FAILURE) {
return;
}
- php_set_compare_func(sort_type TSRMLS_CC);
+ php_set_compare_func(sort_type);
ZVAL_NEW_ARR(return_value);
zend_array_dup(Z_ARRVAL_P(return_value), Z_ARRVAL_P(array));
@@ -3098,12 +3098,12 @@ PHP_FUNCTION(array_unique)
i++;
}
ZVAL_UNDEF(&arTmp[i].b.val);
- zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare TSRMLS_CC);
+ zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare);
/* go through the sorted array and delete duplicates from the copy */
lastkept = arTmp;
for (cmpdata = arTmp + 1; Z_TYPE(cmpdata->b.val) != IS_UNDEF; cmpdata++) {
- if (php_array_data_compare(lastkept, cmpdata TSRMLS_CC)) {
+ if (php_array_data_compare(lastkept, cmpdata)) {
lastkept = cmpdata;
} else {
if (lastkept->i > cmpdata->i) {
@@ -3116,7 +3116,7 @@ PHP_FUNCTION(array_unique)
zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);
} else {
if (Z_ARRVAL_P(return_value) == &EG(symbol_table).ht) {
- zend_delete_global_variable(p->key TSRMLS_CC);
+ zend_delete_global_variable(p->key);
} else {
zend_hash_del(Z_ARRVAL_P(return_value), p->key);
}
@@ -3127,7 +3127,7 @@ PHP_FUNCTION(array_unique)
}
/* }}} */
-static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
+static int zval_compare(zval *a, zval *b) /* {{{ */
{
zval result;
zval *first;
@@ -3142,7 +3142,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
if (Z_TYPE_P(second) == IS_INDIRECT) {
second = Z_INDIRECT_P(second);
}
- if (string_compare_function(&result, first, second TSRMLS_CC) == FAILURE) {
+ if (string_compare_function(&result, first, second) == FAILURE) {
return 0;
}
@@ -3155,7 +3155,7 @@ static int zval_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
+static int zval_user_compare(zval *a, zval *b) /* {{{ */
{
zval args[2];
zval retval;
@@ -3175,7 +3175,7 @@ static int zval_user_compare(zval *a, zval *b TSRMLS_DC) /* {{{ */
BG(user_compare_fci).retval = &retval;
BG(user_compare_fci).no_separation = 0;
- if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache) TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zend_long ret = zval_get_long(&retval);
zval_ptr_dtor(&retval);
return ret < 0 ? -1 : ret > 0 ? 1 : 0;;
@@ -3191,7 +3191,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
Bucket *p;
int argc, i;
zval *args;
- int (*intersect_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL;
+ int (*intersect_data_compare_func)(zval *, zval *) = NULL;
zend_bool ok;
zval *val, *data;
int req_args;
@@ -3216,17 +3216,17 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
}
if (argc < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, argc);
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, argc);
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
}
}
@@ -3245,7 +3245,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
for (i = 1; i < argc; i++) {
if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) == NULL ||
(intersect_data_compare_func &&
- intersect_data_compare_func(val, data TSRMLS_CC) != 0)
+ intersect_data_compare_func(val, data) != 0)
) {
ok = 0;
break;
@@ -3262,7 +3262,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
for (i = 1; i < argc; i++) {
if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) == NULL ||
(intersect_data_compare_func &&
- intersect_data_compare_func(val, data TSRMLS_CC) != 0)
+ intersect_data_compare_func(val, data) != 0)
) {
ok = 0;
break;
@@ -3294,8 +3294,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
- int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC);
- int (*intersect_data_compare_func)(const void *, const void * TSRMLS_DC);
+ int (*intersect_key_compare_func)(const void *, const void *);
+ int (*intersect_data_compare_func)(const void *, const void *);
if (behavior == INTERSECT_NORMAL) {
intersect_key_compare_func = php_array_key_compare;
@@ -3311,16 +3311,16 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
param_spec = "+f";
intersect_data_compare_func = php_array_user_compare;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
return;
}
fci_data = &fci1;
@@ -3364,21 +3364,21 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
fci_key = &fci2;
fci_key_cache = &fci2_cache;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
+ php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
return;
}
@@ -3387,7 +3387,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
/* for each argument, create and sort list with pointers to the hash buckets */
lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
- php_set_compare_func(PHP_SORT_STRING TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_STRING);
if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
@@ -3399,7 +3399,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
for (i = 0; i < arr_argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
arr_argc = i; /* only free up to i - 1 */
goto out;
}
@@ -3421,9 +3421,9 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
}
ZVAL_UNDEF(&list->val);
if (behavior == INTERSECT_NORMAL) {
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func);
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func);
}
}
@@ -3448,11 +3448,11 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
for (i = 1; i < arr_argc; i++) {
if (behavior & INTERSECT_NORMAL) {
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
if ((!c && Z_TYPE(ptrs[i]->val) != IS_UNDEF) && (behavior == INTERSECT_ASSOC)) { /* only when INTERSECT_ASSOC */
@@ -3464,7 +3464,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
}
- if (intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC) != 0) {
+ if (intersect_data_compare_func(ptrs[0], ptrs[i]) != 0) {
c = 1;
if (key_compare_type == INTERSECT_COMP_KEY_USER) {
BG(user_compare_fci) = *fci_key;
@@ -3511,7 +3511,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
goto out;
}
if (behavior == INTERSECT_NORMAL) {
- if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)) {
+ if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i])) {
break;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
@@ -3527,7 +3527,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
goto out;
}
if (behavior == INTERSECT_NORMAL) {
- if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (intersect_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
@@ -3620,7 +3620,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
Bucket *p;
int argc, i;
zval *args;
- int (*diff_data_compare_func)(zval *, zval * TSRMLS_DC) = NULL;
+ int (*diff_data_compare_func)(zval *, zval *) = NULL;
zend_bool ok;
zval *val, *data;
@@ -3628,19 +3628,19 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
argc = ZEND_NUM_ARGS();
if (data_compare_type == DIFF_COMP_DATA_USER) {
if (argc < 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least 3 parameters are required, %d given", ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
return;
}
diff_data_compare_func = zval_user_compare;
} else {
if (argc < 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least 2 parameters are required, %d given", ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
if (data_compare_type == DIFF_COMP_DATA_INTERNAL) {
@@ -3650,7 +3650,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
RETURN_NULL();
}
}
@@ -3669,7 +3669,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 1; i < argc; i++) {
if ((data = zend_hash_index_find(Z_ARRVAL(args[i]), p->h)) != NULL &&
(!diff_data_compare_func ||
- diff_data_compare_func(val, data TSRMLS_CC) == 0)
+ diff_data_compare_func(val, data) == 0)
) {
ok = 0;
break;
@@ -3686,7 +3686,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
for (i = 1; i < argc; i++) {
if ((data = zend_hash_find(Z_ARRVAL(args[i]), p->key)) != NULL &&
(!diff_data_compare_func ||
- diff_data_compare_func(val, data TSRMLS_CC) == 0)
+ diff_data_compare_func(val, data) == 0)
) {
ok = 0;
break;
@@ -3718,8 +3718,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
- int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC);
- int (*diff_data_compare_func)(const void *, const void * TSRMLS_DC);
+ int (*diff_key_compare_func)(const void *, const void *);
+ int (*diff_data_compare_func)(const void *, const void *);
if (behavior == DIFF_NORMAL) {
diff_key_compare_func = php_array_key_compare;
@@ -3735,16 +3735,16 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
param_spec = "+f";
diff_data_compare_func = php_array_user_compare;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache) == FAILURE) {
return;
}
fci_data = &fci1;
@@ -3787,21 +3787,21 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
fci_key = &fci2;
fci_key_cache = &fci2_cache;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
+ php_error_docref(NULL, E_WARNING, "data_compare_type is %d. key_compare_type is %d. This should never happen. Please report as a bug", data_compare_type, key_compare_type);
return;
}
if (ZEND_NUM_ARGS() < req_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
+ php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS());
return;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), param_spec, &args, &arr_argc, &fci1, &fci1_cache, &fci2, &fci2_cache) == FAILURE) {
return;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
+ php_error_docref(NULL, E_WARNING, "behavior is %d. This should never happen. Please report as a bug", behavior);
return;
}
@@ -3810,7 +3810,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
/* for each argument, create and sort list with pointers to the hash buckets */
lists = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
ptrs = (Bucket **)safe_emalloc(arr_argc, sizeof(Bucket *), 0);
- php_set_compare_func(PHP_SORT_STRING TSRMLS_CC);
+ php_set_compare_func(PHP_SORT_STRING);
if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) {
BG(user_compare_fci) = *fci_data;
@@ -3822,7 +3822,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
for (i = 0; i < arr_argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1);
arr_argc = i; /* only free up to i - 1 */
goto out;
}
@@ -3844,9 +3844,9 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
}
ZVAL_UNDEF(&list->val);
if (behavior == DIFF_NORMAL) {
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func);
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
- zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func TSRMLS_CC);
+ zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func);
}
}
@@ -3872,11 +3872,11 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
for (i = 1; i < arr_argc; i++) {
Bucket *ptr = ptrs[i];
if (behavior == DIFF_NORMAL) {
- while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
+ while (Z_TYPE(ptrs[i]->val) != IS_UNDEF && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i])))) {
ptrs[i]++;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
- while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr TSRMLS_CC)))) {
+ while (Z_TYPE(ptr->val) != IS_UNDEF && (0 != (c = diff_key_compare_func(ptrs[0], ptr)))) {
ptr++;
}
}
@@ -3894,7 +3894,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
BG(user_compare_fci) = *fci_data;
BG(user_compare_fci_cache) = *fci_data_cache;
}
- if (diff_data_compare_func(ptrs[0], ptr TSRMLS_CC) != 0) {
+ if (diff_data_compare_func(ptrs[0], ptr) != 0) {
/* the data is not the same */
c = -1;
if (key_compare_type == DIFF_COMP_KEY_USER) {
@@ -3930,7 +3930,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
goto out;
}
if (behavior == DIFF_NORMAL) {
- if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
@@ -3946,7 +3946,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
goto out;
}
if (behavior == DIFF_NORMAL) {
- if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
+ if (diff_data_compare_func(ptrs[0] - 1, ptrs[0])) {
break;
}
} else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */
@@ -4037,7 +4037,7 @@ PHP_FUNCTION(array_udiff_uassoc)
#define MULTISORT_TYPE 1
#define MULTISORT_LAST 2
-PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+PHPAPI int php_multisort_compare(const void *a, const void *b) /* {{{ */
{
Bucket *ab = *(Bucket **)a;
Bucket *bb = *(Bucket **)b;
@@ -4048,9 +4048,9 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{
r = 0;
do {
- php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r] TSRMLS_CC);
+ php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r]);
- ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val TSRMLS_CC);
+ ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val);
result = ARRAYG(multisort_flags)[MULTISORT_ORDER][r] * Z_LVAL(temp);
if (result != 0) {
return result > 0 ? 1 : -1;
@@ -4086,7 +4086,7 @@ PHP_FUNCTION(array_multisort)
int sort_type = PHP_SORT_REGULAR;
int i, k, n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
@@ -4134,7 +4134,7 @@ PHP_FUNCTION(array_multisort)
sort_order = Z_LVAL(args[i]) == PHP_SORT_DESC ? -1 : 1;
parse_state[MULTISORT_ORDER] = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
MULTISORT_ABORT;
}
break;
@@ -4152,19 +4152,19 @@ PHP_FUNCTION(array_multisort)
sort_type = (int)Z_LVAL(args[i]);
parse_state[MULTISORT_TYPE] = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1);
MULTISORT_ABORT;
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is an unknown sort flag", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is an unknown sort flag", i + 1);
MULTISORT_ABORT;
break;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1);
+ php_error_docref(NULL, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1);
MULTISORT_ABORT;
}
}
@@ -4176,7 +4176,7 @@ PHP_FUNCTION(array_multisort)
array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0]));
for (i = 0; i < num_arrays; i++) {
if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != array_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array sizes are inconsistent");
+ php_error_docref(NULL, E_WARNING, "Array sizes are inconsistent");
MULTISORT_ABORT;
}
}
@@ -4212,7 +4212,7 @@ PHP_FUNCTION(array_multisort)
}
/* Do the actual sort magic - bada-bim, bada-boom. */
- zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare TSRMLS_CC);
+ zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare);
/* Restructure the arrays based on sorted indirect - this is mostly taken from zend_hash_sort() function. */
HANDLE_BLOCK_INTERRUPTIONS();
@@ -4262,7 +4262,7 @@ PHP_FUNCTION(array_rand)
zend_string *string_key;
zend_ulong num_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &input, &num_req) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|l", &input, &num_req) == FAILURE) {
return;
}
@@ -4270,7 +4270,7 @@ PHP_FUNCTION(array_rand)
if (ZEND_NUM_ARGS() > 1) {
if (num_req <= 0 || num_req > num_avail) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be between 1 and the number of elements in the array");
+ php_error_docref(NULL, E_WARNING, "Second argument has to be between 1 and the number of elements in the array");
return;
}
}
@@ -4286,7 +4286,7 @@ PHP_FUNCTION(array_rand)
break;
}
- randval = php_rand(TSRMLS_C);
+ randval = php_rand();
if ((double) (randval / (PHP_RAND_MAX + 1.0)) < (double) num_req / (double) num_avail) {
/* If we are returning a single result, just do it. */
@@ -4319,7 +4319,7 @@ PHP_FUNCTION(array_sum)
*entry,
entry_n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -4330,8 +4330,8 @@ PHP_FUNCTION(array_sum)
continue;
}
ZVAL_DUP(&entry_n, entry);
- convert_scalar_to_number(&entry_n TSRMLS_CC);
- fast_add_function(return_value, return_value, &entry_n TSRMLS_CC);
+ convert_scalar_to_number(&entry_n);
+ fast_add_function(return_value, return_value, &entry_n);
} ZEND_HASH_FOREACH_END();
}
/* }}} */
@@ -4345,7 +4345,7 @@ PHP_FUNCTION(array_product)
entry_n;
double dval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
@@ -4359,7 +4359,7 @@ PHP_FUNCTION(array_product)
continue;
}
ZVAL_DUP(&entry_n, entry);
- convert_scalar_to_number(&entry_n TSRMLS_CC);
+ convert_scalar_to_number(&entry_n);
if (Z_TYPE(entry_n) == IS_LONG && Z_TYPE_P(return_value) == IS_LONG) {
dval = (double)Z_LVAL_P(return_value) * (double)Z_LVAL(entry_n);
@@ -4389,7 +4389,7 @@ PHP_FUNCTION(array_reduce)
zval *initial = NULL;
HashTable *htbl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "af|z", &input, &fci, &fci_cache, &initial) == FAILURE) {
return;
}
@@ -4418,7 +4418,7 @@ PHP_FUNCTION(array_reduce)
ZVAL_COPY(&args[1], operand);
fci.params = args;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
zval_ptr_dtor(&args[1]);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&result);
@@ -4426,7 +4426,7 @@ PHP_FUNCTION(array_reduce)
} else {
zval_ptr_dtor(&args[1]);
zval_ptr_dtor(&args[0]);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the reduction callback");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the reduction callback");
return;
}
} ZEND_HASH_FOREACH_END();
@@ -4450,7 +4450,7 @@ PHP_FUNCTION(array_filter)
zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
zend_ulong num_key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|fl", &array, &fci, &fci_cache, &use_type) == FAILURE) {
return;
}
@@ -4490,13 +4490,13 @@ PHP_FUNCTION(array_filter)
}
fci.params = args;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS) {
zval_ptr_dtor(&args[0]);
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
if (!Z_ISUNDEF(retval)) {
- int retval_true = zend_is_true(&retval TSRMLS_CC);
+ int retval_true = zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (!retval_true) {
@@ -4510,10 +4510,10 @@ PHP_FUNCTION(array_filter)
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback");
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the filter callback");
return;
}
- } else if (!zend_is_true(operand TSRMLS_CC)) {
+ } else if (!zend_is_true(operand)) {
continue;
}
@@ -4540,7 +4540,7 @@ PHP_FUNCTION(array_map)
uint32_t k, maxlen = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
return;
}
#else
@@ -4558,7 +4558,7 @@ PHP_FUNCTION(array_map)
zval *zv, arg;
if (Z_TYPE(arrays[0]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", 2);
+ php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", 2);
return;
}
maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0]));
@@ -4579,8 +4579,8 @@ PHP_FUNCTION(array_map)
ZVAL_COPY(&arg, zv);
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback");
+ if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
zval_dtor(return_value);
zval_ptr_dtor(&arg);
RETURN_NULL();
@@ -4598,7 +4598,7 @@ PHP_FUNCTION(array_map)
for (i = 0; i < n_arrays; i++) {
if (Z_TYPE(arrays[i]) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2);
+ php_error_docref(NULL, E_WARNING, "Argument #%d should be an array", i + 2);
efree(array_pos);
return;
}
@@ -4667,8 +4667,8 @@ PHP_FUNCTION(array_map)
fci.params = params;
fci.no_separation = 0;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback");
+ if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
+ php_error_docref(NULL, E_WARNING, "An error occurred while invoking the map callback");
efree(array_pos);
zval_dtor(return_value);
for (i = 0; i < n_arrays; i++) {
@@ -4700,7 +4700,7 @@ PHP_FUNCTION(array_key_exists)
HashTable *array; /* array to check in */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zH", &key, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zH", &key, &array) == FAILURE) {
return;
}
#else
@@ -4728,7 +4728,7 @@ PHP_FUNCTION(array_key_exists)
RETURN_FALSE;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be either a string or an integer");
+ php_error_docref(NULL, E_WARNING, "The first argument should be either a string or an integer");
RETURN_FALSE;
}
}
@@ -4747,12 +4747,12 @@ PHP_FUNCTION(array_chunk)
zval chunk;
zval *entry;
- if (zend_parse_parameters(argc TSRMLS_CC, "al|b", &input, &size, &preserve_keys) == FAILURE) {
+ if (zend_parse_parameters(argc, "al|b", &input, &size, &preserve_keys) == FAILURE) {
return;
}
/* Do bounds checking for size parameter. */
if (size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size parameter expected to be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Size parameter expected to be greater than 0");
return;
}
@@ -4809,7 +4809,7 @@ PHP_FUNCTION(array_combine)
zval *entry_keys, *entry_values;
int num_keys, num_values;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &keys, &values) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &keys, &values) == FAILURE) {
return;
}
@@ -4817,7 +4817,7 @@ PHP_FUNCTION(array_combine)
num_values = zend_hash_num_elements(Z_ARRVAL_P(values));
if (num_keys != num_values) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have an equal number of elements");
+ php_error_docref(NULL, E_WARNING, "Both parameters should have an equal number of elements");
RETURN_FALSE;
}
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 9fa5a1178c..a0a8569adb 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -85,7 +85,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateBool, quiet_eval, zend_assert_globals, assert_globals)
PHP_INI_END()
-static void php_assert_init_globals(zend_assert_globals *assert_globals_p TSRMLS_DC) /* {{{ */
+static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{{ */
{
ZVAL_UNDEF(&assert_globals_p->callback);
assert_globals_p->cb = NULL;
@@ -149,7 +149,7 @@ PHP_FUNCTION(assert)
RETURN_TRUE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &assertion, &description, &description_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &assertion, &description, &description_len) == FAILURE) {
return;
}
@@ -164,13 +164,13 @@ PHP_FUNCTION(assert)
EG(error_reporting) = 0;
}
- compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
- if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
+ compiled_string_description = zend_make_compiled_string_description("assert code");
+ if (zend_eval_stringl(myeval, Z_STRLEN_P(assertion), &retval, compiled_string_description) == FAILURE) {
efree(compiled_string_description);
if (description_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
}
if (ASSERTG(bail)) {
zend_bailout();
@@ -202,8 +202,8 @@ PHP_FUNCTION(assert)
zval *args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval), 0);
zval retval;
int i;
- uint lineno = zend_get_executed_lineno(TSRMLS_C);
- const char *filename = zend_get_executed_filename(TSRMLS_C);
+ uint lineno = zend_get_executed_lineno();
+ const char *filename = zend_get_executed_filename();
ZVAL_STRING(&args[0], SAFE_STRING(filename));
ZVAL_LONG (&args[1], lineno);
@@ -213,14 +213,14 @@ PHP_FUNCTION(assert)
/* XXX do we want to check for error here? */
if (description_len == 0) {
- call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 3, args);
for (i = 0; i <= 2; i++) {
zval_ptr_dtor(&(args[i]));
}
} else {
ZVAL_STRINGL(&args[3], SAFE_STRING(description), description_len);
- call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &ASSERTG(callback), &retval, 4, args);
for (i = 0; i <= 3; i++) {
zval_ptr_dtor(&(args[i]));
}
@@ -233,15 +233,15 @@ PHP_FUNCTION(assert)
if (ASSERTG(warning)) {
if (description_len == 0) {
if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ php_error_docref(NULL, E_WARNING, "Assertion \"%s\" failed", myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ php_error_docref(NULL, E_WARNING, "Assertion failed");
}
} else {
if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval);
+ php_error_docref(NULL, E_WARNING, "%s: \"%s\" failed", description, myeval);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description);
+ php_error_docref(NULL, E_WARNING, "%s failed", description);
}
}
}
@@ -262,7 +262,7 @@ PHP_FUNCTION(assert_options)
int ac = ZEND_NUM_ARGS();
zend_string *key;
- if (zend_parse_parameters(ac TSRMLS_CC, "l|z", &what, &value) == FAILURE) {
+ if (zend_parse_parameters(ac, "l|z", &what, &value) == FAILURE) {
return;
}
@@ -272,7 +272,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.active", sizeof("assert.active")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -284,7 +284,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.bail", sizeof("assert.bail")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -296,7 +296,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.quiet_eval", sizeof("assert.quiet_eval")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -308,7 +308,7 @@ PHP_FUNCTION(assert_options)
if (ac == 2) {
zend_string *value_str = zval_get_string(value);
key = zend_string_init("assert.warning", sizeof("assert.warning")-1, 0);
- zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, value_str, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
zend_string_release(value_str);
}
@@ -332,7 +332,7 @@ PHP_FUNCTION(assert_options)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %pd", what);
+ php_error_docref(NULL, E_WARNING, "Unknown value %pd", what);
break;
}
diff --git a/ext/standard/base64.c b/ext/standard/base64.c
index fd1c910234..f3acd5b07f 100644
--- a/ext/standard/base64.c
+++ b/ext/standard/base64.c
@@ -121,7 +121,7 @@ void php_base64_init(void)
ch += 16;
}
sprintf(sp, "};");
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Reverse_table:\n%s", s);
+ php_error_docref(NULL, E_NOTICE, "Reverse_table:\n%s", s);
efree(s);
}
*/
@@ -215,7 +215,7 @@ PHP_FUNCTION(base64_encode)
size_t str_len;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
result = php_base64_encode((unsigned char*)str, str_len);
@@ -236,7 +236,7 @@ PHP_FUNCTION(base64_decode)
size_t str_len;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &strict) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &str, &str_len, &strict) == FAILURE) {
return;
}
result = php_base64_decode_ex((unsigned char*)str, str_len, strict);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 9ffe0fe14e..917a022079 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3424,7 +3424,7 @@ static void php_putenv_destructor(zval *zv) /* {{{ */
/* }}} */
#endif
-static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
+static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
{
BG(rand_is_seeded) = 0;
BG(mt_rand_is_seeded) = 0;
@@ -3450,7 +3450,7 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /*
}
/* }}} */
-static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
+static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */
{
if (BG(url_adapt_state_ex).tags) {
zend_hash_destroy(BG(url_adapt_state_ex).tags);
@@ -3532,15 +3532,15 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
#endif
#else
- basic_globals_ctor(&basic_globals TSRMLS_CC);
+ basic_globals_ctor(&basic_globals);
#ifdef PHP_WIN32
- php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
+ php_win32_core_globals_ctor(&the_php_win32_core_globals);
#endif
#endif
zend_hash_init(&basic_submodules, 0, NULL, NULL, 1);
- BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C);
+ BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class();
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
@@ -3638,14 +3638,14 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
BASIC_MINIT_SUBMODULE(user_streams)
BASIC_MINIT_SUBMODULE(imagetypes)
- php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("php", &php_stream_php_wrapper);
+ php_register_url_stream_wrapper("file", &php_plain_files_wrapper);
#ifdef HAVE_GLOB
- php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper);
#endif
- php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
- php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper);
+ php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
+ php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -3668,15 +3668,15 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
ts_free_id(php_win32_core_globals_id);
#endif
#else
- basic_globals_dtor(&basic_globals TSRMLS_CC);
+ basic_globals_dtor(&basic_globals);
#ifdef PHP_WIN32
- php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC);
+ php_win32_core_globals_dtor(&the_php_win32_core_globals);
#endif
#endif
- php_unregister_url_stream_wrapper("php" TSRMLS_CC);
- php_unregister_url_stream_wrapper("http" TSRMLS_CC);
- php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("php");
+ php_unregister_url_stream_wrapper("http");
+ php_unregister_url_stream_wrapper("ftp");
BASIC_MSHUTDOWN_SUBMODULE(browscap)
BASIC_MSHUTDOWN_SUBMODULE(array)
@@ -3814,19 +3814,19 @@ PHP_FUNCTION(constant)
zend_string *const_name;
zval *c;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &const_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &const_name) == FAILURE) {
return;
}
- c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC);
+ c = zend_get_constant_ex(const_name, NULL, ZEND_FETCH_CLASS_SILENT);
if (c) {
ZVAL_COPY_VALUE(return_value, c);
if (Z_CONSTANT_P(return_value)) {
- zval_update_constant_ex(return_value, 1, NULL TSRMLS_CC);
+ zval_update_constant_ex(return_value, 1, NULL);
}
zval_copy_ctor(return_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name->val);
+ php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", const_name->val);
RETURN_NULL();
}
}
@@ -3842,7 +3842,7 @@ PHP_NAMED_FUNCTION(php_inet_ntop)
int af = AF_INET;
char buffer[40];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3852,12 +3852,12 @@ PHP_NAMED_FUNCTION(php_inet_ntop)
} else
#endif
if (address_len != 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value");
+ php_error_docref(NULL, E_WARNING, "Invalid in_addr value");
RETURN_FALSE;
}
if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred");
+ php_error_docref(NULL, E_WARNING, "An unknown error occurred");
RETURN_FALSE;
}
@@ -3876,7 +3876,7 @@ PHP_NAMED_FUNCTION(php_inet_pton)
size_t address_len;
char buffer[17];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
RETURN_FALSE;
}
@@ -3888,14 +3888,14 @@ PHP_NAMED_FUNCTION(php_inet_pton)
} else
#endif
if (!strchr(address, '.')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address);
RETURN_FALSE;
}
ret = inet_pton(af, address, buffer);
if (ret <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
+ php_error_docref(NULL, E_WARNING, "Unrecognized address %s", address);
RETURN_FALSE;
}
@@ -3916,7 +3916,7 @@ PHP_FUNCTION(ip2long)
zend_ulong ip;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) {
return;
}
@@ -3955,7 +3955,7 @@ PHP_FUNCTION(long2ip)
char str[40];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &ip, &ip_len) == FAILURE) {
return;
}
@@ -3985,12 +3985,12 @@ PHP_FUNCTION(getenv)
char *ptr, *str;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
/* SAPI method returns an emalloc()'d string */
- ptr = sapi_getenv(str, str_len TSRMLS_CC);
+ ptr = sapi_getenv(str, str_len);
if (ptr) {
// TODO: avoid realocation ???
RETVAL_STRING(ptr);
@@ -4055,12 +4055,12 @@ PHP_FUNCTION(putenv)
int error_code;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &setting, &setting_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &setting, &setting_len) == FAILURE) {
return;
}
if(setting_len == 0 || setting[0] == '=') {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter syntax");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter syntax");
RETURN_FALSE;
}
@@ -4228,7 +4228,7 @@ PHP_FUNCTION(getopt)
int optname_len = 0;
opt_struct *opts, *orig_opts;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &options, &options_len, &p_longopts) == FAILURE) {
RETURN_FALSE;
}
@@ -4383,7 +4383,7 @@ PHP_FUNCTION(getopt)
Flush the output buffer */
PHP_FUNCTION(flush)
{
- sapi_flush(TSRMLS_C);
+ sapi_flush();
}
/* }}} */
@@ -4393,11 +4393,11 @@ PHP_FUNCTION(sleep)
{
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
RETURN_FALSE;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0");
RETURN_FALSE;
}
#ifdef PHP_SLEEP_NON_VOID
@@ -4416,11 +4416,11 @@ PHP_FUNCTION(usleep)
#if HAVE_USLEEP
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
return;
}
if (num < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
RETURN_FALSE;
}
usleep((unsigned int)num);
@@ -4436,16 +4436,16 @@ PHP_FUNCTION(time_nanosleep)
zend_long tv_sec, tv_nsec;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &tv_sec, &tv_nsec) == FAILURE) {
return;
}
if (tv_sec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds value must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0");
RETURN_FALSE;
}
if (tv_nsec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The nanoseconds value must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The nanoseconds value must be greater than 0");
RETURN_FALSE;
}
@@ -4459,7 +4459,7 @@ PHP_FUNCTION(time_nanosleep)
add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
return;
} else if (errno == EINVAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
+ php_error_docref(NULL, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
}
RETURN_FALSE;
@@ -4474,7 +4474,7 @@ PHP_FUNCTION(time_sleep_until)
struct timeval tm;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &d_ts) == FAILURE) {
return;
}
@@ -4484,7 +4484,7 @@ PHP_FUNCTION(time_sleep_until)
c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
if (c_ts < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less than current time");
+ php_error_docref(NULL, E_WARNING, "Sleep until to time is less than current time");
RETURN_FALSE;
}
@@ -4517,13 +4517,13 @@ PHP_FUNCTION(get_current_user)
return;
}
- RETURN_STRING(php_get_current_user(TSRMLS_C));
+ RETURN_STRING(php_get_current_user());
}
/* }}} */
/* {{{ add_config_entry_cb
*/
-static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+static int add_config_entry_cb(zval *entry, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *retval = (zval *)va_arg(args, zval*);
zval tmp;
@@ -4536,7 +4536,7 @@ static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
array_init(&tmp);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, add_config_entry_cb, 1, tmp);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(entry), add_config_entry_cb, 1, tmp);
zend_hash_update(Z_ARRVAL_P(retval), hash_key->key, &tmp);
}
return 0;
@@ -4551,7 +4551,7 @@ PHP_FUNCTION(get_cfg_var)
size_t varname_len;
zval *retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
return;
}
@@ -4560,7 +4560,7 @@ PHP_FUNCTION(get_cfg_var)
if (retval) {
if (Z_TYPE_P(retval) == IS_ARRAY) {
array_init(return_value);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(retval), add_config_entry_cb, 1, return_value);
return;
} else {
RETURN_STRING(Z_STRVAL_P(retval));
@@ -4577,12 +4577,12 @@ PHP_FUNCTION(set_magic_quotes_runtime)
{
zend_bool new_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &new_setting) == FAILURE) {
return;
}
if (new_setting) {
- php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore");
+ php_error_docref(NULL, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore");
}
RETURN_FALSE;
}
@@ -4633,7 +4633,7 @@ PHP_FUNCTION(error_log)
int opt_err = 0, argc = ZEND_NUM_ARGS();
zend_long erropt = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
return;
}
@@ -4641,7 +4641,7 @@ PHP_FUNCTION(error_log)
opt_err = (int)erropt;
}
- if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) {
+ if (_php_error_log_ex(opt_err, message, message_len, opt, headers) == FAILURE) {
RETURN_FALSE;
}
@@ -4650,26 +4650,26 @@ PHP_FUNCTION(error_log)
/* }}} */
/* For BC (not binary-safe!) */
-PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers) /* {{{ */
{
- return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC);
+ return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers);
}
/* }}} */
-PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */
+PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */
{
php_stream *stream = NULL;
switch (opt_err)
{
case 1: /*send an email */
- if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
+ if (!php_mail(opt, "PHP error_log message", message, headers, NULL)) {
return FAILURE;
}
break;
case 2: /*send to an address */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!");
+ php_error_docref(NULL, E_WARNING, "TCP/IP option not available!");
return FAILURE;
break;
@@ -4684,14 +4684,14 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha
case 4: /* send to SAPI */
if (sapi_module.log_message) {
- sapi_module.log_message(message TSRMLS_CC);
+ sapi_module.log_message(message);
} else {
return FAILURE;
}
break;
default:
- php_log_err(message TSRMLS_CC);
+ php_log_err(message);
break;
}
return SUCCESS;
@@ -4702,7 +4702,7 @@ PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, cha
Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
PHP_FUNCTION(error_get_last)
{
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
@@ -4726,7 +4726,7 @@ PHP_FUNCTION(call_user_func)
zend_fcall_info_cache fci_cache;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
return;
}
#else
@@ -4738,7 +4738,7 @@ PHP_FUNCTION(call_user_func)
fci.retval = &retval;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
}
@@ -4754,7 +4754,7 @@ PHP_FUNCTION(call_user_func_array)
zend_fcall_info_cache fci_cache;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, &params) == FAILURE) {
return;
}
#else
@@ -4764,10 +4764,10 @@ PHP_FUNCTION(call_user_func_array)
ZEND_PARSE_PARAMETERS_END();
#endif
- zend_fcall_info_args(&fci, params TSRMLS_CC);
+ zend_fcall_info_args(&fci, params);
fci.retval = &retval;
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
@@ -4783,7 +4783,7 @@ PHP_FUNCTION(forward_static_call)
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
return;
}
@@ -4794,11 +4794,11 @@ PHP_FUNCTION(forward_static_call)
fci.retval = &retval;
if (EX(called_scope) &&
- instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+ instanceof_function(EX(called_scope), fci_cache.calling_scope)) {
fci_cache.called_scope = EX(called_scope);
}
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
}
@@ -4812,19 +4812,19 @@ PHP_FUNCTION(forward_static_call_array)
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, &params) == FAILURE) {
return;
}
- zend_fcall_info_args(&fci, params TSRMLS_CC);
+ zend_fcall_info_args(&fci, params);
fci.retval = &retval;
if (EX(called_scope) &&
- instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+ instanceof_function(EX(called_scope), fci_cache.calling_scope)) {
fci_cache.called_scope = EX(called_scope);
}
- if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
+ if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
ZVAL_COPY_VALUE(return_value, &retval);
}
@@ -4856,13 +4856,13 @@ void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {
}
/* }}} */
-static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
+static int user_shutdown_function_call(zval *zv) /* {{{ */
{
php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
zval retval;
zend_string *function_name;
- if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
+ if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, &function_name)) {
if (function_name) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name->val);
zend_string_release(function_name);
@@ -4888,7 +4888,7 @@ static int user_shutdown_function_call(zval *zv TSRMLS_DC) /* {{{ */
}
/* }}} */
-static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) /* {{{ */
+static void user_tick_function_call(user_tick_function_entry *tick_fe) /* {{{ */
{
zval retval;
zval *function = &tick_fe->arguments[0];
@@ -4909,15 +4909,15 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
zval *obj, *method;
if (Z_TYPE_P(function) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
+ php_error_docref(NULL, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
} else if ( Z_TYPE_P(function) == IS_ARRAY
&& (obj = zend_hash_index_find(Z_ARRVAL_P(function), 0)) != NULL
&& (method = zend_hash_index_find(Z_ARRVAL_P(function), 1)) != NULL
&& Z_TYPE_P(obj) == IS_OBJECT
&& Z_TYPE_P(method) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
+ php_error_docref(NULL, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function");
+ php_error_docref(NULL, E_WARNING, "Unable to call tick function");
}
}
@@ -4928,9 +4928,8 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC)
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 TSRMLS_CC);
+ zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call);
}
/* }}} */
@@ -4939,43 +4938,42 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
zval *func1 = &tick_fe1->arguments[0];
zval *func2 = &tick_fe2->arguments[0];
int ret;
- TSRMLS_FETCH();
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
ret = (zend_binary_zval_strcmp(func1, func2) == 0);
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
zval result;
- zend_compare_arrays(&result, func1, func2 TSRMLS_CC);
+ zend_compare_arrays(&result, func1, func2);
ret = (Z_LVAL(result) == 0);
} else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
zval result;
- zend_compare_objects(&result, func1, func2 TSRMLS_CC);
+ zend_compare_objects(&result, func1, func2);
ret = (Z_LVAL(result) == 0);
} else {
ret = 0;
}
if (ret && tick_fe1->calling) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment");
+ php_error_docref(NULL, E_WARNING, "Unable to delete tick function executed at the moment");
return 0;
}
return ret;
}
/* }}} */
-PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_call_shutdown_functions(void) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
zend_try {
- zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call TSRMLS_CC);
+ zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
}
zend_end_try();
- php_free_shutdown_functions(TSRMLS_C);
+ php_free_shutdown_functions();
}
}
/* }}} */
-PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_free_shutdown_functions(void) /* {{{ */
{
if (BG(user_shutdown_function_names))
zend_try {
@@ -5012,11 +5010,11 @@ PHP_FUNCTION(register_shutdown_function)
}
/* Prevent entering of anything but valid callback (syntax check only!) */
- if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name TSRMLS_CC)) {
+ if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, &callback_name)) {
if (callback_name) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid shutdown callback '%s' passed", callback_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback passed");
+ php_error_docref(NULL, E_WARNING, "Invalid shutdown callback passed");
}
efree(shutdown_function_entry.arguments);
RETVAL_FALSE;
@@ -5037,7 +5035,7 @@ PHP_FUNCTION(register_shutdown_function)
}
/* }}} */
-PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
@@ -5048,7 +5046,7 @@ PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t fun
}
/* }}} */
-PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE;
@@ -5058,7 +5056,7 @@ PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t funct
}
/* }}} */
-PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC) /* {{{ */
+PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */
{
if (!BG(user_shutdown_function_names)) {
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
@@ -5088,32 +5086,32 @@ PHP_FUNCTION(highlight_file)
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &i) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
if (i) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
php_get_highlight_struct(&syntax_highlighter_ini);
- ret = highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC);
+ ret = highlight_file(filename, &syntax_highlighter_ini);
if (ret == FAILURE) {
if (i) {
- php_output_end(TSRMLS_C);
+ php_output_end();
}
RETURN_FALSE;
}
if (i) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5129,30 +5127,30 @@ PHP_FUNCTION(php_strip_whitespace)
zend_lex_state original_lex_state;
zend_file_handle file_handle = {{0}};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
- if (open_file_for_scanning(&file_handle TSRMLS_CC) == FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
- php_output_end(TSRMLS_C);
+ zend_save_lexical_state(&original_lex_state);
+ if (open_file_for_scanning(&file_handle) == FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
+ php_output_end();
RETURN_EMPTY_STRING();
}
- zend_strip(TSRMLS_C);
+ zend_strip();
- zend_destroy_file_handle(&file_handle TSRMLS_CC);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_destroy_file_handle(&file_handle);
+ zend_restore_lexical_state(&original_lex_state);
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
}
/* }}} */
@@ -5166,26 +5164,26 @@ PHP_FUNCTION(highlight_string)
zend_bool i = 0;
int old_error_reporting = EG(error_reporting);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &expr, &i) == FAILURE) {
RETURN_FALSE;
}
convert_to_string_ex(expr);
if (i) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
EG(error_reporting) = E_ERROR;
php_get_highlight_struct(&syntax_highlighter_ini);
- hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
+ hicompiled_string_description = zend_make_compiled_string_description("highlighted code");
- if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
+ if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description) == FAILURE) {
efree(hicompiled_string_description);
EG(error_reporting) = old_error_reporting;
if (i) {
- php_output_end(TSRMLS_C);
+ php_output_end();
}
RETURN_FALSE;
}
@@ -5194,8 +5192,8 @@ PHP_FUNCTION(highlight_string)
EG(error_reporting) = old_error_reporting;
if (i) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5209,7 +5207,7 @@ PHP_FUNCTION(ini_get)
char *varname, *str;
size_t varname_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
return;
}
@@ -5223,7 +5221,7 @@ PHP_FUNCTION(ini_get)
}
/* }}} */
-static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int php_ini_get_option(zval *zv, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
zend_ini_entry *ini_entry = Z_PTR_P(zv);
zval *ini_array = va_arg(args, zval *);
@@ -5282,22 +5280,22 @@ PHP_FUNCTION(ini_get_all)
zend_module_entry *module;
zend_bool details = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &extname, &extname_len, &details) == FAILURE) {
return;
}
- zend_ini_sort_entries(TSRMLS_C);
+ zend_ini_sort_entries();
if (extname) {
if ((module = zend_hash_str_find_ptr(&module_registry, extname, extname_len)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname);
+ php_error_docref(NULL, E_WARNING, "Unable to find extension '%s'", extname);
RETURN_FALSE;
}
extnumber = module->module_number;
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, php_ini_get_option, 2, return_value, extnumber, details);
+ zend_hash_apply_with_arguments(EG(ini_directives), php_ini_get_option, 2, return_value, extnumber, details);
}
/* }}} */
@@ -5319,7 +5317,7 @@ PHP_FUNCTION(ini_set)
zend_string *new_value;
char *old_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &varname, &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &varname, &new_value) == FAILURE) {
return;
}
@@ -5341,14 +5339,14 @@ PHP_FUNCTION(ini_set)
_CHECK_PATH(varname->val, varname->len, "mail.log") ||
_CHECK_PATH(varname->val, varname->len, "java.library.path") ||
_CHECK_PATH(varname->val, varname->len, "vpopmail.directory")) {
- if (php_check_open_basedir(new_value->val TSRMLS_CC)) {
+ if (php_check_open_basedir(new_value->val)) {
zval_dtor(return_value);
RETURN_FALSE;
}
}
}
- if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -5361,7 +5359,7 @@ PHP_FUNCTION(ini_restore)
{
zend_string *varname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &varname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &varname) == FAILURE) {
return;
}
@@ -5377,7 +5375,7 @@ PHP_FUNCTION(set_include_path)
char *old_value;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &new_value) == FAILURE) {
return;
}
@@ -5390,7 +5388,7 @@ PHP_FUNCTION(set_include_path)
}
key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
- if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
+ if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
zend_string_release(key);
zval_dtor(return_value);
RETURN_FALSE;
@@ -5405,7 +5403,7 @@ PHP_FUNCTION(get_include_path)
{
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
@@ -5425,7 +5423,7 @@ PHP_FUNCTION(restore_include_path)
{
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
return;
}
key = zend_string_init("include_path", sizeof("include_path")-1, 0);
@@ -5441,19 +5439,19 @@ PHP_FUNCTION(print_r)
zval *var;
zend_bool do_return = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &do_return) == FAILURE) {
RETURN_FALSE;
}
if (do_return) {
- php_output_start_default(TSRMLS_C);
+ php_output_start_default();
}
- zend_print_zval_r(var, 0 TSRMLS_CC);
+ zend_print_zval_r(var, 0);
if (do_return) {
- php_output_get_contents(return_value TSRMLS_CC);
- php_output_discard(TSRMLS_C);
+ php_output_get_contents(return_value);
+ php_output_discard();
} else {
RETURN_TRUE;
}
@@ -5483,7 +5481,7 @@ PHP_FUNCTION(ignore_user_abort)
zend_string *arg = NULL;
int old_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &arg) == FAILURE) {
return;
}
@@ -5491,7 +5489,7 @@ PHP_FUNCTION(ignore_user_abort)
if (arg) {
zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort"), 0);
- zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
+ zend_alter_ini_entry_ex(key, arg, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0);
zend_string_release(key);
}
@@ -5508,7 +5506,7 @@ PHP_FUNCTION(getservbyname)
size_t name_len, proto_len;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
return;
}
@@ -5542,7 +5540,7 @@ PHP_FUNCTION(getservbyport)
zend_long port;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &port, &proto, &proto_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &port, &proto, &proto_len) == FAILURE) {
return;
}
@@ -5566,7 +5564,7 @@ PHP_FUNCTION(getprotobyname)
size_t name_len;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -5589,7 +5587,7 @@ PHP_FUNCTION(getprotobynumber)
zend_long proto;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &proto) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &proto) == FAILURE) {
return;
}
@@ -5626,9 +5624,9 @@ PHP_FUNCTION(register_tick_function)
RETURN_FALSE;
}
- if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) {
+ if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name)) {
efree(tick_fe.arguments);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid tick callback '%s' passed", function_name->val);
zend_string_release(function_name);
RETURN_FALSE;
} else if (function_name) {
@@ -5644,7 +5642,7 @@ PHP_FUNCTION(register_tick_function)
zend_llist_init(BG(user_tick_functions),
sizeof(user_tick_function_entry),
(llist_dtor_func_t) user_tick_function_dtor, 0);
- php_add_tick_function(run_user_tick_functions TSRMLS_CC);
+ php_add_tick_function(run_user_tick_functions);
}
for (i = 0; i < tick_fe.arg_count; i++) {
@@ -5666,7 +5664,7 @@ PHP_FUNCTION(unregister_tick_function)
zval *function;
user_tick_function_entry tick_fe;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &function) == FAILURE) {
return;
}
@@ -5697,7 +5695,7 @@ PHP_FUNCTION(is_uploaded_file)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_len) == FAILURE) {
return;
}
@@ -5725,7 +5723,7 @@ PHP_FUNCTION(move_uploaded_file)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
return;
}
@@ -5733,7 +5731,7 @@ PHP_FUNCTION(move_uploaded_file)
RETURN_FALSE;
}
- if (php_check_open_basedir(new_path TSRMLS_CC)) {
+ if (php_check_open_basedir(new_path)) {
RETURN_FALSE;
}
@@ -5746,10 +5744,10 @@ PHP_FUNCTION(move_uploaded_file)
ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
#endif
- } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
+ } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR) == SUCCESS) {
VCWD_UNLINK(path);
successful = 1;
}
@@ -5757,7 +5755,7 @@ PHP_FUNCTION(move_uploaded_file)
if (successful) {
zend_hash_str_del(SG(rfc1867_uploaded_files), path, path_len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
+ php_error_docref(NULL, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
}
RETURN_BOOL(successful);
@@ -5766,7 +5764,7 @@ PHP_FUNCTION(move_uploaded_file)
/* {{{ php_simple_ini_parser_cb
*/
-static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
+static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
{
zval element;
@@ -5826,7 +5824,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal
/* {{{ php_ini_parser_cb_with_sections
*/
-static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
+static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
{
if (callback_type == ZEND_INI_PARSER_SECTION) {
array_init(&BG(active_ini_file_section));
@@ -5840,7 +5838,7 @@ static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3,
active_arr = arr;
}
- php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr TSRMLS_CC);
+ php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr);
}
}
/* }}} */
@@ -5856,12 +5854,12 @@ PHP_FUNCTION(parse_ini_file)
zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
RETURN_FALSE;
}
if (filename_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!");
+ php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
RETURN_FALSE;
}
@@ -5879,7 +5877,7 @@ PHP_FUNCTION(parse_ini_file)
fh.type = ZEND_HANDLE_FILENAME;
array_init(return_value);
- if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
+ if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -5896,7 +5894,7 @@ PHP_FUNCTION(parse_ini_string)
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
RETURN_FALSE;
}
@@ -5918,7 +5916,7 @@ PHP_FUNCTION(parse_ini_string)
memset(string + str_len, 0, ZEND_MMAP_AHEAD);
array_init(return_value);
- if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
+ if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
zval_dtor(return_value);
RETVAL_FALSE;
}
@@ -5934,7 +5932,7 @@ PHP_FUNCTION(config_get_hash) /* {{{ */
HashTable *hash = php_ini_get_configuration_hash();
array_init(return_value);
- zend_hash_apply_with_arguments(hash TSRMLS_CC, add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(hash, add_config_entry_cb, 1, return_value);
}
/* }}} */
#endif
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index c47ee0fb96..d6f926a90e 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -145,9 +145,9 @@ PHP_RSHUTDOWN_FUNCTION(user_filters);
PHP_RSHUTDOWN_FUNCTION(browscap);
/* Left for BC (not binary safe!) */
-PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC);
-PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers TSRMLS_DC);
-PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore TSRMLS_DC);
+PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers);
+PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers);
+PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore);
#if SIZEOF_INT == 4
/* Most 32-bit and 64-bit systems have 32-bit ints */
@@ -259,12 +259,12 @@ typedef struct _php_shutdown_function_entry {
int arg_count;
} php_shutdown_function_entry;
-PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC);
-PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC);
-PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC);
+PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry);
+PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len);
+PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry);
-PHPAPI void php_call_shutdown_functions(TSRMLS_D);
-PHPAPI void php_free_shutdown_functions(TSRMLS_D);
+PHPAPI void php_call_shutdown_functions(void);
+PHPAPI void php_free_shutdown_functions(void);
#endif /* BASIC_FUNCTIONS_H */
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 2ea837ff60..19d340a9d8 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -136,7 +136,7 @@ static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */
}
/* }}} */
-static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC) /* {{{ */
+static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg) /* {{{ */
{
browser_data *bdata = arg;
int persistent = bdata->htab->u.flags & HASH_FLAG_PERSISTENT;
@@ -219,7 +219,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
}
/* }}} */
-static int browscap_read_file(char *filename, browser_data *browdata, int persistent TSRMLS_DC) /* {{{ */
+static int browscap_read_file(char *filename, browser_data *browdata, int persistent) /* {{{ */
{
zend_file_handle fh = {{0}};
@@ -251,7 +251,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
fh.type = ZEND_HANDLE_FP;
browdata->current_section_name = NULL;
zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_RAW,
- (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata TSRMLS_CC);
+ (zend_ini_parser_cb_t) php_browscap_parser_cb, browdata);
if (browdata->current_section_name != NULL) {
pefree(browdata->current_section_name, persistent);
browdata->current_section_name = NULL;
@@ -262,7 +262,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
/* }}} */
#ifdef ZTS
-static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS_DC) /* {{{ */
+static void browscap_globals_ctor(zend_browscap_globals *browscap_globals) /* {{{ */
{
browscap_globals->activation_bdata.htab = NULL;
ZVAL_UNDEF(&browscap_globals->activation_bdata.current_section);
@@ -272,7 +272,7 @@ static void browscap_globals_ctor(zend_browscap_globals *browscap_globals TSRMLS
/* }}} */
#endif
-static void browscap_bdata_dtor(browser_data *bdata, int persistent TSRMLS_DC) /* {{{ */
+static void browscap_bdata_dtor(browser_data *bdata, int persistent) /* {{{ */
{
if (bdata->htab != NULL) {
zend_hash_destroy(bdata->htab);
@@ -294,7 +294,7 @@ PHP_INI_MH(OnChangeBrowscap)
} else if (stage == PHP_INI_STAGE_ACTIVATE) {
browser_data *bdata = &BROWSCAP_G(activation_bdata);
if (bdata->filename[0] != '\0') {
- browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
+ browscap_bdata_dtor(bdata, 0);
}
if (VCWD_REALPATH(new_value->val, bdata->filename) == NULL) {
return FAILURE;
@@ -317,7 +317,7 @@ PHP_MINIT_FUNCTION(browscap) /* {{{ */
/* ctor call not really needed for non-ZTS */
if (browscap && browscap[0]) {
- if (browscap_read_file(browscap, &global_bdata, 1 TSRMLS_CC) == FAILURE) {
+ if (browscap_read_file(browscap, &global_bdata, 1) == FAILURE) {
return FAILURE;
}
}
@@ -330,7 +330,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */
{
browser_data *bdata = &BROWSCAP_G(activation_bdata);
if (bdata->filename[0] != '\0') {
- browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
+ browscap_bdata_dtor(bdata, 0);
}
return SUCCESS;
@@ -339,13 +339,13 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */
PHP_MSHUTDOWN_FUNCTION(browscap) /* {{{ */
{
- browscap_bdata_dtor(&global_bdata, 1 TSRMLS_CC);
+ browscap_bdata_dtor(&global_bdata, 1);
return SUCCESS;
}
/* }}} */
-static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
+static int browser_reg_compare(zval *browser, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
zval *browser_regex, *previous_match;
pcre *re;
@@ -369,7 +369,7 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar
return 0;
}
- re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(Z_STR_P(browser_regex), &re_extra, &re_options);
if (re == NULL) {
return 0;
}
@@ -446,30 +446,30 @@ PHP_FUNCTION(get_browser)
if (BROWSCAP_G(activation_bdata).filename[0] != '\0') {
bdata = &BROWSCAP_G(activation_bdata);
if (bdata->htab == NULL) { /* not initialized yet */
- if (browscap_read_file(bdata->filename, bdata, 0 TSRMLS_CC) == FAILURE) {
+ if (browscap_read_file(bdata->filename, bdata, 0) == FAILURE) {
RETURN_FALSE;
}
}
} else {
if (!global_bdata.htab) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "browscap ini directive not set");
+ php_error_docref(NULL, E_WARNING, "browscap ini directive not set");
RETURN_FALSE;
}
bdata = &global_bdata;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &agent_name, &agent_name_len, &return_array) == FAILURE) {
return;
}
if (agent_name == NULL) {
zend_string *key = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(key TSRMLS_CC);
+ zend_is_auto_global(key);
zend_string_release(key);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF ||
(http_user_agent = zend_hash_str_find(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT")-1)) == NULL
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
+ php_error_docref(NULL, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
RETURN_FALSE;
}
agent_name = Z_STRVAL_P(http_user_agent);
@@ -481,7 +481,7 @@ PHP_FUNCTION(get_browser)
if ((agent = zend_hash_str_find(bdata->htab, lookup_browser_name, agent_name_len)) == NULL) {
ZVAL_UNDEF(&found_browser_entry);
- zend_hash_apply_with_arguments(bdata->htab TSRMLS_CC, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
+ zend_hash_apply_with_arguments(bdata->htab, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
if (Z_TYPE(found_browser_entry) != IS_UNDEF) {
agent = &found_browser_entry;
diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c
index a515b492b8..be49239dfa 100644
--- a/ext/standard/crc32.c
+++ b/ext/standard/crc32.c
@@ -31,7 +31,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
php_uint32 crcinit = 0;
register php_uint32 crc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &p, &nr) == FAILURE) {
return;
}
crc = crcinit^0xFFFFFFFF;
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 1aeff9e679..27cfac37a5 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -25,10 +25,10 @@
#define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors)
-PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
+PHPAPI void php_print_credits(int flag) /* {{{ */
{
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
- php_print_info_htmlhead(TSRMLS_C);
+ php_print_info_htmlhead();
}
if (!sapi_module.phpinfo_as_text) {
diff --git a/ext/standard/credits.h b/ext/standard/credits.h
index 0a501526f8..6ec57da58e 100644
--- a/ext/standard/credits.h
+++ b/ext/standard/credits.h
@@ -37,6 +37,6 @@
#endif /* HAVE_CREDITS_DEFS */
-PHPAPI void php_print_credits(int flag TSRMLS_DC);
+PHPAPI void php_print_credits(int flag);
#endif
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c
index efc4248732..439d3e0d07 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -98,7 +98,7 @@
#define PHP_STD_DES_CRYPT 1
#endif
-#define PHP_CRYPT_RAND php_rand(TSRMLS_C)
+#define PHP_CRYPT_RAND php_rand()
PHP_MINIT_FUNCTION(crypt) /* {{{ */
{
@@ -267,14 +267,14 @@ PHP_FUNCTION(crypt)
* available (passing always 2-character salt). At least for glibc6.1 */
memset(&salt[1], '$', PHP_MAX_SALT_LEN - 1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &str, &str_len, &salt_in, &salt_in_len) == FAILURE) {
return;
}
if (salt_in) {
memcpy(salt, salt_in, MIN(PHP_MAX_SALT_LEN, salt_in_len));
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.");
+ php_error_docref(NULL, E_NOTICE, "No salt parameter was specified. You must use a randomly generated salt and a strong hash function to produce a secure hash.");
}
/* The automatic salt generation covers standard DES, md5-crypt and Blowfish (simple) */
diff --git a/ext/standard/css.c b/ext/standard/css.c
index f4469bea30..1511c08145 100644
--- a/ext/standard/css.c
+++ b/ext/standard/css.c
@@ -21,7 +21,7 @@
#include "php.h"
#include "info.h"
-PHPAPI void php_info_print_css(TSRMLS_D) /* {{{ */
+PHPAPI void php_info_print_css(void) /* {{{ */
{
PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n");
PUTS("pre {margin: 0; font-family: monospace;}\n");
diff --git a/ext/standard/css.h b/ext/standard/css.h
index 408abc1787..934ae840c5 100644
--- a/ext/standard/css.h
+++ b/ext/standard/css.h
@@ -21,6 +21,6 @@
#ifndef CSS_H
#define CSS_H
-PHPAPI void php_info_print_css(TSRMLS_D);
+PHPAPI void php_info_print_css(void);
#endif
diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c
index 1718b75729..073d9d206f 100644
--- a/ext/standard/cyr_convert.c
+++ b/ext/standard/cyr_convert.c
@@ -187,7 +187,7 @@ _cyr_mac = {
};
/* }}} */
-/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to TSRMLS_DC)
+/* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to)
* This is the function that performs real in-place conversion of the string
* between charsets.
* Parameters:
@@ -201,7 +201,7 @@ _cyr_mac = {
* d - x-cp866
* m - x-mac-cyrillic
*****************************************************************************/
-static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to TSRMLS_DC)
+static char * php_convert_cyr_string(unsigned char *str, size_t length, char from, char to)
{
const unsigned char *from_table, *to_table;
unsigned char tmp;
@@ -228,7 +228,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro
case 'K':
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown source charset: %c", from);
+ php_error_docref(NULL, E_WARNING, "Unknown source charset: %c", from);
break;
}
@@ -250,7 +250,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro
case 'K':
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown destination charset: %c", to);
+ php_error_docref(NULL, E_WARNING, "Unknown destination charset: %c", to);
break;
}
@@ -274,13 +274,13 @@ PHP_FUNCTION(convert_cyr_string)
size_t input_len, fr_cs_len, to_cs_len;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &input, &input_len, &fr_cs, &fr_cs_len, &to_cs, &to_cs_len) == FAILURE) {
return;
}
str = zend_string_init(input, input_len, 0);
- php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0] TSRMLS_CC);
+ php_convert_cyr_string((unsigned char *) str->val, str->len, fr_cs[0], to_cs[0]);
RETVAL_NEW_STR(str);
}
/* }}} */
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c
index 39f8669038..091cb47ded 100644
--- a/ext/standard/datetime.c
+++ b/ext/standard/datetime.c
@@ -49,9 +49,9 @@ char *day_short_names[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-/* {{{ PHPAPI char *php_std_date(time_t t TSRMLS_DC)
+/* {{{ PHPAPI char *php_std_date(time_t t)
Return date string in standard format for http headers */
-PHPAPI char *php_std_date(time_t t TSRMLS_DC)
+PHPAPI char *php_std_date(time_t t)
{
struct tm *tm1, tmbuf;
char *str;
@@ -92,7 +92,7 @@ PHP_FUNCTION(strptime)
struct tm parsed_time;
char *unparsed_part;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ts, &ts_length, &format, &format_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &ts, &ts_length, &format, &format_length) == FAILURE) {
return;
}
diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h
index 0edaff1b00..7b8ced8e67 100644
--- a/ext/standard/datetime.h
+++ b/ext/standard/datetime.h
@@ -26,6 +26,6 @@
PHP_FUNCTION(strptime);
#endif
-PHPAPI char *php_std_date(time_t t TSRMLS_DC);
+PHPAPI char *php_std_date(time_t t);
#endif /* DATETIME_H */
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index b13f47be69..ec4e7045d7 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -75,14 +75,14 @@ static int le_dirp;
static zend_class_entry *dir_class_entry_ptr;
#define FETCH_DIRP() \
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &id) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &id) == FAILURE) { \
return; \
} \
if (ZEND_NUM_ARGS() == 0) { \
myself = getThis(); \
if (myself) { \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \
+ php_error_docref(NULL, E_WARNING, "Unable to find my handle property"); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \
@@ -90,7 +90,7 @@ static zend_class_entry *dir_class_entry_ptr;
ZEND_FETCH_RESOURCE(dirp, php_stream *, 0, (int)DIRG(default_dir)->handle, "Directory", php_file_le_stream()); \
} \
} else { \
- dirp = (php_stream *) zend_fetch_resource(id TSRMLS_CC, -1, "Directory", NULL, 1, php_file_le_stream()); \
+ dirp = (php_stream *) zend_fetch_resource(id, -1, "Directory", NULL, 1, php_file_le_stream()); \
if (!dirp) \
RETURN_FALSE; \
}
@@ -109,7 +109,7 @@ static const zend_function_entry php_dir_class_functions[] = {
};
-static void php_set_default_dir(zend_resource *res TSRMLS_DC)
+static void php_set_default_dir(zend_resource *res)
{
if (DIRG(default_dir)) {
zend_list_delete(DIRG(default_dir));
@@ -134,7 +134,7 @@ PHP_MINIT_FUNCTION(dir)
zend_class_entry dir_class_entry;
INIT_CLASS_ENTRY(dir_class_entry, "Directory", php_dir_class_functions);
- dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry TSRMLS_CC);
+ dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
#ifdef ZTS
ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
@@ -219,7 +219,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
php_stream_context *context = NULL;
php_stream *dirp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
RETURN_NULL();
}
@@ -233,7 +233,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
- php_set_default_dir(dirp->res TSRMLS_CC);
+ php_set_default_dir(dirp->res);
if (createobject) {
object_init_ex(return_value, dir_class_entry_ptr);
@@ -273,7 +273,7 @@ PHP_FUNCTION(closedir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -281,7 +281,7 @@ PHP_FUNCTION(closedir)
zend_list_close(dirp->res);
if (res == DIRG(default_dir)) {
- php_set_default_dir(NULL TSRMLS_CC);
+ php_set_default_dir(NULL);
}
}
/* }}} */
@@ -295,22 +295,22 @@ PHP_FUNCTION(chroot)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
ret = chroot(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
- php_clear_stat_cache(1, NULL, 0 TSRMLS_CC);
+ php_clear_stat_cache(1, NULL, 0);
ret = chdir("/");
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -327,17 +327,17 @@ PHP_FUNCTION(chdir)
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
- if (php_check_open_basedir(str TSRMLS_CC)) {
+ if (php_check_open_basedir(str)) {
RETURN_FALSE;
}
ret = VCWD_CHDIR(str);
if (ret != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
+ php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno);
RETURN_FALSE;
}
@@ -389,7 +389,7 @@ PHP_FUNCTION(rewinddir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -408,7 +408,7 @@ PHP_NAMED_FUNCTION(php_if_readdir)
FETCH_DIRP();
if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid Directory resource", dirp->res->handle);
RETURN_FALSE;
}
@@ -438,17 +438,17 @@ PHP_FUNCTION(glob)
int ret;
zend_bool basedir_limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
return;
}
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
if ((GLOB_AVAILABLE_FLAGS & flags) != flags) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
RETURN_FALSE;
}
@@ -500,7 +500,7 @@ no_results:
query is senseless on windows. For instance while *.txt
is a pretty valid filename on EXT3, it's invalid on NTFS. */
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(pattern, 0)) {
RETURN_FALSE;
}
}
@@ -512,7 +512,7 @@ no_results:
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
if (PG(open_basedir) && *PG(open_basedir)) {
- if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) {
+ if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0)) {
basedir_limit = 1;
continue;
}
@@ -561,12 +561,12 @@ PHP_FUNCTION(scandir)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
return;
}
if (dirn_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Directory name cannot be empty");
RETURN_FALSE;
}
@@ -582,7 +582,7 @@ PHP_FUNCTION(scandir)
n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasortr);
}
if (n < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "(errno %d): %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index a9ca94c0ad..82baa4eaa3 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -56,17 +56,17 @@ PHPAPI PHP_FUNCTION(dl)
char *filename;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
if (!PG(enable_dl)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Dynamically loaded extensions aren't enabled");
+ php_error_docref(NULL, E_WARNING, "Dynamically loaded extensions aren't enabled");
RETURN_FALSE;
}
if (filename_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "File name exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
@@ -75,14 +75,14 @@ PHPAPI PHP_FUNCTION(dl)
(strncmp(sapi_module.name, "embed", 5) != 0)
) {
#ifdef ZTS
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename);
+ php_error_docref(NULL, E_WARNING, "Not supported in multithreaded Web servers - use extension=%s in your php.ini", filename);
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename);
+ php_error_docref(NULL, E_DEPRECATED, "dl() is deprecated - use extension=%s in your php.ini", filename);
#endif
}
- php_dl(filename, MODULE_TEMPORARY, return_value, 0 TSRMLS_CC);
+ php_dl(filename, MODULE_TEMPORARY, return_value, 0);
if (Z_LVAL_P(return_value) == 1) {
EG(full_tables_cleanup) = 1;
}
@@ -99,7 +99,7 @@ PHPAPI PHP_FUNCTION(dl)
/* {{{ php_load_extension
*/
-PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
+PHPAPI int php_load_extension(char *filename, int type, int start_now)
{
void *handle;
char *libpath;
@@ -124,7 +124,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
if (strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) {
/* Passing modules with full path is not supported for dynamically loaded extensions */
if (type == MODULE_TEMPORARY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename");
+ php_error_docref(NULL, E_WARNING, "Temporary module name should contain only filename");
return FAILURE;
}
libpath = estrdup(filename);
@@ -146,13 +146,13 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
#if PHP_WIN32
char *err = GET_DL_ERROR();
if (err && (*err != '\0')) {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
LocalFree(err);
} else {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason");
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason");
}
#else
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR());
+ php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR());
GET_DL_ERROR(); /* free the buffer storing the error */
#endif
efree(libpath);
@@ -173,11 +173,11 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
if (!get_module) {
if (DL_FETCH_SYMBOL(handle, "zend_extension_entry") || DL_FETCH_SYMBOL(handle, "_zend_extension_entry")) {
DL_UNLOAD(handle);
- php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename);
+ php_error_docref(NULL, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename);
return FAILURE;
}
DL_UNLOAD(handle);
- php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s'", filename);
+ php_error_docref(NULL, error_type, "Invalid library (maybe not a PHP library) '%s'", filename);
return FAILURE;
}
module_entry = get_module();
@@ -216,7 +216,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
zend_api = module_entry->zend_api;
}
- php_error_docref(NULL TSRMLS_CC, error_type,
+ php_error_docref(NULL, error_type,
"%s: Unable to initialize module\n"
"Module compiled with module API=%d\n"
"PHP compiled with module API=%d\n"
@@ -226,7 +226,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
return FAILURE;
}
if(strcmp(module_entry->build_id, ZEND_MODULE_BUILD_ID)) {
- php_error_docref(NULL TSRMLS_CC, error_type,
+ php_error_docref(NULL, error_type,
"%s: Unable to initialize module\n"
"Module compiled with build ID=%s\n"
"PHP compiled with build ID=%s\n"
@@ -239,19 +239,19 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
module_entry->module_number = zend_next_free_module();
module_entry->handle = handle;
- if ((module_entry = zend_register_module_ex(module_entry TSRMLS_CC)) == NULL) {
+ if ((module_entry = zend_register_module_ex(module_entry)) == NULL) {
DL_UNLOAD(handle);
return FAILURE;
}
- if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry TSRMLS_CC) == FAILURE) {
+ if ((type == MODULE_TEMPORARY || start_now) && zend_startup_module_ex(module_entry) == FAILURE) {
DL_UNLOAD(handle);
return FAILURE;
}
if ((type == MODULE_TEMPORARY || start_now) && module_entry->request_startup_func) {
- if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name);
+ if (module_entry->request_startup_func(type, module_entry->module_number) == FAILURE) {
+ php_error_docref(NULL, error_type, "Unable to initialize module '%s'", module_entry->name);
DL_UNLOAD(handle);
return FAILURE;
}
@@ -262,10 +262,10 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC)
/* {{{ php_dl
*/
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now)
{
/* Load extension */
- if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) {
+ if (php_load_extension(file, type, start_now) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -280,9 +280,9 @@ PHP_MINFO_FUNCTION(dl)
#else
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC)
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file);
+ php_error_docref(NULL, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", file);
RETURN_FALSE;
}
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index 50ed19afc0..75fa0dd0f0 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -23,8 +23,8 @@
#ifndef DL_H
#define DL_H
-PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC);
-PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC);
+PHPAPI int php_load_extension(char *filename, int type, int start_now);
+PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now);
/* dynamic loading functions */
PHPAPI PHP_FUNCTION(dl);
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 37cad8bfc9..604e390ea3 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -135,7 +135,7 @@ PHP_FUNCTION(gethostname)
}
if (gethostname(buf, sizeof(buf) - 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to fetch host [%d]: %s", errno, strerror(errno));
RETURN_FALSE;
}
@@ -156,7 +156,7 @@ PHP_FUNCTION(gethostbyaddr)
size_t addr_len;
zend_string *hostname;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) {
return;
}
@@ -164,9 +164,9 @@ PHP_FUNCTION(gethostbyaddr)
if (hostname == NULL) {
#if HAVE_IPV6 && HAVE_INET_PTON
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not a valid IPv4 or IPv6 address");
+ php_error_docref(NULL, E_WARNING, "Address is not a valid IPv4 or IPv6 address");
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not in a.b.c.d form");
+ php_error_docref(NULL, E_WARNING, "Address is not in a.b.c.d form");
#endif
RETVAL_FALSE;
} else {
@@ -217,7 +217,7 @@ PHP_FUNCTION(gethostbyname)
char *hostname;
size_t hostname_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) {
return;
}
@@ -235,7 +235,7 @@ PHP_FUNCTION(gethostbynamel)
struct in_addr in;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hostname, &hostname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hostname, &hostname_len) == FAILURE) {
return;
}
@@ -356,12 +356,12 @@ PHP_FUNCTION(dns_check_record)
struct __res_state *handle = &state;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
return;
}
if (hostname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Host cannot be empty");
RETURN_FALSE;
}
@@ -379,7 +379,7 @@ PHP_FUNCTION(dns_check_record)
else if (!strcasecmp("NAPTR", rectype)) type = DNS_T_NAPTR;
else if (!strcasecmp("A6", rectype)) type = DNS_T_A6;
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype);
+ php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype);
RETURN_FALSE;
}
}
@@ -772,7 +772,7 @@ PHP_FUNCTION(dns_get_record)
int type, first_query = 1, store_results = 1;
zend_bool raw = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
return;
}
@@ -788,12 +788,12 @@ PHP_FUNCTION(dns_get_record)
if (!raw) {
if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param);
+ php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param);
RETURN_FALSE;
}
} else {
if ((type_param < 1) || (type_param > 0xFFFF)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param);
RETURN_FALSE;
}
@@ -902,15 +902,15 @@ PHP_FUNCTION(dns_get_record)
continue;
case NO_RECOVERY:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unexpected server failure occurred.");
+ php_error_docref(NULL, E_WARNING, "An unexpected server failure occurred.");
break;
case TRY_AGAIN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A temporary server error occurred.");
+ php_error_docref(NULL, E_WARNING, "A temporary server error occurred.");
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
+ php_error_docref(NULL, E_WARNING, "DNS Query failed");
}
zval_dtor(return_value);
RETURN_FALSE;
@@ -928,7 +928,7 @@ PHP_FUNCTION(dns_get_record)
while (qd-- > 0) {
n = dn_skipname(cp, end);
if (n < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse DNS data received");
+ php_error_docref(NULL, E_WARNING, "Unable to parse DNS data received");
zval_dtor(return_value);
php_dns_free_handle(handle);
RETURN_FALSE;
@@ -1000,7 +1000,7 @@ PHP_FUNCTION(dns_get_mx)
struct __res_state *handle = &state;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|z/", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
return;
}
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index a0b917c5ca..fda264a3a8 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -50,7 +50,7 @@ PHP_FUNCTION(dns_get_mx) /* {{{ */
DNS_STATUS status; /* Return value of DnsQuery_A() function */
PDNS_RECORD pResult, pRec; /* Pointer to DNS_RECORD structure */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|z", &hostname, &hostname_len, &mx_list, &weight_list) == FAILURE) {
return;
}
@@ -99,12 +99,12 @@ PHP_FUNCTION(dns_check_record)
DNS_STATUS status; /* Return value of DnsQuery_A() function */
PDNS_RECORD pResult; /* Pointer to DNS_RECORD structure */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &hostname, &hostname_len, &rectype, &rectype_len) == FAILURE) {
return;
}
if (hostname_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Host cannot be empty");
RETURN_FALSE;
}
@@ -122,7 +122,7 @@ PHP_FUNCTION(dns_check_record)
else if (!strcasecmp("NAPTR", rectype)) type = DNS_TYPE_NAPTR;
else if (!strcasecmp("A6", rectype)) type = DNS_TYPE_A6;
else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", rectype);
+ php_error_docref(NULL, E_WARNING, "Type '%s' not supported", rectype);
RETURN_FALSE;
}
}
@@ -352,7 +352,7 @@ PHP_FUNCTION(dns_get_record)
int type, type_to_fetch, first_query = 1, store_results = 1;
zend_bool raw = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz!z!b",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b",
&hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) {
return;
}
@@ -368,12 +368,12 @@ PHP_FUNCTION(dns_get_record)
if (!raw) {
if ((type_param & ~PHP_DNS_ALL) && (type_param != PHP_DNS_ANY)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%ld' not supported", type_param);
+ php_error_docref(NULL, E_WARNING, "Type '%ld' not supported", type_param);
RETURN_FALSE;
}
} else {
if ((type_param < 1) || (type_param > 0xFFFF)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Numeric DNS record type must be between 1 and 65535, '%ld' given", type_param);
RETURN_FALSE;
}
@@ -456,7 +456,7 @@ PHP_FUNCTION(dns_get_record)
if (status == DNS_INFO_NO_RECORDS || status == DNS_ERROR_RCODE_NAME_ERROR) {
continue;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "DNS Query failed");
+ php_error_docref(NULL, E_WARNING, "DNS Query failed");
zval_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index ca6942a9c9..bd65d60656 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -57,7 +57,7 @@
* If type==3, output will be printed binary, no lines will be saved or returned (passthru)
*
*/
-PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)
+PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
{
FILE *fp;
char *buf;
@@ -80,7 +80,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
fp = VCWD_POPEN(cmd, "r");
#endif
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd);
+ php_error_docref(NULL, E_WARNING, "Unable to fork [%s]", cmd);
goto err;
}
@@ -110,8 +110,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_
if (type == 1) {
PHPWRITE(buf, bufl);
- if (php_output_get_level(TSRMLS_C) < 1) {
- sapi_flush(TSRMLS_C);
+ if (php_output_get_level() < 1) {
+ sapi_flush();
}
} else if (type == 2) {
/* strip trailing whitespaces */
@@ -177,27 +177,27 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
int ret;
if (mode) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
RETURN_FALSE;
}
}
if (!cmd_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute a blank command");
+ php_error_docref(NULL, E_WARNING, "Cannot execute a blank command");
RETURN_FALSE;
}
if (!ret_array) {
- ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC);
+ ret = php_exec(mode, cmd, NULL, return_value);
} else {
if (Z_TYPE_P(ret_array) != IS_ARRAY) {
zval_dtor(ret_array);
array_init(ret_array);
}
- ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC);
+ ret = php_exec(2, cmd, ret_array, return_value);
}
if (ret_code) {
zval_dtor(ret_code);
@@ -248,7 +248,6 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
char *p = NULL;
#endif
- TSRMLS_FETCH();
cmd = zend_string_alloc(2 * l, 0);
@@ -340,7 +339,6 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
zend_string *cmd;
size_t estimate = (4 * l) + 3;
- TSRMLS_FETCH();
cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */
@@ -404,7 +402,7 @@ PHP_FUNCTION(escapeshellcmd)
char *command;
size_t command_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -423,7 +421,7 @@ PHP_FUNCTION(escapeshellarg)
char *argument;
size_t argument_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &argument, &argument_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &argument, &argument_len) == FAILURE) {
return;
}
@@ -443,7 +441,7 @@ PHP_FUNCTION(shell_exec)
zend_string *ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &command, &command_len) == FAILURE) {
return;
}
@@ -452,7 +450,7 @@ PHP_FUNCTION(shell_exec)
#else
if ((in=VCWD_POPEN(command, "r"))==NULL) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute '%s'", command);
+ php_error_docref(NULL, E_WARNING, "Unable to execute '%s'", command);
RETURN_FALSE;
}
@@ -473,14 +471,14 @@ PHP_FUNCTION(proc_nice)
{
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &pri) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pri) == FAILURE) {
RETURN_FALSE;
}
errno = 0;
php_ignore_value(nice(pri));
if (errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a super user may attempt to increase the priority of a process");
+ php_error_docref(NULL, E_WARNING, "Only a super user may attempt to increase the priority of a process");
RETURN_FALSE;
}
diff --git a/ext/standard/exec.h b/ext/standard/exec.h
index 79b0574e28..a14efe3601 100644
--- a/ext/standard/exec.h
+++ b/ext/standard/exec.h
@@ -36,6 +36,6 @@ PHP_MINIT_FUNCTION(proc_open);
PHPAPI zend_string *php_escape_shell_cmd(char *);
PHPAPI zend_string *php_escape_shell_arg(char *);
-PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC);
+PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value);
#endif /* EXEC_H */
diff --git a/ext/standard/file.c b/ext/standard/file.c
index e7d870d719..f7c6e3acb9 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -138,7 +138,7 @@ php_file_globals file_globals;
/* sharing globals is *evil* */
static int le_stream_context = FAILURE;
-PHPAPI int php_le_stream_context(TSRMLS_D)
+PHPAPI int php_le_stream_context(void)
{
return le_stream_context;
}
@@ -156,7 +156,7 @@ static ZEND_RSRC_DTOR_FUNC(file_context_dtor)
php_stream_context_free(context);
}
-static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
+static void file_globals_ctor(php_file_globals *file_globals_p)
{
FG(pclose_ret) = 0;
FG(pclose_wait) = 0;
@@ -165,7 +165,7 @@ static void file_globals_ctor(php_file_globals *file_globals_p TSRMLS_DC)
FG(wrapper_errors) = NULL;
}
-static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
+static void file_globals_dtor(php_file_globals *file_globals_p)
{
}
@@ -183,7 +183,7 @@ PHP_MINIT_FUNCTION(file)
#ifdef ZTS
ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
- file_globals_ctor(&file_globals TSRMLS_CC);
+ file_globals_ctor(&file_globals);
#endif
REGISTER_INI_ENTRIES();
@@ -327,7 +327,7 @@ PHP_MINIT_FUNCTION(file)
PHP_MSHUTDOWN_FUNCTION(file) /* {{{ */
{
#ifndef ZTS
- file_globals_dtor(&file_globals TSRMLS_CC);
+ file_globals_dtor(&file_globals);
#endif
return SUCCESS;
}
@@ -344,7 +344,7 @@ PHP_FUNCTION(flock)
php_stream *stream;
zend_long operation = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &res, &operation, &wouldblock) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z/", &res, &operation, &wouldblock) == FAILURE) {
return;
}
@@ -352,7 +352,7 @@ PHP_FUNCTION(flock)
act = operation & 3;
if (act < 1 || act > 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal operation argument");
+ php_error_docref(NULL, E_WARNING, "Illegal operation argument");
RETURN_FALSE;
}
@@ -393,7 +393,7 @@ PHP_FUNCTION(get_meta_tags)
memset(&md, 0, sizeof(md));
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &filename, &filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -408,7 +408,7 @@ PHP_FUNCTION(get_meta_tags)
tok_last = TOK_EOF;
- while (!done && (tok = php_next_meta_token(&md TSRMLS_CC)) != TOK_EOF) {
+ while (!done && (tok = php_next_meta_token(&md)) != TOK_EOF) {
if (tok == TOK_ID) {
if (tok_last == TOK_OPENTAG) {
md.in_meta = !strcasecmp("meta", md.token_data);
@@ -533,12 +533,12 @@ PHP_FUNCTION(file_get_contents)
zend_string *contents;
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) {
return;
}
if (ZEND_NUM_ARGS() == 5 && maxlen < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "length must be greater than or equal to zero");
RETURN_FALSE;
}
@@ -552,13 +552,13 @@ PHP_FUNCTION(file_get_contents)
}
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", offset);
php_stream_close(stream);
RETURN_FALSE;
}
if (maxlen > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+ php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
maxlen = INT_MAX;
}
if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) {
@@ -587,7 +587,7 @@ PHP_FUNCTION(file_put_contents)
char mode[3] = "wb";
char ret_ok = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/|lr!", &filename, &filename_len, &data, &flags, &zcontext) == FAILURE) {
return;
}
@@ -603,7 +603,7 @@ PHP_FUNCTION(file_put_contents)
/* check to make sure we are dealing with a regular file */
if (php_memnstr(filename, "://", sizeof("://") - 1, filename + filename_len)) {
if (strncasecmp(filename, "file://", sizeof("file://") - 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks may only be set for regular files");
+ php_error_docref(NULL, E_WARNING, "Exclusive locks may only be set for regular files");
RETURN_FALSE;
}
}
@@ -618,7 +618,7 @@ PHP_FUNCTION(file_put_contents)
if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
php_stream_close(stream);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Exclusive locks are not supported for this stream");
+ php_error_docref(NULL, E_WARNING, "Exclusive locks are not supported for this stream");
RETURN_FALSE;
}
@@ -633,7 +633,7 @@ PHP_FUNCTION(file_put_contents)
ret_ok = 0;
} else {
if (len > ZEND_LONG_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX);
+ php_error_docref(NULL, E_WARNING, "content truncated from %zu to " ZEND_LONG_FMT " bytes", len, ZEND_LONG_MAX);
len = ZEND_LONG_MAX;
}
numbytes = len;
@@ -651,7 +651,7 @@ PHP_FUNCTION(file_put_contents)
if (Z_STRLEN_P(data)) {
numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data));
if (numbytes != Z_STRLEN_P(data)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
+ php_error_docref(NULL, E_WARNING, "Only %pl of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data));
numbytes = -1;
}
}
@@ -668,7 +668,7 @@ PHP_FUNCTION(file_put_contents)
numbytes += str->len;
bytes_written = php_stream_write(stream, str->val, str->len);
if (bytes_written != str->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename);
+ php_error_docref(NULL, E_WARNING, "Failed to write %zd bytes to %s", str->len, filename);
ret_ok = 0;
zend_string_release(str);
break;
@@ -683,10 +683,10 @@ PHP_FUNCTION(file_put_contents)
if (Z_OBJ_HT_P(data) != NULL) {
zval out;
- if (zend_std_cast_object_tostring(data, &out, IS_STRING TSRMLS_CC) == SUCCESS) {
+ if (zend_std_cast_object_tostring(data, &out, IS_STRING) == SUCCESS) {
numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRLEN(out));
if (numbytes != Z_STRLEN(out)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out));
+ php_error_docref(NULL, E_WARNING, "Only %pd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out));
numbytes = -1;
}
zval_dtor(&out);
@@ -728,11 +728,11 @@ PHP_FUNCTION(file)
zend_string *target_buf;
/* Parse arguments */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr!", &filename, &filename_len, &flags, &zcontext) == FAILURE) {
return;
}
if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags);
+ php_error_docref(NULL, E_WARNING, "'" ZEND_LONG_FMT "' flag is not supported", flags);
RETURN_FALSE;
}
@@ -754,7 +754,7 @@ PHP_FUNCTION(file)
s = target_buf->val;
e = target_buf->val + target_buf->len;
- if (!(p = (char*)php_stream_locate_eol(stream, target_buf TSRMLS_CC))) {
+ if (!(p = (char*)php_stream_locate_eol(stream, target_buf))) {
p = e;
goto parse_eol;
}
@@ -811,22 +811,22 @@ PHP_FUNCTION(tempnam)
int fd;
zend_string *p;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(dir TSRMLS_CC)) {
+ if (php_check_open_basedir(dir)) {
RETURN_FALSE;
}
- p = php_basename(prefix, prefix_len, NULL, 0 TSRMLS_CC);
+ p = php_basename(prefix, prefix_len, NULL, 0);
if (p->len > 64) {
p->val[63] = '\0';
}
RETVAL_FALSE;
- if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1 TSRMLS_CC)) >= 0) {
+ if ((fd = php_open_temporary_fd_ex(dir, p->val, &opened_path, 1)) >= 0) {
close(fd);
// TODO: avoid reallocation ???
RETVAL_STRING(opened_path);
@@ -867,7 +867,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
php_stream *stream;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -891,7 +891,7 @@ PHPAPI PHP_FUNCTION(fclose)
php_stream *stream;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
#else
@@ -903,7 +903,7 @@ PHPAPI PHP_FUNCTION(fclose)
PHP_STREAM_TO_ZVAL(stream, res);
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
+ php_error_docref(NULL, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
RETURN_FALSE;
}
@@ -927,7 +927,7 @@ PHP_FUNCTION(popen)
php_stream *stream;
char *posix_mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &command, &command_len, &mode, &mode_len) == FAILURE) {
return;
}
@@ -943,7 +943,7 @@ PHP_FUNCTION(popen)
fp = VCWD_POPEN(command, posix_mode);
if (!fp) {
- php_error_docref2(NULL TSRMLS_CC, command, posix_mode, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, command, posix_mode, E_WARNING, "%s", strerror(errno));
efree(posix_mode);
RETURN_FALSE;
}
@@ -951,7 +951,7 @@ PHP_FUNCTION(popen)
stream = php_stream_fopen_from_pipe(fp, mode);
if (stream == NULL) {
- php_error_docref2(NULL TSRMLS_CC, command, mode, E_WARNING, "%s", strerror(errno));
+ php_error_docref2(NULL, command, mode, E_WARNING, "%s", strerror(errno));
RETVAL_FALSE;
} else {
php_stream_to_zval(stream, return_value);
@@ -968,7 +968,7 @@ PHP_FUNCTION(pclose)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -988,7 +988,7 @@ PHPAPI PHP_FUNCTION(feof)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1013,7 +1013,7 @@ PHPAPI PHP_FUNCTION(fgets)
size_t line_len = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &len) == FAILURE) {
RETURN_FALSE;
}
@@ -1027,7 +1027,7 @@ PHPAPI PHP_FUNCTION(fgets)
}
} else if (argc > 1) {
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1067,7 +1067,7 @@ PHPAPI PHP_FUNCTION(fgetc)
int result;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1100,7 +1100,7 @@ PHPAPI PHP_FUNCTION(fgetss)
char *allowed_tags=NULL;
size_t allowed_tags_len=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lS", &fd, &bytes, &allowed) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|lS", &fd, &bytes, &allowed) == FAILURE) {
RETURN_FALSE;
}
@@ -1108,7 +1108,7 @@ PHPAPI PHP_FUNCTION(fgetss)
if (ZEND_NUM_ARGS() >= 2) {
if (bytes <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1161,11 +1161,11 @@ PHP_FUNCTION(fscanf)
size_t len;
void *what;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs*", &file_handle, &format, &format_len, &args, &argc) == FAILURE) {
return;
}
- what = zend_fetch_resource(file_handle TSRMLS_CC, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
+ what = zend_fetch_resource(file_handle, -1, "File-Handle", &type, 2, php_file_le_stream(), php_file_le_pstream());
/* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up
* with a leak if we have an invalid filehandle. This needs changing
@@ -1179,7 +1179,7 @@ PHP_FUNCTION(fscanf)
RETURN_FALSE;
}
- result = php_sscanf_internal(buf, format, argc, args, 0, return_value TSRMLS_CC);
+ result = php_sscanf_internal(buf, format, argc, args, 0, return_value);
efree(buf);
@@ -1201,7 +1201,7 @@ PHPAPI PHP_FUNCTION(fwrite)
zend_long maxlen = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
RETURN_FALSE;
}
@@ -1233,7 +1233,7 @@ PHPAPI PHP_FUNCTION(fflush)
int ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1254,7 +1254,7 @@ PHPAPI PHP_FUNCTION(rewind)
zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1275,7 +1275,7 @@ PHPAPI PHP_FUNCTION(ftell)
zend_long ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1297,7 +1297,7 @@ PHPAPI PHP_FUNCTION(fseek)
zend_long offset, whence = SEEK_SET;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &res, &offset, &whence) == FAILURE) {
RETURN_FALSE;
}
@@ -1311,24 +1311,24 @@ PHPAPI PHP_FUNCTION(fseek)
*/
/* DEPRECATED APIs: Use php_stream_mkdir() instead */
-PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC)
+PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options)
{
int ret;
- if (php_check_open_basedir(dir TSRMLS_CC)) {
+ if (php_check_open_basedir(dir)) {
return -1;
}
if ((ret = VCWD_MKDIR(dir, (mode_t)mode)) < 0 && (options & REPORT_ERRORS)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
}
return ret;
}
-PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC)
+PHPAPI int php_mkdir(const char *dir, zend_long mode)
{
- return php_mkdir_ex(dir, mode, REPORT_ERRORS TSRMLS_CC);
+ return php_mkdir_ex(dir, mode, REPORT_ERRORS);
}
/* }}} */
@@ -1343,7 +1343,7 @@ PHP_FUNCTION(mkdir)
zend_bool recursive = 0;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lbr", &dir, &dir_len, &mode, &recursive, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1362,7 +1362,7 @@ PHP_FUNCTION(rmdir)
zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dir, &dir_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &dir, &dir_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1384,7 +1384,7 @@ PHP_FUNCTION(readfile)
php_stream *stream;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(umask)
BG(umask) = oldumask;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mask) == FAILURE) {
RETURN_FALSE;
}
@@ -1436,7 +1436,7 @@ PHPAPI PHP_FUNCTION(fpassthru)
size_t size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
RETURN_FALSE;
}
@@ -1457,30 +1457,30 @@ PHP_FUNCTION(rename)
php_stream_wrapper *wrapper;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &old_name, &old_name_len, &new_name, &new_name_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
- wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0);
if (!wrapper || !wrapper->wops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper");
+ php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper");
RETURN_FALSE;
}
if (!wrapper->wops->rename) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source");
+ php_error_docref(NULL, E_WARNING, "%s wrapper does not support renaming", wrapper->wops->label ? wrapper->wops->label : "Source");
RETURN_FALSE;
}
- if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0 TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot rename a file across wrapper types");
+ if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0)) {
+ php_error_docref(NULL, E_WARNING, "Cannot rename a file across wrapper types");
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context TSRMLS_CC));
+ RETURN_BOOL(wrapper->wops->rename(wrapper, old_name, new_name, 0, context));
}
/* }}} */
@@ -1494,24 +1494,24 @@ PHP_FUNCTION(unlink)
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|r", &filename, &filename_len, &zcontext) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if (!wrapper || !wrapper->wops) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate stream wrapper");
+ php_error_docref(NULL, E_WARNING, "Unable to locate stream wrapper");
RETURN_FALSE;
}
if (!wrapper->wops->unlink) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper");
+ php_error_docref(NULL, E_WARNING, "%s does not allow unlinking", wrapper->wops->label ? wrapper->wops->label : "Wrapper");
RETURN_FALSE;
}
- RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context TSRMLS_CC));
+ RETURN_BOOL(wrapper->wops->unlink(wrapper, filename, REPORT_ERRORS, context));
}
/* }}} */
@@ -1523,14 +1523,14 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
zend_long size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &fp, &size) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, fp);
if (!php_stream_truncate_supported(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream!");
+ php_error_docref(NULL, E_WARNING, "Can't truncate this stream!");
RETURN_FALSE;
}
@@ -1552,7 +1552,7 @@ PHP_NAMED_FUNCTION(php_if_fstat)
"size", "atime", "mtime", "ctime", "blksize", "blocks"
};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fp) == FAILURE) {
RETURN_FALSE;
}
@@ -1642,17 +1642,17 @@ PHP_FUNCTION(copy)
zval *zcontext = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|r", &source, &source_len, &target, &target_len, &zcontext) == FAILURE) {
return;
}
- if (php_check_open_basedir(source TSRMLS_CC)) {
+ if (php_check_open_basedir(source)) {
RETURN_FALSE;
}
context = php_stream_context_from_zval(zcontext, 0);
- if (php_copy_file_ctx(source, target, 0, context TSRMLS_CC) == SUCCESS) {
+ if (php_copy_file_ctx(source, target, 0, context) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -1662,23 +1662,23 @@ PHP_FUNCTION(copy)
/* {{{ php_copy_file
*/
-PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC)
+PHPAPI int php_copy_file(const char *src, const char *dest)
{
- return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
+ return php_copy_file_ctx(src, dest, 0, NULL);
}
/* }}} */
/* {{{ php_copy_file_ex
*/
-PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg TSRMLS_DC)
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_flg)
{
- return php_copy_file_ctx(src, dest, 0, NULL TSRMLS_CC);
+ return php_copy_file_ctx(src, dest, 0, NULL);
}
/* }}} */
/* {{{ php_copy_file_ctx
*/
-PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx TSRMLS_DC)
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php_stream_context *ctx)
{
php_stream *srcstream = NULL, *deststream = NULL;
int ret = FAILURE;
@@ -1695,7 +1695,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php
return ret;
}
if (S_ISDIR(src_s.sb.st_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument to copy() function cannot be a directory");
+ php_error_docref(NULL, E_WARNING, "The first argument to copy() function cannot be a directory");
return FAILURE;
}
@@ -1710,7 +1710,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php
return ret;
}
if (S_ISDIR(dest_s.sb.st_mode)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument to copy() function cannot be a directory");
+ php_error_docref(NULL, E_WARNING, "The second argument to copy() function cannot be a directory");
return FAILURE;
}
if (!src_s.sb.st_ino || !dest_s.sb.st_ino) {
@@ -1726,10 +1726,10 @@ no_stat:
char *sp, *dp;
int res;
- if ((sp = expand_filepath(src, NULL TSRMLS_CC)) == NULL) {
+ if ((sp = expand_filepath(src, NULL)) == NULL) {
return ret;
}
- if ((dp = expand_filepath(dest, NULL TSRMLS_CC)) == NULL) {
+ if ((dp = expand_filepath(dest, NULL)) == NULL) {
efree(sp);
goto safe_to_copy;
}
@@ -1778,14 +1778,14 @@ PHPAPI PHP_FUNCTION(fread)
zend_long len;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &len) == FAILURE) {
RETURN_FALSE;
}
PHP_STREAM_TO_ZVAL(stream, res);
if (len <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -1797,7 +1797,7 @@ PHPAPI PHP_FUNCTION(fread)
}
/* }}} */
-static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter TSRMLS_DC) /* {{{ */
+static const char *php_fgetcsv_lookup_trailing_spaces(const char *ptr, size_t len, const char delimiter) /* {{{ */
{
int inc_len;
unsigned char last_chars[2] = { 0, 0 };
@@ -1850,7 +1850,7 @@ PHP_FUNCTION(fputcsv)
char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL;
size_t delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|sss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|sss",
&fp, &fields, &delimiter_str, &delimiter_str_len,
&enclosure_str, &enclosure_str_len,
&escape_str, &escape_str_len) == FAILURE) {
@@ -1860,10 +1860,10 @@ PHP_FUNCTION(fputcsv)
if (delimiter_str != NULL) {
/* Make sure that there is at least one character in string */
if (delimiter_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
} else if (delimiter_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
+ php_error_docref(NULL, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -1872,10 +1872,10 @@ PHP_FUNCTION(fputcsv)
if (enclosure_str != NULL) {
if (enclosure_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
} else if (enclosure_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
+ php_error_docref(NULL, E_NOTICE, "enclosure must be a single character");
}
/* use first character from string */
enclosure = *enclosure_str;
@@ -1883,10 +1883,10 @@ PHP_FUNCTION(fputcsv)
if (escape_str != NULL) {
if (escape_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be a character");
+ php_error_docref(NULL, E_WARNING, "escape must be a character");
RETURN_FALSE;
} else if (escape_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character");
+ php_error_docref(NULL, E_NOTICE, "escape must be a single character");
}
/* use first character from string */
escape_char = *escape_str;
@@ -1894,13 +1894,13 @@ PHP_FUNCTION(fputcsv)
PHP_STREAM_TO_ZVAL(stream, fp);
- ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char TSRMLS_CC);
+ ret = php_fputcsv(stream, fields, delimiter, enclosure, escape_char);
RETURN_LONG(ret);
}
/* }}} */
-/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC) */
-PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC)
+/* {{{ PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char) */
+PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char)
{
int count, i = 0;
size_t ret;
@@ -1982,7 +1982,7 @@ PHP_FUNCTION(fgetcsv)
char *escape_str = NULL;
size_t escape_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zsss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zsss",
&fd, &len_zv, &delimiter_str, &delimiter_str_len,
&enclosure_str, &enclosure_str_len,
&escape_str, &escape_str_len) == FAILURE
@@ -1993,10 +1993,10 @@ PHP_FUNCTION(fgetcsv)
if (delimiter_str != NULL) {
/* Make sure that there is at least one character in string */
if (delimiter_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "delimiter must be a character");
+ php_error_docref(NULL, E_WARNING, "delimiter must be a character");
RETURN_FALSE;
} else if (delimiter_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "delimiter must be a single character");
+ php_error_docref(NULL, E_NOTICE, "delimiter must be a single character");
}
/* use first character from string */
@@ -2005,10 +2005,10 @@ PHP_FUNCTION(fgetcsv)
if (enclosure_str != NULL) {
if (enclosure_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "enclosure must be a character");
+ php_error_docref(NULL, E_WARNING, "enclosure must be a character");
RETURN_FALSE;
} else if (enclosure_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "enclosure must be a single character");
+ php_error_docref(NULL, E_NOTICE, "enclosure must be a single character");
}
/* use first character from string */
@@ -2017,10 +2017,10 @@ PHP_FUNCTION(fgetcsv)
if (escape_str != NULL) {
if (escape_str_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "escape must be character");
+ php_error_docref(NULL, E_WARNING, "escape must be character");
RETURN_FALSE;
} else if (escape_str_len > 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "escape must be a single character");
+ php_error_docref(NULL, E_NOTICE, "escape must be a single character");
}
escape = escape_str[0];
@@ -2029,7 +2029,7 @@ PHP_FUNCTION(fgetcsv)
if (len_zv != NULL && Z_TYPE_P(len_zv) != IS_NULL) {
len = zval_get_long(len_zv);
if (len < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative");
+ php_error_docref(NULL, E_WARNING, "Length parameter may not be negative");
RETURN_FALSE;
} else if (len == 0) {
len = -1;
@@ -2053,11 +2053,11 @@ PHP_FUNCTION(fgetcsv)
}
}
- php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value TSRMLS_CC);
+ php_fgetcsv(stream, delimiter, enclosure, escape, buf_len, buf, return_value);
}
/* }}} */
-PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC) /* {{{ */
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value) /* {{{ */
{
char *temp, *tptr, *bptr, *line_end, *limit;
size_t temp_len, line_end_len;
@@ -2072,7 +2072,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
/* Strip trailing space from buf, saving end of line in case required for enclosure field */
bptr = buf;
- tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC);
+ tptr = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter);
line_end_len = buf_len - (size_t)(tptr - buf);
line_end = limit = tptr;
@@ -2170,7 +2170,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
bptr = buf = new_buf;
hunk_begin = buf;
- line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter TSRMLS_CC);
+ line_end = limit = (char *)php_fgetcsv_lookup_trailing_spaces(buf, buf_len, delimiter);
line_end_len = buf_len - (size_t)(limit - buf);
state = 0;
@@ -2296,7 +2296,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char
memcpy(tptr, hunk_begin, bptr - hunk_begin);
tptr += (bptr - hunk_begin);
- comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter TSRMLS_CC);
+ comp_end = (char *)php_fgetcsv_lookup_trailing_spaces(temp, tptr - temp, delimiter);
if (*bptr == delimiter) {
bptr++;
}
@@ -2325,7 +2325,7 @@ PHP_FUNCTION(realpath)
char resolved_path_buff[MAXPATHLEN];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
return;
}
#else
@@ -2335,7 +2335,7 @@ PHP_FUNCTION(realpath)
#endif
if (VCWD_REALPATH(filename, resolved_path_buff)) {
- if (php_check_open_basedir(resolved_path_buff TSRMLS_CC)) {
+ if (php_check_open_basedir(resolved_path_buff)) {
RETURN_FALSE;
}
@@ -2357,7 +2357,7 @@ PHP_FUNCTION(realpath)
/* {{{ php_next_meta_token
Tokenizes an HTML file for get_meta_tags */
-php_meta_tags_token php_next_meta_token(php_meta_tags_data *md TSRMLS_DC)
+php_meta_tags_token php_next_meta_token(php_meta_tags_data *md)
{
int ch = 0, compliment;
char buff[META_DEF_BUFSIZE + 1];
@@ -2468,16 +2468,16 @@ PHP_FUNCTION(fnmatch)
size_t pattern_len, filename_len;
zend_long flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp|l", &pattern, &pattern_len, &filename, &filename_len, &flags) == FAILURE) {
return;
}
if (filename_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
@@ -2493,7 +2493,7 @@ PHP_FUNCTION(sys_get_temp_dir)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- RETURN_STRING((char *)php_get_temporary_directory(TSRMLS_C));
+ RETURN_STRING((char *)php_get_temporary_directory());
}
/* }}} */
diff --git a/ext/standard/file.h b/ext/standard/file.h
index 78cab4f62f..17c82424fc 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -74,15 +74,15 @@ PHP_FUNCTION(sys_get_temp_dir);
PHP_MINIT_FUNCTION(user_streams);
-PHPAPI int php_le_stream_context(TSRMLS_D);
-PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block TSRMLS_DC);
-PHPAPI int php_copy_file(const char *src, const char *dest TSRMLS_DC);
-PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk TSRMLS_DC);
-PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx TSRMLS_DC);
-PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options TSRMLS_DC);
-PHPAPI int php_mkdir(const char *dir, zend_long mode TSRMLS_DC);
-PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
-PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char TSRMLS_DC);
+PHPAPI int php_le_stream_context(void);
+PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block);
+PHPAPI int php_copy_file(const char *src, const char *dest);
+PHPAPI int php_copy_file_ex(const char *src, const char *dest, int src_chk);
+PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_chk, php_stream_context *ctx);
+PHPAPI int php_mkdir_ex(const char *dir, zend_long mode, int options);
+PHPAPI int php_mkdir(const char *dir, zend_long mode);
+PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value);
+PHPAPI size_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, char escape_char);
#define META_DEF_BUFSIZE 8192
@@ -114,7 +114,7 @@ typedef struct _php_meta_tags_data {
int in_meta;
} php_meta_tags_data;
-php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC);
+php_meta_tags_token php_next_meta_token(php_meta_tags_data *);
typedef struct {
int pclose_ret;
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 80d4ca4388..40cebcf7c5 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -119,7 +119,7 @@ PHP_RSHUTDOWN_FUNCTION(filestat) /* {{{ */
}
/* }}} */
-static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
+static int php_disk_total_space(char *path, double *space) /* {{{ */
#if defined(WINDOWS) /* {{{ */
{
double bytestotal = 0;
@@ -152,7 +152,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
&TotalNumberOfFreeBytes) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
@@ -164,13 +164,13 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
if (GetDiskFreeSpace(path,
&SectorsPerCluster, &BytesPerSector,
&NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
bytestotal = (double)TotalNumberOfClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll");
return FAILURE;
}
@@ -203,7 +203,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
if (buf.f_frsize) {
@@ -214,7 +214,7 @@ static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
bytestotal = (((double)buf.f_bsize) * ((double)buf.f_blocks));
@@ -235,22 +235,22 @@ PHP_FUNCTION(disk_total_space)
char *path;
size_t path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(path TSRMLS_CC)) {
+ if (php_check_open_basedir(path)) {
RETURN_FALSE;
}
- if (php_disk_total_space(path, &bytestotal TSRMLS_CC) == SUCCESS) {
+ if (php_disk_total_space(path, &bytestotal) == SUCCESS) {
RETURN_DOUBLE(bytestotal);
}
RETURN_FALSE;
}
/* }}} */
-static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
+static int php_disk_free_space(char *path, double *space) /* {{{ */
#if defined(WINDOWS) /* {{{ */
{
double bytesfree = 0;
@@ -284,7 +284,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
&FreeBytesAvailableToCaller,
&TotalNumberOfBytes,
&TotalNumberOfFreeBytes) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
@@ -296,13 +296,13 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
if (GetDiskFreeSpace(path,
&SectorsPerCluster, &BytesPerSector,
&NumberOfFreeClusters, &TotalNumberOfClusters) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", php_win_err());
+ php_error_docref(NULL, E_WARNING, "%s", php_win_err());
return FAILURE;
}
bytesfree = (double)NumberOfFreeClusters * (double)SectorsPerCluster * (double)BytesPerSector;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Unable to load kernel32.dll");
return FAILURE;
}
@@ -335,7 +335,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
if (statvfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
if (buf.f_frsize) {
@@ -345,7 +345,7 @@ static int php_disk_free_space(char *path, double *space TSRMLS_DC) /* {{{ */
}
#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H)) && defined(HAVE_STATFS)
if (statfs(path, &buf)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
return FAILURE;
}
#ifdef NETWARE
@@ -370,15 +370,15 @@ PHP_FUNCTION(disk_free_space)
char *path;
size_t path_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &path, &path_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &path, &path_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(path TSRMLS_CC)) {
+ if (php_check_open_basedir(path)) {
RETURN_FALSE;
}
- if (php_disk_free_space(path, &bytesfree TSRMLS_CC) == SUCCESS) {
+ if (php_disk_free_space(path, &bytesfree) == SUCCESS) {
RETURN_DOUBLE(bytesfree);
}
RETURN_FALSE;
@@ -386,7 +386,7 @@ PHP_FUNCTION(disk_free_space)
/* }}} */
#if !defined(WINDOWS) && !defined(NETWARE)
-PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid TSRMLS_DC)
+PHPAPI int php_get_gid_by_name(const char *name, gid_t *gid)
{
#if defined(ZTS) && defined(HAVE_GETGRNAM_R) && defined(_SC_GETGR_R_SIZE_MAX)
struct group gr;
@@ -428,11 +428,11 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
#endif
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &group) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &group) == FAILURE) {
RETURN_FALSE;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
int option;
@@ -444,10 +444,10 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
option = PHP_STREAM_META_GROUP_NAME;
value = Z_STRVAL_P(group);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
RETURN_FALSE;
}
- if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -455,7 +455,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
} else {
#if !defined(WINDOWS)
/* On Windows, we expect regular chgrp to fail silently by default */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chgrp() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chgrp() for a non-standard stream");
#endif
RETURN_FALSE;
}
@@ -468,17 +468,17 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
if (Z_TYPE_P(group) == IS_LONG) {
gid = (gid_t)Z_LVAL_P(group);
} else if (Z_TYPE_P(group) == IS_STRING) {
- if(php_get_gid_by_name(Z_STRVAL_P(group), &gid TSRMLS_CC) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group));
+ if(php_get_gid_by_name(Z_STRVAL_P(group), &gid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group));
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(group));
RETURN_FALSE;
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -490,7 +490,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */
ret = VCWD_CHOWN(filename, -1, gid);
}
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -523,7 +523,7 @@ PHP_FUNCTION(lchgrp)
#endif /* !NETWARE */
#if !defined(WINDOWS) && !defined(NETWARE)
-PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid TSRMLS_DC)
+PHPAPI uid_t php_get_uid_by_name(const char *name, uid_t *uid)
{
#if defined(ZTS) && defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
struct passwd pw;
@@ -565,11 +565,11 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
#endif
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pz/", &filename, &filename_len, &user) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pz/", &filename, &filename_len, &user) == FAILURE) {
return;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
int option;
@@ -581,10 +581,10 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
option = PHP_STREAM_META_OWNER_NAME;
value = Z_STRVAL_P(user);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
RETURN_FALSE;
}
- if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -592,7 +592,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
} else {
#if !defined(WINDOWS)
/* On Windows, we expect regular chown to fail silently by default */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chown() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chown() for a non-standard stream");
#endif
RETURN_FALSE;
}
@@ -606,17 +606,17 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
if (Z_TYPE_P(user) == IS_LONG) {
uid = (uid_t)Z_LVAL_P(user);
} else if (Z_TYPE_P(user) == IS_STRING) {
- if(php_get_uid_by_name(Z_STRVAL_P(user), &uid TSRMLS_CC) != SUCCESS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user));
+ if(php_get_uid_by_name(Z_STRVAL_P(user), &uid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user));
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
+ php_error_docref(NULL, E_WARNING, "parameter 2 should be string or integer, %s given", zend_zval_type_name(user));
RETURN_FALSE;
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -628,7 +628,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */
ret = VCWD_CHOWN(filename, uid, -1);
}
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -673,26 +673,26 @@ PHP_FUNCTION(chmod)
mode_t imode;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pl", &filename, &filename_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pl", &filename, &filename_len, &mode) == FAILURE) {
return;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
- if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_ACCESS, &mode, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call chmod() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call chmod() for a non-standard stream");
RETURN_FALSE;
}
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -700,7 +700,7 @@ PHP_FUNCTION(chmod)
ret = VCWD_CHMOD(filename, imode);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -721,7 +721,7 @@ PHP_FUNCTION(touch)
struct utimbuf *newtime = &newtimebuf;
php_stream_wrapper *wrapper;
- if (zend_parse_parameters(argc TSRMLS_CC, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
+ if (zend_parse_parameters(argc, "p|ll", &filename, &filename_len, &filetime, &fileatime) == FAILURE) {
return;
}
@@ -749,10 +749,10 @@ PHP_FUNCTION(touch)
WRONG_PARAM_COUNT;
}
- wrapper = php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper != &php_plain_files_wrapper || strncasecmp("file://", filename, 7) == 0) {
if(wrapper && wrapper->wops->stream_metadata) {
- if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL TSRMLS_CC)) {
+ if(wrapper->wops->stream_metadata(wrapper, filename, PHP_STREAM_META_TOUCH, newtime, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -760,7 +760,7 @@ PHP_FUNCTION(touch)
} else {
php_stream *stream;
if(argc > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not call touch() for a non-standard stream");
+ php_error_docref(NULL, E_WARNING, "Can not call touch() for a non-standard stream");
RETURN_FALSE;
}
stream = php_stream_open_wrapper_ex(filename, "c", REPORT_ERRORS, NULL, NULL);
@@ -774,7 +774,7 @@ PHP_FUNCTION(touch)
}
/* Check the basedir */
- if (php_check_open_basedir(filename TSRMLS_CC)) {
+ if (php_check_open_basedir(filename)) {
RETURN_FALSE;
}
@@ -782,7 +782,7 @@ PHP_FUNCTION(touch)
if (VCWD_ACCESS(filename, F_OK) != 0) {
file = VCWD_FOPEN(filename, "w");
if (file == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Unable to create file %s because %s", filename, strerror(errno));
RETURN_FALSE;
}
fclose(file);
@@ -790,7 +790,7 @@ PHP_FUNCTION(touch)
ret = VCWD_UTIME(filename, newtime);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Utime failed: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "Utime failed: %s", strerror(errno));
RETURN_FALSE;
}
RETURN_TRUE;
@@ -800,7 +800,7 @@ PHP_FUNCTION(touch)
/* {{{ php_clear_stat_cache()
*/
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC)
+PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len)
{
/* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL
* as it may contain outdated data (e.g. "nlink" for a directory when deleting a file
@@ -815,9 +815,9 @@ PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *fil
}
if (clear_realpath_cache) {
if (filename != NULL) {
- realpath_cache_del(filename, filename_len TSRMLS_CC);
+ realpath_cache_del(filename, filename_len);
} else {
- realpath_cache_clean(TSRMLS_C);
+ realpath_cache_clean();
}
}
}
@@ -831,11 +831,11 @@ PHP_FUNCTION(clearstatcache)
char *filename = NULL;
size_t filename_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|bp", &clear_realpath_cache, &filename, &filename_len) == FAILURE) {
return;
}
- php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len TSRMLS_CC);
+ php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len);
}
/* }}} */
@@ -846,7 +846,7 @@ PHP_FUNCTION(clearstatcache)
/* {{{ php_stat
*/
-PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC)
+PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
@@ -864,7 +864,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
RETURN_FALSE;
}
- if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC)) == &php_plain_files_wrapper && php_check_open_basedir(local TSRMLS_CC)) {
+ if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0)) == &php_plain_files_wrapper && php_check_open_basedir(local)) {
RETURN_FALSE;
}
@@ -906,7 +906,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) {
/* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
+ php_error_docref(NULL, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
RETURN_FALSE;
}
@@ -991,7 +991,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
case S_IFSOCK: RETURN_STRING("socket");
#endif
}
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT);
+ php_error_docref(NULL, E_NOTICE, "Unknown file type (%d)", ssb.sb.st_mode&S_IFMT);
RETURN_STRING("unknown");
case FS_IS_W:
RETURN_BOOL((ssb.sb.st_mode & wmask) != 0);
@@ -1081,7 +1081,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call");
+ php_error_docref(NULL, E_WARNING, "Didn't understand stat call");
RETURN_FALSE;
}
/* }}} */
@@ -1094,11 +1094,11 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
char *filename; \
size_t filename_len; \
\
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \
return; \
} \
\
- php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \
+ php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
}
#else
# define FileFunction(name, funcnum) \
@@ -1110,7 +1110,7 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
Z_PARAM_PATH(filename, filename_len) \
ZEND_PARSE_PARAMETERS_END(); \
\
- php_stat(filename, (php_stat_len) filename_len, funcnum, return_value TSRMLS_CC); \
+ php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
}
#endif
/* }}} */
@@ -1212,14 +1212,14 @@ PHP_FUNCTION(realpath_cache_size)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- RETURN_LONG(realpath_cache_size(TSRMLS_C));
+ RETURN_LONG(realpath_cache_size());
}
/* {{{ proto bool realpath_cache_get()
Get current size of realpath cache */
PHP_FUNCTION(realpath_cache_get)
{
- realpath_cache_bucket **buckets = realpath_cache_get_buckets(TSRMLS_C), **end = buckets + realpath_cache_max_buckets(TSRMLS_C);
+ realpath_cache_bucket **buckets = realpath_cache_get_buckets(), **end = buckets + realpath_cache_max_buckets();
if (zend_parse_parameters_none() == FAILURE) {
return;
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 3fd27afa43..1a74abf89c 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -46,12 +46,12 @@ static php_stream_filter_status_t strfilter_rot13_filter(
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, rot13_from, rot13_to, 52);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -67,7 +67,7 @@ static php_stream_filter_ops strfilter_rot13_ops = {
"string.rot13"
};
-static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_rot13_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_rot13_ops, NULL, persistent);
}
@@ -94,12 +94,12 @@ static php_stream_filter_status_t strfilter_toupper_filter(
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, lowercase, uppercase, 26);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -122,12 +122,12 @@ static php_stream_filter_status_t strfilter_tolower_filter(
size_t consumed = 0;
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
php_strtr(bucket->buf, bucket->buflen, uppercase, lowercase, 26);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -149,12 +149,12 @@ static php_stream_filter_ops strfilter_tolower_ops = {
"string.tolower"
};
-static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_toupper_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_toupper_ops, NULL, persistent);
}
-static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_tolower_create(const char *filtername, zval *filterparams, int persistent)
{
return php_stream_filter_alloc(&strfilter_tolower_ops, NULL, persistent);
}
@@ -214,12 +214,12 @@ static php_stream_filter_status_t strfilter_strip_tags_filter(
php_strip_tags_filter *inst = (php_strip_tags_filter *) Z_PTR(thisfilter->abstract);
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
consumed = bucket->buflen;
bucket->buflen = php_strip_tags(bucket->buf, bucket->buflen, &(inst->state), (char *)inst->allowed_tags, inst->allowed_tags_len);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -229,7 +229,7 @@ static php_stream_filter_status_t strfilter_strip_tags_filter(
return PSFS_PASS_ON;
}
-static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void strfilter_strip_tags_dtor(php_stream_filter *thisfilter)
{
assert(Z_PTR(thisfilter->abstract) != NULL);
@@ -244,7 +244,7 @@ static php_stream_filter_ops strfilter_strip_tags_ops = {
"string.strip_tags"
};
-static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zval *filterparams, int persistent)
{
php_strip_tags_filter *inst;
smart_str tags_ss = {0};
@@ -1209,7 +1209,7 @@ typedef struct _php_convert_filter {
#define PHP_CONV_QPRINT_ENCODE 3
#define PHP_CONV_QPRINT_DECODE 4
-static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent TSRMLS_DC)
+static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent)
{
zval *tmpval;
@@ -1334,7 +1334,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval,
}
#define GET_STR_PROP(ht, var, var_len, fldname, persistent) \
- php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent TSRMLS_CC)
+ php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent)
#define GET_INT_PROP(ht, var, fldname) \
php_conv_get_int_prop_ex(ht, &var, fldname, sizeof(fldname))
@@ -1345,7 +1345,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval,
#define GET_BOOL_PROP(ht, var, fldname) \
php_conv_get_bool_prop_ex(ht, &var, fldname, sizeof(fldname))
-static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent TSRMLS_DC)
+static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent)
{
/* FIXME: I'll have to replace this ugly code by something neat
(factories?) in the near future. */
@@ -1481,13 +1481,13 @@ out_failure:
static int php_convert_filter_ctor(php_convert_filter *inst,
int conv_mode, HashTable *conv_opts,
- const char *filtername, int persistent TSRMLS_DC)
+ const char *filtername, int persistent)
{
inst->persistent = persistent;
inst->filtername = pestrdup(filtername, persistent);
inst->stub_len = 0;
- if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent TSRMLS_CC)) == NULL) {
+ if ((inst->cd = php_conv_open(conv_mode, conv_opts, persistent)) == NULL) {
goto out_failure;
}
@@ -1522,7 +1522,7 @@ static int strfilter_convert_append_bucket(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
const char *ps, size_t buf_len, size_t *consumed,
- int persistent TSRMLS_DC)
+ int persistent)
{
php_conv_err_t err;
php_stream_bucket *new_bucket;
@@ -1557,14 +1557,14 @@ static int strfilter_convert_append_bucket(
switch (err) {
case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_MORE:
if (ps != NULL) {
if (icnt > 0) {
if (inst->stub_len >= sizeof(inst->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
goto out_failure;
}
inst->stub[inst->stub_len++] = *(ps++);
@@ -1579,7 +1579,7 @@ static int strfilter_convert_append_bucket(
break;
case PHP_CONV_ERR_UNEXPECTED_EOS:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_TOO_BIG: {
@@ -1590,11 +1590,11 @@ static int strfilter_convert_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -1603,11 +1603,11 @@ static int strfilter_convert_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
@@ -1619,7 +1619,7 @@ static int strfilter_convert_append_bucket(
} break;
case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
goto out_failure;
default:
@@ -1635,13 +1635,13 @@ static int strfilter_convert_append_bucket(
php_conv_convert(inst->cd, &ps, &icnt, &pd, &ocnt)));
switch (err) {
case PHP_CONV_ERR_INVALID_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid byte sequence", inst->filtername);
goto out_failure;
case PHP_CONV_ERR_MORE:
if (ps != NULL) {
if (icnt > sizeof(inst->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): insufficient buffer", inst->filtername);
goto out_failure;
}
memcpy(inst->stub, ps, icnt);
@@ -1649,7 +1649,7 @@ static int strfilter_convert_append_bucket(
ps += icnt;
icnt = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unexpected octet values", inst->filtername);
goto out_failure;
}
break;
@@ -1662,11 +1662,11 @@ static int strfilter_convert_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -1675,11 +1675,11 @@ static int strfilter_convert_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -1690,7 +1690,7 @@ static int strfilter_convert_append_bucket(
} break;
case PHP_CONV_ERR_UNKNOWN:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
goto out_failure;
default:
@@ -1702,10 +1702,10 @@ static int strfilter_convert_append_bucket(
}
if (out_buf_size > ocnt) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
} else {
pefree(out_buf, persistent);
}
@@ -1735,21 +1735,21 @@ static php_stream_filter_status_t strfilter_convert_filter(
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (strfilter_convert_append_bucket(inst, stream, thisfilter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags != PSFS_FLAG_NORMAL) {
if (strfilter_convert_append_bucket(inst, stream, thisfilter,
buckets_out, NULL, 0, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
}
@@ -1762,12 +1762,12 @@ static php_stream_filter_status_t strfilter_convert_filter(
out_failure:
if (bucket != NULL) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
return PSFS_ERR_FATAL;
}
-static void strfilter_convert_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void strfilter_convert_dtor(php_stream_filter *thisfilter)
{
assert(Z_PTR(thisfilter->abstract) != NULL);
@@ -1781,7 +1781,7 @@ static php_stream_filter_ops strfilter_convert_ops = {
"convert.*"
};
-static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *strfilter_convert_create(const char *filtername, zval *filterparams, int persistent)
{
php_convert_filter *inst;
php_stream_filter *retval = NULL;
@@ -1790,7 +1790,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval
int conv_mode = 0;
if (filterparams != NULL && Z_TYPE_P(filterparams) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid filter parameter", filtername);
+ php_error_docref(NULL, E_WARNING, "stream filter (%s): invalid filter parameter", filtername);
return NULL;
}
@@ -1813,7 +1813,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval
if (php_convert_filter_ctor(inst, conv_mode,
(filterparams != NULL ? Z_ARRVAL_P(filterparams) : NULL),
- filtername, persistent TSRMLS_CC) != SUCCESS) {
+ filtername, persistent) != SUCCESS) {
goto out;
}
@@ -1855,9 +1855,9 @@ static php_stream_filter_status_t consumed_filter_filter(
data->offset = php_stream_tell(stream);
}
while ((bucket = buckets_in->head) != NULL) {
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
consumed += bucket->buflen;
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
*bytes_consumed = consumed;
@@ -1870,7 +1870,7 @@ static php_stream_filter_status_t consumed_filter_filter(
return PSFS_PASS_ON;
}
-static void consumed_filter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void consumed_filter_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_consumed_filter_data *data = (php_consumed_filter_data*)Z_PTR(thisfilter->abstract);
@@ -1884,7 +1884,7 @@ static php_stream_filter_ops consumed_filter_ops = {
"consumed"
};
-static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *consumed_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_consumed_filter_data *data;
@@ -1896,7 +1896,7 @@ static php_stream_filter *consumed_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_consumed_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data));
return NULL;
}
data->persistent = persistent;
@@ -2065,10 +2065,10 @@ static php_stream_filter_status_t php_chunked_filter(
php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract);
while (buckets_in->head) {
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
consumed += bucket->buflen;
bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, bucket);
}
if (bytes_consumed) {
@@ -2078,7 +2078,7 @@ static php_stream_filter_status_t php_chunked_filter(
return PSFS_PASS_ON;
}
-static void php_chunked_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_chunked_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_chunked_filter_data *data = (php_chunked_filter_data *) Z_PTR(thisfilter->abstract);
@@ -2092,7 +2092,7 @@ static php_stream_filter_ops chunked_filter_ops = {
"dechunk"
};
-static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *chunked_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_chunked_filter_data *data;
@@ -2104,7 +2104,7 @@ static php_stream_filter *chunked_filter_create(const char *filtername, zval *fi
/* Create this filter */
data = (php_chunked_filter_data *)pecalloc(1, sizeof(php_chunked_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data));
return NULL;
}
data->state = CHUNK_SIZE_START;
@@ -2156,7 +2156,7 @@ PHP_MSHUTDOWN_FUNCTION(standard_filters)
int i;
for (i = 0; standard_filters[i].ops; i++) {
- php_stream_filter_unregister_factory(standard_filters[i].ops->label TSRMLS_CC);
+ php_stream_filter_unregister_factory(standard_filters[i].ops->label);
}
return SUCCESS;
}
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 1c3abb4d50..26a2276fea 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -57,10 +57,10 @@ static char HEXCHARS[] = "0123456789ABCDEF";
/* php_spintf_appendchar() {{{ */
inline static void
-php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add TSRMLS_DC)
+php_sprintf_appendchar(zend_string **buffer, size_t *pos, char add)
{
if (!*buffer || (*pos + 1) >= (*buffer)->len) {
- PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), (*buffer)->len));
+ PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(), (*buffer)->len));
*buffer = zend_string_realloc(*buffer, (*buffer)->len << 1, 0);
}
PRINTF_DEBUG(("sprintf: appending '%c', pos=\n", add, *pos));
@@ -209,7 +209,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos,
size_t alignment, int precision,
int adjust, char fmt,
int always_sign
- TSRMLS_DC)
+ )
{
char num_buf[NUM_BUF_SIZE];
char *s = NULL;
@@ -228,7 +228,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos,
if ((adjust & ADJ_PRECISION) == 0) {
precision = FLOAT_PRECISION;
} else if (precision > MAX_FLOAT_PRECISION) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION);
+ php_error_docref(NULL, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION);
precision = MAX_FLOAT_PRECISION;
}
@@ -383,7 +383,7 @@ php_sprintf_getnumber(char *buffer, size_t *pos)
*
*/
static zend_string *
-php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
+php_formatted_print(int param_count, int use_array, int format_offset)
{
zval *newargs = NULL;
zval *args, *z_format;
@@ -395,7 +395,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
int always_sign;
size_t format_len;
- if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(param_count, "+", &args, &argc) == FAILURE) {
return NULL;
}
@@ -443,9 +443,9 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));
PRINTF_DEBUG(("sprintf: outpos=%d\n", outpos));
if (format[inpos] != '%') {
- php_sprintf_appendchar(&result, &outpos, format[inpos++] TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, format[inpos++]);
} else if (format[inpos + 1] == '%') {
- php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, '%');
inpos += 2;
} else {
/* starting a new format specifier, reset variables */
@@ -469,7 +469,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument number must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Argument number must be greater than zero");
return NULL;
}
@@ -512,7 +512,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
if (newargs) {
efree(newargs);
}
@@ -534,7 +534,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
if (newargs) {
efree(newargs);
}
@@ -559,7 +559,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
if (newargs) {
efree(newargs);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments");
+ php_error_docref(NULL, E_WARNING, "Too few arguments");
return NULL;
}
@@ -606,12 +606,12 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
width, padding, alignment,
precision, adjusting,
format[inpos], always_sign
- TSRMLS_CC);
+ );
break;
case 'c':
php_sprintf_appendchar(&result, &outpos,
- (char) zval_get_long(tmp) TSRMLS_CC);
+ (char) zval_get_long(tmp));
break;
case 'o':
@@ -643,7 +643,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
break;
case '%':
- php_sprintf_appendchar(&result, &outpos, '%' TSRMLS_CC);
+ php_sprintf_appendchar(&result, &outpos, '%');
break;
default:
@@ -670,7 +670,7 @@ PHP_FUNCTION(user_sprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -683,7 +683,7 @@ PHP_FUNCTION(vsprintf)
{
zend_string *result;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
RETURN_FALSE;
}
RETVAL_STR(result);
@@ -697,7 +697,7 @@ PHP_FUNCTION(user_printf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -713,7 +713,7 @@ PHP_FUNCTION(vprintf)
zend_string *result;
size_t rlen;
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) {
RETURN_FALSE;
}
rlen = PHPWRITE(result->val, result->len);
@@ -734,13 +734,13 @@ PHP_FUNCTION(fprintf)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(1, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1))==NULL) {
RETURN_FALSE;
}
@@ -763,13 +763,13 @@ PHP_FUNCTION(vfprintf)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(1, "r", &arg1) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, arg1);
- if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1 TSRMLS_CC))==NULL) {
+ if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1))==NULL) {
RETURN_FALSE;
}
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 30a6fda5d6..df7ceae079 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -51,7 +51,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) {
RETURN_FALSE;
}
@@ -92,7 +92,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(hostname);
}
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s:" ZEND_LONG_FMT " (%s)", host, port, errstr == NULL ? "Unknown error" : errstr->val);
}
if (hashkey) {
diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c
index 536fccaa3e..e74fd6b65e 100644
--- a/ext/standard/ftok.c
+++ b/ext/standard/ftok.c
@@ -35,27 +35,27 @@ PHP_FUNCTION(ftok)
size_t pathname_len, proj_len;
key_t k;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &pathname, &pathname_len, &proj, &proj_len) == FAILURE) {
return;
}
if (pathname_len == 0){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pathname is invalid");
+ php_error_docref(NULL, E_WARNING, "Pathname is invalid");
RETURN_LONG(-1);
}
if (proj_len != 1){
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Project identifier is invalid");
+ php_error_docref(NULL, E_WARNING, "Project identifier is invalid");
RETURN_LONG(-1);
}
- if (php_check_open_basedir(pathname TSRMLS_CC)) {
+ if (php_check_open_basedir(pathname)) {
RETURN_LONG(-1);
}
k = ftok(pathname, proj[0]);
if (k == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftok() failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "ftok() failed - %s", strerror(errno));
}
RETURN_LONG(k);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 526a45b470..361019382e 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -70,7 +70,7 @@
#include "php_fopen_wrappers.h"
#define FTPS_ENCRYPT_DATA 1
-#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line) TSRMLS_CC)
+#define GET_FTP_RESULT(stream) get_ftp_result((stream), tmp_line, sizeof(tmp_line))
typedef struct _php_ftp_dirstream_data {
php_stream *datastream;
@@ -80,7 +80,7 @@ typedef struct _php_ftp_dirstream_data {
/* {{{ get_ftp_result
*/
-static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC)
+static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size)
{
while (php_stream_gets(stream, buffer, buffer_size-1) &&
!(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) &&
@@ -91,7 +91,7 @@ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer
/* {{{ php_stream_ftp_stream_stat
*/
-static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb)
{
/* For now, we return with a failure code to prevent the underlying
* file's details from being used instead. */
@@ -101,7 +101,7 @@ static int php_stream_ftp_stream_stat(php_stream_wrapper *wrapper, php_stream *s
/* {{{ php_stream_ftp_stream_close
*/
-static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC)
+static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *stream)
{
php_stream *controlstream = stream->wrapperthis;
int ret = 0;
@@ -114,7 +114,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *
/* For write modes close data stream first to signal EOF to server */
result = GET_FTP_RESULT(controlstream);
if (result != 226 && result != 250) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "FTP server error %d:%s", result, tmp_line);
+ php_error_docref(NULL, E_WARNING, "FTP server error %d:%s", result, tmp_line);
ret = EOF;
}
}
@@ -132,7 +132,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream *
*/
static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
char **opened_path, php_stream_context *context, php_stream **preuseid,
- php_url **presource, int *puse_ssl, int *puse_ssl_on_data TSRMLS_DC)
+ php_url **presource, int *puse_ssl, int *puse_ssl_on_data)
{
php_stream *stream = NULL, *reuseid = NULL;
php_url *resource = NULL;
@@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
goto connect_errexit;
}
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
/* Start talking to ftp server */
@@ -203,9 +203,9 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
if (use_ssl) {
if (php_stream_xport_crypto_setup(stream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0
- || php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0
+ || php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(stream);
stream = NULL;
goto connect_errexit;
@@ -236,7 +236,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
unsigned char *s = val, *e = s + val_len; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, err_msg, val); \
+ php_stream_wrapper_log_error(wrapper, options, err_msg, val); \
goto connect_errexit; \
} \
s++; \
@@ -249,7 +249,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s")
- php_stream_printf(stream TSRMLS_CC, "USER %s\r\n", resource->user);
+ php_stream_printf(stream, "USER %s\r\n", resource->user);
} else {
php_stream_write_string(stream, "USER anonymous\r\n");
}
@@ -266,12 +266,12 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s")
- php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", resource->pass);
+ php_stream_printf(stream, "PASS %s\r\n", resource->pass);
} else {
/* if the user has configured who they are,
send that as the password */
if (FG(from_address)) {
- php_stream_printf(stream TSRMLS_CC, "PASS %s\r\n", FG(from_address));
+ php_stream_printf(stream, "PASS %s\r\n", FG(from_address));
} else {
php_stream_write_string(stream, "PASS anonymous\r\n");
}
@@ -320,7 +320,7 @@ connect_errexit:
/* {{{ php_fopen_do_pasv
*/
-static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart TSRMLS_DC)
+static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_size, char **phoststart)
{
char tmp_line[512];
int result, i;
@@ -412,7 +412,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_
/* {{{ php_fopen_url_wrap_ftp
*/
php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode,
- int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ int options, char **opened_path, php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL, *datastream = NULL;
php_url *resource = NULL;
@@ -436,7 +436,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
if (strpbrk(mode, "wa+")) {
if (read_write) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP does not support simultaneous read/write connections");
+ php_stream_wrapper_log_error(wrapper, options, "FTP does not support simultaneous read/write connections");
return NULL;
}
if (strchr(mode, 'a')) {
@@ -447,7 +447,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
if (!read_write) {
/* No mode specified? */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unknown file open mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unknown file open mode");
return NULL;
}
@@ -455,15 +455,15 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
(tmpzval = php_stream_context_get_option(context, "ftp", "proxy")) != NULL) {
if (read_write == 1) {
/* Use http wrapper to proxy ftp request */
- return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC);
+ return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC);
} else {
/* ftp proxy is read-only */
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP proxy may only be used in read mode");
+ php_stream_wrapper_log_error(wrapper, options, "FTP proxy may only be used in read mode");
return NULL;
}
}
- stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data);
if (!stream) {
goto errexit;
}
@@ -475,7 +475,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
/* find out the size of the file (verifying it exists) */
- php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path);
+ php_stream_printf(stream, "SIZE %s\r\n", resource->path);
/* read the response */
result = GET_FTP_RESULT(stream);
@@ -504,13 +504,13 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
if (allow_overwrite) {
/* Context permits overwriting file,
so we just delete whatever's there in preparation */
- php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path);
+ php_stream_printf(stream, "DELE %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result >= 300 || result <= 199) {
goto errexit;
}
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Remote file already exists and overwrite context option not specified");
+ php_stream_wrapper_log_error(wrapper, options, "Remote file already exists and overwrite context option not specified");
errno = EEXIST;
goto errexit;
}
@@ -518,7 +518,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
}
/* set up the passive connection */
- portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC);
+ portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart);
if (!portno) {
goto errexit;
@@ -531,10 +531,10 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
(tmpzval = php_stream_context_get_option(context, "ftp", "resume_pos")) != NULL &&
Z_TYPE_P(tmpzval) == IS_LONG &&
Z_LVAL_P(tmpzval) > 0) {
- php_stream_printf(stream TSRMLS_CC, "REST %pd\r\n", Z_LVAL_P(tmpzval));
+ php_stream_printf(stream, "REST %pd\r\n", Z_LVAL_P(tmpzval));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval));
+ php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval));
goto errexit;
}
}
@@ -548,7 +548,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
/* Append */
memcpy(tmp_line, "APPE", sizeof("APPE"));
}
- php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
@@ -571,14 +571,14 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
}
- php_stream_context_set(datastream, context TSRMLS_CC);
+ php_stream_context_set(datastream, context);
php_stream_notify_progress_init(context, 0, file_size);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) {
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(datastream, 1) < 0)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(datastream);
datastream = NULL;
goto errexit;
@@ -599,14 +599,14 @@ errexit:
php_stream_close(stream);
}
if (tmp_line[0] != '\0')
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line);
return NULL;
}
/* }}} */
/* {{{ php_ftp_dirsteam_read
*/
-static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count)
{
php_stream_dirent *ent = (php_stream_dirent *)buf;
php_stream *innerstream;
@@ -627,7 +627,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
return 0;
}
- basename = php_basename(ent->d_name, tmp_len, NULL, 0 TSRMLS_CC);
+ basename = php_basename(ent->d_name, tmp_len, NULL, 0);
tmp_len = MIN(sizeof(ent->d_name), basename->len - 1);
memcpy(ent->d_name, basename->val, tmp_len);
@@ -647,7 +647,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
/* {{{ php_ftp_dirstream_close
*/
-static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_ftp_dirstream_close(php_stream *stream, int close_handle)
{
php_ftp_dirstream_data *data = stream->abstract;
@@ -684,7 +684,7 @@ static php_stream_ops php_ftp_dirstream_ops = {
/* {{{ php_stream_ftp_opendir
*/
php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ char **opened_path, php_stream_context *context STREAMS_DC)
{
php_stream *stream, *reuseid, *datastream = NULL;
php_ftp_dirstream_data *dirsdata;
@@ -696,7 +696,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
tmp_line[0] = '\0';
- stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data);
if (!stream) {
goto opendir_errexit;
}
@@ -708,13 +708,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
/* set up the passive connection */
- portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC);
+ portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart);
if (!portno) {
goto opendir_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
/* open the data channel */
if (hoststart == NULL) {
@@ -735,13 +735,13 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_context_set(datastream, context TSRMLS_CC);
+ php_stream_context_set(datastream, context);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
- STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) {
+ STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0)) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
+ php_stream_wrapper_log_error(wrapper, options, "Unable to activate SSL mode");
php_stream_close(datastream);
datastream = NULL;
goto opendir_errexit;
@@ -765,7 +765,7 @@ opendir_errexit:
php_stream_close(stream);
}
if (tmp_line[0] != '\0') {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "FTP server reports %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "FTP server reports %s", tmp_line);
}
return NULL;
}
@@ -773,7 +773,7 @@ opendir_errexit:
/* {{{ php_stream_ftp_url_stat
*/
-static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -783,13 +783,13 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
/* If ssb is NULL then someone is misbehaving */
if (!ssb) return -1;
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL);
if (!stream) {
goto stat_errexit;
}
ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so approximate one based on being readable */
- php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
+ php_stream_printf(stream, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
ssb->sb.st_mode |= S_IFREG;
@@ -805,7 +805,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
goto stat_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
/* Failure either means it doesn't exist
@@ -820,7 +820,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
ssb->sb.st_size = atoi(tmp_line + 4);
}
- php_stream_printf(stream TSRMLS_CC, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result == 213) {
char *p = tmp_line + 4;
@@ -896,35 +896,35 @@ stat_errexit:
/* {{{ php_stream_ftp_unlink
*/
-static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto unlink_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto unlink_errexit;
}
/* Attempt to delete the file */
- php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Deleting file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Deleting file: %s", tmp_line);
}
goto unlink_errexit;
}
@@ -946,7 +946,7 @@ unlink_errexit:
/* {{{ php_stream_ftp_rename
*/
-static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_from, const char *url_to, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource_from = NULL, *resource_to = NULL;
@@ -974,32 +974,32 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
goto rename_errexit;
}
- stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", resource_from->host);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", resource_from->host);
}
goto rename_errexit;
}
/* Rename FROM */
- php_stream_printf(stream TSRMLS_CC, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
+ php_stream_printf(stream, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line);
}
goto rename_errexit;
}
/* Rename TO */
- php_stream_printf(stream TSRMLS_CC, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
+ php_stream_printf(stream, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error Renaming file: %s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "Error Renaming file: %s", tmp_line);
}
goto rename_errexit;
}
@@ -1025,30 +1025,30 @@ rename_errexit:
/* {{{ php_stream_ftp_mkdir
*/
-static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, int mode, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result, recursive = options & PHP_STREAM_MKDIR_RECURSIVE;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto mkdir_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto mkdir_errexit;
}
if (!recursive) {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
} else {
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
@@ -1060,7 +1060,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
/* find a top level directory we need to create */
while ((p = strrchr(buf, '/'))) {
*p = '\0';
- php_stream_printf(stream TSRMLS_CC, "CWD %s\r\n", buf);
+ php_stream_printf(stream, "CWD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result >= 200 && result <= 299) {
*p = '/';
@@ -1068,10 +1068,10 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
}
}
if (p == buf) {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
} else {
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf);
+ php_stream_printf(stream, "MKD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result >= 200 && result <= 299) {
if (!p) {
@@ -1081,11 +1081,11 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
while (++p != e) {
if (*p == '\0' && *(p + 1) != '\0') {
*p = '/';
- php_stream_printf(stream TSRMLS_CC, "MKD %s\r\n", buf);
+ php_stream_printf(stream, "MKD %s\r\n", buf);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_line);
}
break;
}
@@ -1119,34 +1119,34 @@ mkdir_errexit:
/* {{{ php_stream_ftp_rmdir
*/
-static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
+static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context)
{
php_stream *stream = NULL;
php_url *resource = NULL;
int result;
char tmp_line[512];
- stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL TSRMLS_CC);
+ stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to %s", url);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
}
goto rmdir_errexit;
}
if (resource->path == NULL) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path provided in %s", url);
+ php_error_docref(NULL, E_WARNING, "Invalid path provided in %s", url);
}
goto rmdir_errexit;
}
- php_stream_printf(stream TSRMLS_CC, "RMD %s\r\n", resource->path);
+ php_stream_printf(stream, "RMD %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tmp_line);
+ php_error_docref(NULL, E_WARNING, "%s", tmp_line);
}
goto rmdir_errexit;
}
diff --git a/ext/standard/head.c b/ext/standard/head.c
index 56f02a3989..6a7f8582a0 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -42,12 +42,12 @@ PHP_FUNCTION(header)
sapi_header_line ctr = {0};
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &ctr.line,
&len, &rep, &ctr.response_code) == FAILURE)
return;
ctr.line_len = (uint)len;
- sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr TSRMLS_CC);
+ sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr);
}
/* }}} */
@@ -58,18 +58,18 @@ PHP_FUNCTION(header_remove)
sapi_header_line ctr = {0};
size_t len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ctr.line,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ctr.line,
&len) == FAILURE)
return;
ctr.line_len = (uint)len;
- sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr TSRMLS_CC);
+ sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr);
}
/* }}} */
-PHPAPI int php_header(TSRMLS_D)
+PHPAPI int php_header(void)
{
- if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) {
+ if (sapi_send_headers()==FAILURE || SG(request_info).headers_only) {
return 0; /* don't allow output */
} else {
return 1; /* allow output */
@@ -77,7 +77,7 @@ PHPAPI int php_header(TSRMLS_D)
}
-PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly)
{
char *cookie;
size_t len=sizeof("Set-Cookie: ");
@@ -120,7 +120,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
* so in order to force cookies to be deleted, even on MSIE, we
* pick an expiry date in the past
*/
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, 1, 0);
snprintf(cookie, len + 100, "Set-Cookie: %s=deleted; expires=%s; Max-Age=0", name, dt->val);
zend_string_free(dt);
} else {
@@ -129,7 +129,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
const char *p;
char tsdelta[13];
strlcat(cookie, COOKIE_EXPIRES, len + 100);
- dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
+ dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0);
/* check to make sure that the year does not exceed 4 digits in length */
p = zend_memrchr(dt->val, '-', dt->len);
if (!p || *(p + 5) != ' ') {
@@ -170,7 +170,7 @@ PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_
ctr.line = cookie;
ctr.line_len = (uint)strlen(cookie);
- result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC);
+ result = sapi_header_op(SAPI_HEADER_ADD, &ctr);
efree(cookie);
return result;
}
@@ -186,13 +186,13 @@ PHP_FUNCTION(setcookie)
zend_bool secure = 0, httponly = 0;
size_t name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 1, httponly) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -209,13 +209,13 @@ PHP_FUNCTION(setrawcookie)
zend_bool secure = 0, httponly = 0;
size_t name_len, value_len = 0, path_len = 0, domain_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|slssbb", &name,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|slssbb", &name,
&name_len, &value, &value_len, &expires, &path,
&path_len, &domain, &domain_len, &secure, &httponly) == FAILURE) {
return;
}
- if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly TSRMLS_CC) == SUCCESS) {
+ if (php_setcookie(name, name_len, value, value_len, expires, path, path_len, domain, domain_len, secure, 0, httponly) == SUCCESS) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -232,12 +232,12 @@ PHP_FUNCTION(headers_sent)
const char *file="";
int line=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/z/", &arg1, &arg2) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z/z/", &arg1, &arg2) == FAILURE)
return;
if (SG(headers_sent)) {
- line = php_output_get_start_lineno(TSRMLS_C);
- file = php_output_get_start_filename(TSRMLS_C);
+ line = php_output_get_start_lineno();
+ file = php_output_get_start_filename();
}
switch(ZEND_NUM_ARGS()) {
@@ -264,7 +264,7 @@ PHP_FUNCTION(headers_sent)
/* {{{ php_head_apply_header_list_to_hash
Turn an llist of sapi_header_struct headers into a numerically indexed zval hash */
-static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC)
+static void php_head_apply_header_list_to_hash(void *data, void *arg)
{
sapi_header_struct *sapi_header = (sapi_header_struct *)data;
@@ -285,7 +285,7 @@ PHP_FUNCTION(headers_list)
RETURN_FALSE;
}
array_init(return_value);
- zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value TSRMLS_CC);
+ zend_llist_apply_with_argument(&SG(sapi_headers).headers, php_head_apply_header_list_to_hash, return_value);
}
/* }}} */
@@ -295,7 +295,7 @@ PHP_FUNCTION(http_response_code)
{
zend_long response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &response_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &response_code) == FAILURE) {
return;
}
diff --git a/ext/standard/head.h b/ext/standard/head.h
index 850a71dc74..1f272e0238 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -37,7 +37,7 @@ PHP_FUNCTION(headers_sent);
PHP_FUNCTION(headers_list);
PHP_FUNCTION(http_response_code);
-PHPAPI int php_header(TSRMLS_D);
-PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
+PHPAPI int php_header(void);
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly);
#endif
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 516bcc4ef7..18bab7d090 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -86,7 +86,7 @@
/* {{{ get_default_charset
*/
-static char *get_default_charset(TSRMLS_D) {
+static char *get_default_charset(void) {
if (PG(internal_encoding) && PG(internal_encoding)[0]) {
return PG(internal_encoding);
} else if (SG(default_charset) && SG(default_charset)[0] ) {
@@ -373,7 +373,7 @@ static inline unsigned int get_next_char(
/* {{{ entity_charset determine_charset
* returns the charset identifier based on current locale or a hint.
* defaults to UTF-8 */
-static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
+static enum entity_charset determine_charset(char *charset_hint)
{
int i;
enum entity_charset charset = cs_utf_8;
@@ -388,7 +388,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
goto det_charset;
}
- zenc = zend_multibyte_get_internal_encoding(TSRMLS_C);
+ zenc = zend_multibyte_get_internal_encoding();
if (zenc != NULL) {
charset_hint = (char *)zend_multibyte_get_encoding_name(zenc);
if (charset_hint != NULL && (len=strlen(charset_hint)) != 0) {
@@ -459,7 +459,7 @@ det_charset:
}
}
if (!found) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "charset `%s' not supported, assuming utf-8",
+ php_error_docref(NULL, E_WARNING, "charset `%s' not supported, assuming utf-8",
charset_hint);
}
}
@@ -1094,7 +1094,7 @@ static entity_table_opt determine_entity_table(int all, int doctype)
* only the basic ones, i.e., those in basic_entities_ex + the numeric entities
* that correspond to quotes.
*/
-PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC)
+PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset)
{
size_t retlen;
zend_string *ret;
@@ -1103,7 +1103,7 @@ PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen
size_t new_size = TRAVERSE_FOR_ENTITIES_EXPAND_SIZE(oldlen);
if (all) {
- charset = determine_charset(hint_charset TSRMLS_CC);
+ charset = determine_charset(hint_charset);
} else {
charset = cs_8859_1; /* charset shouldn't matter, use ISO-8859-1 for performance */
}
@@ -1134,9 +1134,9 @@ empty_source:
}
/* }}} */
-PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC)
+PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset)
{
- return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1 TSRMLS_CC);
+ return php_escape_html_entities_ex(old, oldlen, all, flags, hint_charset, 1);
}
/* {{{ find_entity_for_char */
@@ -1222,11 +1222,11 @@ static inline void find_entity_for_char_basic(
/* {{{ php_escape_html_entities
*/
-PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC)
+PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode)
{
size_t cursor, maxlen, len;
zend_string *replaced;
- enum entity_charset charset = determine_charset(hint_charset TSRMLS_CC);
+ enum entity_charset charset = determine_charset(hint_charset);
int doctype = flags & ENT_HTML_DOC_TYPE_MASK;
entity_table_opt entity_table;
const enc_to_uni *to_uni_table = NULL;
@@ -1237,7 +1237,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle
if (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) {
- php_error_docref0(NULL TSRMLS_CC, E_STRICT, "Only basic entities "
+ php_error_docref0(NULL, E_STRICT, "Only basic entities "
"substitution is supported for multi-byte encodings other than UTF-8; "
"functionality is equivalent to htmlspecialchars");
}
@@ -1449,7 +1449,7 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
zend_bool double_encode = 1;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) {
return;
}
#else
@@ -1463,9 +1463,9 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
#endif
if (!hint_charset) {
- default_charset = get_default_charset(TSRMLS_C);
+ default_charset = get_default_charset();
}
- replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode TSRMLS_CC);
+ replaced = php_escape_html_entities_ex((unsigned char*)str->val, str->len, all, (int) flags, (hint_charset ? hint_charset->val : default_charset), double_encode);
RETVAL_STR(replaced);
}
/* }}} */
@@ -1509,11 +1509,11 @@ PHP_FUNCTION(htmlspecialchars_decode)
zend_long quote_style = ENT_COMPAT;
zend_string *replaced;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &quote_style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &quote_style) == FAILURE) {
return;
}
- replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL TSRMLS_CC);
+ replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL);
if (replaced) {
RETURN_STR(replaced);
}
@@ -1531,7 +1531,7 @@ PHP_FUNCTION(html_entity_decode)
zend_string *replaced;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lS", &str,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS", &str,
&quote_style, &hint_charset) == FAILURE) {
return;
}
@@ -1545,9 +1545,9 @@ PHP_FUNCTION(html_entity_decode)
#endif
if (!hint_charset) {
- default_charset = get_default_charset(TSRMLS_C);
+ default_charset = get_default_charset();
}
- replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset) TSRMLS_CC);
+ replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, (int)quote_style, (hint_charset ? hint_charset->val : default_charset));
if (replaced) {
RETURN_STR(replaced);
@@ -1638,12 +1638,12 @@ PHP_FUNCTION(get_html_translation_table)
* getting the translated table from data structures that are optimized for
* random access, not traversal */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lls",
&all, &flags, &charset_hint, &charset_hint_len) == FAILURE) {
return;
}
- charset = determine_charset(charset_hint TSRMLS_CC);
+ charset = determine_charset(charset_hint);
doctype = flags & ENT_HTML_DOC_TYPE_MASK;
LIMIT_ALL(all, doctype, charset);
diff --git a/ext/standard/html.h b/ext/standard/html.h
index c7c297c90b..6fcea6b380 100644
--- a/ext/standard/html.h
+++ b/ext/standard/html.h
@@ -54,9 +54,9 @@ PHP_FUNCTION(htmlspecialchars_decode);
PHP_FUNCTION(html_entity_decode);
PHP_FUNCTION(get_html_translation_table);
-PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC);
-PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode TSRMLS_DC);
-PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset TSRMLS_DC);
+PHPAPI zend_string *php_escape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset);
+PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset, zend_bool double_encode);
+PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen, int all, int flags, char *hint_charset);
PHPAPI unsigned int php_next_utf8_char(const unsigned char *str, size_t str_len, size_t *cursor, int *status);
#endif /* HTML_H */
diff --git a/ext/standard/http.c b/ext/standard/http.c
index e5ba87d870..9c9d1dc530 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -29,7 +29,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, size_t num_prefix_len,
const char *key_prefix, size_t key_prefix_len,
const char *key_suffix, size_t key_suffix_len,
- zval *type, char *arg_sep, int enc_type TSRMLS_DC)
+ zval *type, char *arg_sep, int enc_type)
{
zend_string *key = NULL;
char *newprefix, *p;
@@ -62,7 +62,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *tmp;
zend_object *zobj = Z_OBJ_P(type);
- if (zend_check_property_access(zobj, key TSRMLS_CC) != SUCCESS) {
+ if (zend_check_property_access(zobj, key) != SUCCESS) {
/* private or protected property access outside of the class */
continue;
}
@@ -138,7 +138,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
ht->u.v.nApplyCount++;
}
- php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type TSRMLS_CC);
+ php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type);
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
ht->u.v.nApplyCount--;
}
@@ -233,16 +233,16 @@ PHP_FUNCTION(http_build_query)
smart_str formstr = {0};
zend_long enc_type = PHP_QUERY_RFC1738;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
RETURN_FALSE;
}
if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given");
+ php_error_docref(NULL, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given");
RETURN_FALSE;
}
- if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type TSRMLS_CC) == FAILURE) {
+ if (php_url_encode_hash_ex(HASH_OF(formdata), &formstr, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL), arg_sep, (int)enc_type) == FAILURE) {
if (formstr.s) {
smart_str_free(&formstr);
}
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index e1f8653c8d..032c6c7e36 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -111,7 +111,7 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
const char *path, const char *mode, int options, char **opened_path,
- php_stream_context *context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
+ php_stream_context *context, int redirect_max, int flags STREAMS_DC) /* {{{ */
{
php_stream *stream = NULL;
php_url *resource = NULL;
@@ -149,7 +149,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
tmp_line[0] = '\0';
if (redirect_max < 1) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Redirection limit reached, aborting");
+ php_stream_wrapper_log_error(wrapper, options, "Redirection limit reached, aborting");
return NULL;
}
@@ -177,7 +177,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
/* Normal http request (possibly with proxy) */
if (strpbrk(mode, "awx+")) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP wrapper does not support writeable connections");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not support writeable connections");
php_url_free(resource);
return NULL;
}
@@ -228,7 +228,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
}
if (errstr) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "%s", errstr->val);
+ php_stream_wrapper_log_error(wrapper, options, "%s", errstr->val);
zend_string_release(errstr);
errstr = NULL;
}
@@ -310,7 +310,7 @@ finish:
smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1);
if (php_stream_write(stream, header.s->val, header.s->len) != header.s->len) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -331,9 +331,9 @@ finish:
/* enable SSL transport layer */
if (stream) {
- if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL TSRMLS_CC) < 0 ||
- php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
+ if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_ANY_CLIENT, NULL) < 0 ||
+ php_stream_xport_crypto_enable(stream, 1) < 0) {
+ php_stream_wrapper_log_error(wrapper, options, "Cannot connect to HTTPS server through proxy");
php_stream_close(stream);
stream = NULL;
}
@@ -352,7 +352,7 @@ finish:
eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
- php_stream_context_set(stream, context TSRMLS_CC);
+ php_stream_context_set(stream, context);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
@@ -389,7 +389,7 @@ finish:
/* Should we send the entire path in the request line, default to no. */
if (!request_fulluri && context &&
(tmpzval = php_stream_context_get_option(context, "http", "request_fulluri")) != NULL) {
- request_fulluri = zend_is_true(tmpzval TSRMLS_CC);
+ request_fulluri = zend_is_true(tmpzval);
}
if (request_fulluri) {
@@ -440,13 +440,13 @@ finish:
smart_str_0(&tmpstr);
/* Remove newlines and spaces from start and end. there's at least one extra \r\n at the end that needs to go. */
if (tmpstr.s) {
- tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(tmpstr.s->val, tmpstr.s->len, NULL, 0, NULL, 3);
smart_str_free(&tmpstr);
}
}
if (Z_TYPE_P(tmpzval) == IS_STRING && Z_STRLEN_P(tmpzval)) {
/* Remove newlines and spaces from start and end php_trim will estrndup() */
- tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
+ tmp = php_trim(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), NULL, 0, NULL, 3);
}
if (tmp && tmp[0] != '\0') {
char *s;
@@ -602,7 +602,7 @@ finish:
ua[ua_len] = 0;
php_stream_write(stream, ua, ua_len);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot construct User-agent header");
+ php_error_docref(NULL, E_WARNING, "Cannot construct User-agent header");
}
if (ua) {
@@ -643,7 +643,7 @@ finish:
if (!(have_header & HTTP_HEADER_TYPE)) {
php_stream_write(stream, "Content-Type: application/x-www-form-urlencoded\r\n",
sizeof("Content-Type: application/x-www-form-urlencoded\r\n") - 1);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
+ php_error_docref(NULL, E_NOTICE, "Content-type not specified assuming application/x-www-form-urlencoded");
}
php_stream_write(stream, "\r\n", sizeof("\r\n")-1);
php_stream_write(stream, Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval));
@@ -653,12 +653,12 @@ finish:
location[0] = '\0';
- symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ symbol_table = zend_rebuild_symbol_table();
if (header_init) {
zval ztmp;
array_init(&ztmp);
- zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0 TSRMLS_CC);
+ zend_set_local_var_str("http_response_header", sizeof("http_response_header")-1, &ztmp, 0);
}
response_header = zend_hash_str_find_ind(&symbol_table->ht, "http_response_header", sizeof("http_response_header")-1);
@@ -676,7 +676,7 @@ finish:
response_code = 0;
}
if (context && NULL != (tmpzval = php_stream_context_get_option(context, "http", "ignore_errors"))) {
- ignore_errors = zend_is_true(tmpzval TSRMLS_CC);
+ ignore_errors = zend_is_true(tmpzval);
}
/* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) {
@@ -712,7 +712,7 @@ finish:
zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_response);
}
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed, unexpected end of socket!");
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed, unexpected end of socket!");
goto out;
}
@@ -727,7 +727,7 @@ finish:
if (*e != '\n') {
do { /* partial header */
if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers");
+ php_stream_wrapper_log_error(wrapper, options, "Failed to read HTTP headers");
goto out;
}
e = http_header_line + http_header_line_length - 1;
@@ -763,10 +763,10 @@ finish:
zend_long decode = 1;
if (context && (tmpzval = php_stream_context_get_option(context, "http", "auto_decode")) != NULL) {
- decode = zend_is_true(tmpzval TSRMLS_CC);
+ decode = zend_is_true(tmpzval);
}
if (decode) {
- transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream) TSRMLS_CC);
+ transfer_encoding = php_stream_filter_create("dechunk", NULL, php_stream_is_persistent(stream));
if (transfer_encoding) {
/* don't store transfer-encodeing header */
continue;
@@ -847,7 +847,7 @@ finish:
php_url_free(resource);
/* check for invalid redirection URLs */
if ((resource = php_url_parse(new_path)) == NULL) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path);
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path);
goto out;
}
@@ -859,7 +859,7 @@ finish:
s = (unsigned char*)val; e = s + l; \
while (s < e) { \
if (iscntrl(*s)) { \
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Invalid redirect URL! %s", new_path); \
+ php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \
goto out; \
} \
s++; \
@@ -872,9 +872,9 @@ finish:
CHECK_FOR_CNTRL_CHARS(resource->pass)
CHECK_FOR_CNTRL_CHARS(resource->path)
}
- stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC TSRMLS_CC);
+ stream = php_stream_url_wrap_http_ex(wrapper, new_path, mode, options, opened_path, context, --redirect_max, HTTP_WRAPPER_REDIRECTED STREAMS_CC);
} else {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed! %s", tmp_line);
+ php_stream_wrapper_log_error(wrapper, options, "HTTP request failed! %s", tmp_line);
}
}
out:
@@ -918,20 +918,20 @@ out:
php_stream_filter_append(&stream->readfilters, transfer_encoding);
}
} else if (transfer_encoding) {
- php_stream_filter_free(transfer_encoding TSRMLS_CC);
+ php_stream_filter_free(transfer_encoding);
}
return stream;
}
/* }}} */
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
- return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC TSRMLS_CC);
+ return php_stream_url_wrap_http_ex(wrapper, path, mode, options, opened_path, context, PHP_URL_REDIRECT_MAX, HTTP_WRAPPER_HEADER_INIT STREAMS_CC);
}
/* }}} */
-static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_stream_http_stream_stat(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
/* one day, we could fill in the details based on Date: and Content-Length:
* headers. For now, we return with a failure code to prevent the underlying
diff --git a/ext/standard/image.c b/ext/standard/image.c
index adeb1c5be6..4828a48623 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -100,7 +100,7 @@ PHP_MINIT_FUNCTION(imagetypes)
/* {{{ php_handle_gif
* routine to handle GIF files. If only everything were that easy... ;} */
-static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_gif (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[5];
@@ -123,7 +123,7 @@ static struct gfxinfo *php_handle_gif (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_psd
*/
-static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_psd (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[8];
@@ -144,7 +144,7 @@ static struct gfxinfo *php_handle_psd (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_bmp
*/
-static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_bmp (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[16];
@@ -195,7 +195,7 @@ static unsigned long int php_swf_get_bits (unsigned char* buffer, unsigned int p
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
/* {{{ php_handle_swc
*/
-static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_swc(php_stream * stream)
{
struct gfxinfo *result = NULL;
@@ -268,7 +268,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_swf
*/
-static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_swf (php_stream * stream)
{
struct gfxinfo *result = NULL;
long bits;
@@ -294,7 +294,7 @@ static struct gfxinfo *php_handle_swf (php_stream * stream TSRMLS_DC)
/* {{{ php_handle_png
* routine to handle PNG files */
-static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_png (php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[9];
@@ -362,7 +362,7 @@ static struct gfxinfo *php_handle_png (php_stream * stream TSRMLS_DC)
/* {{{ php_read2
*/
-static unsigned short php_read2(php_stream * stream TSRMLS_DC)
+static unsigned short php_read2(php_stream * stream)
{
unsigned char a[2];
@@ -375,7 +375,7 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC)
/* {{{ php_next_marker
* get next marker byte from file */
-static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read TSRMLS_DC)
+static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read)
{
int a=0, marker;
@@ -423,9 +423,9 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co
/* {{{ php_skip_variable
* skip over a variable-length block; assumes proper length marker */
-static int php_skip_variable(php_stream * stream TSRMLS_DC)
+static int php_skip_variable(php_stream * stream)
{
- zend_off_t length = ((unsigned int)php_read2(stream TSRMLS_CC));
+ zend_off_t length = ((unsigned int)php_read2(stream));
if (length < 2) {
return 0;
@@ -438,14 +438,14 @@ static int php_skip_variable(php_stream * stream TSRMLS_DC)
/* {{{ php_read_APP
*/
-static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSRMLS_DC)
+static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
{
unsigned short length;
char *buffer;
char markername[16];
zval *tmp;
- length = php_read2(stream TSRMLS_CC);
+ length = php_read2(stream);
if (length < 2) {
return 0;
}
@@ -472,14 +472,14 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
/* {{{ php_handle_jpeg
main loop to parse JPEG structure */
-static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_DC)
+static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info)
{
struct gfxinfo *result = NULL;
unsigned int marker = M_PSEUDO;
unsigned short length, ff_read=1;
for (;;) {
- marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC);
+ marker = php_next_marker(stream, marker, 1, ff_read);
ff_read = 0;
switch (marker) {
case M_SOF0:
@@ -498,10 +498,10 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
if (result == NULL) {
/* handle SOFn block */
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
- length = php_read2(stream TSRMLS_CC);
+ length = php_read2(stream);
result->bits = php_stream_getc(stream);
- result->height = php_read2(stream TSRMLS_CC);
- result->width = php_read2(stream TSRMLS_CC);
+ result->height = php_read2(stream);
+ result->width = php_read2(stream);
result->channels = php_stream_getc(stream);
if (!info || length < 8) { /* if we don't want an extanded info -> return */
return result;
@@ -510,7 +510,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
return result;
}
} else {
- if (!php_skip_variable(stream TSRMLS_CC)) {
+ if (!php_skip_variable(stream)) {
return result;
}
}
@@ -533,11 +533,11 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
case M_APP14:
case M_APP15:
if (info) {
- if (!php_read_APP(stream, marker, info TSRMLS_CC)) { /* read all the app marks... */
+ if (!php_read_APP(stream, marker, info)) { /* read all the app marks... */
return result;
}
} else {
- if (!php_skip_variable(stream TSRMLS_CC)) {
+ if (!php_skip_variable(stream)) {
return result;
}
}
@@ -548,7 +548,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
return result; /* we're about to hit image data, or are at EOF. stop processing. */
default:
- if (!php_skip_variable(stream TSRMLS_CC)) { /* anything else isn't interesting */
+ if (!php_skip_variable(stream)) { /* anything else isn't interesting */
return result;
}
break;
@@ -561,7 +561,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D
/* {{{ php_read4
*/
-static unsigned int php_read4(php_stream * stream TSRMLS_DC)
+static unsigned int php_read4(php_stream * stream)
{
unsigned char a[4];
@@ -601,7 +601,7 @@ static unsigned int php_read4(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_jpc
Main loop to parse JPEG2000 raw codestream structure */
-static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_jpc(php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned short dummy_short;
@@ -621,24 +621,24 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
/* Ensure that this marker is SIZ (as is mandated by the standard) */
if (first_marker_id != JPEG2000_MARKER_SIZ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)");
+ php_error_docref(NULL, E_WARNING, "JPEG2000 codestream corrupt(Expected SIZ marker not found after SOC)");
return NULL;
}
result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo));
- dummy_short = php_read2(stream TSRMLS_CC); /* Lsiz */
- dummy_short = php_read2(stream TSRMLS_CC); /* Rsiz */
- result->width = php_read4(stream TSRMLS_CC); /* Xsiz */
- result->height = php_read4(stream TSRMLS_CC); /* Ysiz */
+ dummy_short = php_read2(stream); /* Lsiz */
+ dummy_short = php_read2(stream); /* Rsiz */
+ result->width = php_read4(stream); /* Xsiz */
+ result->height = php_read4(stream); /* Ysiz */
#if MBO_0
- php_read4(stream TSRMLS_CC); /* XOsiz */
- php_read4(stream TSRMLS_CC); /* YOsiz */
- php_read4(stream TSRMLS_CC); /* XTsiz */
- php_read4(stream TSRMLS_CC); /* YTsiz */
- php_read4(stream TSRMLS_CC); /* XTOsiz */
- php_read4(stream TSRMLS_CC); /* YTOsiz */
+ php_read4(stream); /* XOsiz */
+ php_read4(stream); /* YOsiz */
+ php_read4(stream); /* XTsiz */
+ php_read4(stream); /* YTsiz */
+ php_read4(stream); /* XTOsiz */
+ php_read4(stream); /* YTOsiz */
#else
if (php_stream_seek(stream, 24, SEEK_CUR)) {
efree(result);
@@ -646,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
}
#endif
- result->channels = php_read2(stream TSRMLS_CC); /* Csiz */
+ result->channels = php_read2(stream); /* Csiz */
if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
efree(result);
return NULL;
@@ -673,7 +673,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
/* {{{ php_handle_jp2
main loop to parse JPEG 2000 JP2 wrapper format structure */
-static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
+static struct gfxinfo *php_handle_jp2(php_stream *stream)
{
struct gfxinfo *result = NULL;
unsigned int box_length;
@@ -691,7 +691,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
for (;;)
{
- box_length = php_read4(stream TSRMLS_CC); /* LBox */
+ box_length = php_read4(stream); /* LBox */
/* TBox */
if (php_stream_read(stream, (void *)&box_type, sizeof(box_type)) != sizeof(box_type)) {
/* Use this as a general "out of stream" error */
@@ -708,7 +708,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
/* Skip the first 3 bytes to emulate the file type examination */
php_stream_seek(stream, 3, SEEK_CUR);
- result = php_handle_jpc(stream TSRMLS_CC);
+ result = php_handle_jpc(stream);
break;
}
@@ -724,7 +724,7 @@ static struct gfxinfo *php_handle_jp2(php_stream *stream TSRMLS_DC)
}
if (result == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "JP2 file has no codestreams at root level");
+ php_error_docref(NULL, E_WARNING, "JP2 file has no codestreams at root level");
}
return result;
@@ -800,7 +800,7 @@ static unsigned php_ifd_get32u(void *Long, int motorola_intel)
/* {{{ php_handle_tiff
main loop to parse TIFF structure */
-static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel TSRMLS_DC)
+static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int motorola_intel)
{
struct gfxinfo *result = NULL;
int i, num_entries;
@@ -881,7 +881,7 @@ static struct gfxinfo *php_handle_tiff (php_stream * stream, zval *info, int mot
/* {{{ php_handle_psd
*/
-static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_iff(php_stream * stream)
{
struct gfxinfo * result;
unsigned char a[10];
@@ -942,7 +942,7 @@ static struct gfxinfo *php_handle_iff(php_stream * stream TSRMLS_DC)
* int Number of columns
* int Number of rows
*/
-static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check TSRMLS_DC)
+static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check)
{
int i, width = 0, height = 0;
@@ -997,11 +997,11 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check T
/* {{{ php_handle_wbmp
*/
-static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_wbmp(php_stream * stream)
{
struct gfxinfo *result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
- if (!php_get_wbmp(stream, &result, 0 TSRMLS_CC)) {
+ if (!php_get_wbmp(stream, &result, 0)) {
efree(result);
return NULL;
}
@@ -1012,7 +1012,7 @@ static struct gfxinfo *php_handle_wbmp(php_stream * stream TSRMLS_DC)
/* {{{ php_get_xbm
*/
-static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC)
+static int php_get_xbm(php_stream *stream, struct gfxinfo **result)
{
char *fline;
char *iname;
@@ -1072,17 +1072,17 @@ static int php_get_xbm(php_stream *stream, struct gfxinfo **result TSRMLS_DC)
/* {{{ php_handle_xbm
*/
-static struct gfxinfo *php_handle_xbm(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_xbm(php_stream * stream)
{
struct gfxinfo *result;
- php_get_xbm(stream, &result TSRMLS_CC);
+ php_get_xbm(stream, &result);
return result;
}
/* }}} */
/* {{{ php_handle_ico
*/
-static struct gfxinfo *php_handle_ico(php_stream * stream TSRMLS_DC)
+static struct gfxinfo *php_handle_ico(php_stream * stream)
{
struct gfxinfo *result = NULL;
unsigned char dim[16];
@@ -1162,7 +1162,7 @@ PHP_FUNCTION(image_type_to_mime_type)
{
zend_long p_image_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &p_image_type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &p_image_type) == FAILURE) {
return;
}
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(image_type_to_extension)
zend_long image_type;
zend_bool inc_dot=1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|b", &image_type, &inc_dot) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|b", &image_type, &inc_dot) == FAILURE) {
RETURN_FALSE;
}
@@ -1221,13 +1221,13 @@ PHP_FUNCTION(image_type_to_extension)
/* {{{ php_imagetype
detect filetype from first bytes */
-PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
+PHPAPI int php_getimagetype(php_stream * stream, char *filetype)
{
char tmp[12];
if ( !filetype) filetype = tmp;
if((php_stream_read(stream, filetype, 3)) != 3) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
@@ -1238,13 +1238,13 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
return IMAGE_FILETYPE_JPEG;
} else if (!memcmp(filetype, php_sig_png, 3)) {
if (php_stream_read(stream, filetype+3, 5) != 5) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
if (!memcmp(filetype, php_sig_png, 8)) {
return IMAGE_FILETYPE_PNG;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "PNG file corrupted by ASCII conversion");
+ php_error_docref(NULL, E_WARNING, "PNG file corrupted by ASCII conversion");
return IMAGE_FILETYPE_UNKNOWN;
}
} else if (!memcmp(filetype, php_sig_swf, 3)) {
@@ -1260,7 +1260,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
if (php_stream_read(stream, filetype+3, 1) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
/* BYTES READ: 4 */
@@ -1275,7 +1275,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
if (php_stream_read(stream, filetype+4, 8) != 8) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Read error!");
+ php_error_docref(NULL, E_NOTICE, "Read error!");
return IMAGE_FILETYPE_UNKNOWN;
}
/* BYTES READ: 12 */
@@ -1284,10 +1284,10 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
}
/* AFTER ALL ABOVE FAILED */
- if (php_get_wbmp(stream, NULL, 1 TSRMLS_CC)) {
+ if (php_get_wbmp(stream, NULL, 1)) {
return IMAGE_FILETYPE_WBMP;
}
- if (php_get_xbm(stream, NULL TSRMLS_CC)) {
+ if (php_get_xbm(stream, NULL)) {
return IMAGE_FILETYPE_XBM;
}
return IMAGE_FILETYPE_UNKNOWN;
@@ -1303,60 +1303,60 @@ static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNA
RETURN_FALSE;
}
- itype = php_getimagetype(stream, NULL TSRMLS_CC);
+ itype = php_getimagetype(stream, NULL);
switch( itype) {
case IMAGE_FILETYPE_GIF:
- result = php_handle_gif(stream TSRMLS_CC);
+ result = php_handle_gif(stream);
break;
case IMAGE_FILETYPE_JPEG:
if (info) {
- result = php_handle_jpeg(stream, info TSRMLS_CC);
+ result = php_handle_jpeg(stream, info);
} else {
- result = php_handle_jpeg(stream, NULL TSRMLS_CC);
+ result = php_handle_jpeg(stream, NULL);
}
break;
case IMAGE_FILETYPE_PNG:
- result = php_handle_png(stream TSRMLS_CC);
+ result = php_handle_png(stream);
break;
case IMAGE_FILETYPE_SWF:
- result = php_handle_swf(stream TSRMLS_CC);
+ result = php_handle_swf(stream);
break;
case IMAGE_FILETYPE_SWC:
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB)
- result = php_handle_swc(stream TSRMLS_CC);
+ result = php_handle_swc(stream);
#else
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
+ php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
#endif
break;
case IMAGE_FILETYPE_PSD:
- result = php_handle_psd(stream TSRMLS_CC);
+ result = php_handle_psd(stream);
break;
case IMAGE_FILETYPE_BMP:
- result = php_handle_bmp(stream TSRMLS_CC);
+ result = php_handle_bmp(stream);
break;
case IMAGE_FILETYPE_TIFF_II:
- result = php_handle_tiff(stream, NULL, 0 TSRMLS_CC);
+ result = php_handle_tiff(stream, NULL, 0);
break;
case IMAGE_FILETYPE_TIFF_MM:
- result = php_handle_tiff(stream, NULL, 1 TSRMLS_CC);
+ result = php_handle_tiff(stream, NULL, 1);
break;
case IMAGE_FILETYPE_JPC:
- result = php_handle_jpc(stream TSRMLS_CC);
+ result = php_handle_jpc(stream);
break;
case IMAGE_FILETYPE_JP2:
- result = php_handle_jp2(stream TSRMLS_CC);
+ result = php_handle_jp2(stream);
break;
case IMAGE_FILETYPE_IFF:
- result = php_handle_iff(stream TSRMLS_CC);
+ result = php_handle_iff(stream);
break;
case IMAGE_FILETYPE_WBMP:
- result = php_handle_wbmp(stream TSRMLS_CC);
+ result = php_handle_wbmp(stream);
break;
case IMAGE_FILETYPE_XBM:
- result = php_handle_xbm(stream TSRMLS_CC);
+ result = php_handle_xbm(stream);
break;
case IMAGE_FILETYPE_ICO:
- result = php_handle_ico(stream TSRMLS_CC);
+ result = php_handle_ico(stream);
break;
default:
case IMAGE_FILETYPE_UNKNOWN:
@@ -1396,7 +1396,7 @@ static void php_getimagesize_from_any(INTERNAL_FUNCTION_PARAMETERS, int mode) {
size_t input_len;
const int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "s|z/", &input, &input_len, &info) == FAILURE) {
+ if (zend_parse_parameters(argc, "s|z/", &input, &input_len, &info) == FAILURE) {
return;
}
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index bb1b9c5a6a..6d5ef77e2d 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -34,24 +34,24 @@ static zend_object_handlers php_incomplete_object_handlers;
/* {{{ incomplete_class_message
*/
-static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
+static void incomplete_class_message(zval *object, int error_type)
{
zend_string *class_name;
class_name = php_lookup_class_name(object);
if (class_name) {
- php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name->val);
+ php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, class_name->val);
zend_string_release(class_name);
} else {
- php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, "unknown");
+ php_error_docref(NULL, error_type, INCOMPLETE_CLASS_MSG, "unknown");
}
}
/* }}} */
-static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *incomplete_class_get_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
if (type == BP_VAR_W || type == BP_VAR_RW) {
return &EG(error_zval);
@@ -61,49 +61,49 @@ static zval *incomplete_class_get_property(zval *object, zval *member, int type,
}
/* }}} */
-static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */
+static void incomplete_class_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
}
/* }}} */
-static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *incomplete_class_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
return &EG(error_zval);
}
/* }}} */
-static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */
+static void incomplete_class_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
}
/* }}} */
-static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) /* {{{ */
+static int incomplete_class_has_property(zval *object, zval *member, int check_empty, void **cache_slot) /* {{{ */
{
- incomplete_class_message(object, E_NOTICE TSRMLS_CC);
+ incomplete_class_message(object, E_NOTICE);
return 0;
}
/* }}} */
-static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */
+static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
zval zobject;
ZVAL_OBJ(&zobject, *object);
- incomplete_class_message(&zobject, E_ERROR TSRMLS_CC);
+ incomplete_class_message(&zobject, E_ERROR);
return NULL;
}
/* }}} */
/* {{{ php_create_incomplete_class
*/
-static zend_object *php_create_incomplete_object(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
{
zend_object *object;
- object = zend_objects_new( class_type TSRMLS_CC);
+ object = zend_objects_new( class_type);
object->handlers = &php_incomplete_object_handlers;
object_properties_init(object, class_type);
@@ -111,7 +111,7 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type TS
return object;
}
-PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D)
+PHPAPI zend_class_entry *php_create_incomplete_class(void)
{
zend_class_entry incomplete_class;
@@ -126,7 +126,7 @@ PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D)
php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr;
php_incomplete_object_handlers.get_method = incomplete_class_get_method;
- return zend_register_internal_class(&incomplete_class TSRMLS_CC);
+ return zend_register_internal_class(&incomplete_class);
}
/* }}} */
@@ -136,7 +136,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
{
zval *val;
HashTable *object_properties;
- TSRMLS_FETCH();
object_properties = Z_OBJPROP_P(object);
@@ -153,7 +152,6 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
PHPAPI void php_store_class_name(zval *object, const char *name, size_t len)
{
zval val;
- TSRMLS_FETCH();
ZVAL_STRINGL(&val, name, len);
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 7a118af7b4..8c00c521fd 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -65,10 +65,9 @@ static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */
{
size_t written;
zend_string *new_str;
- TSRMLS_FETCH();
- new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8" TSRMLS_CC);
- written = php_output_write(new_str->val, new_str->len TSRMLS_CC);
+ new_str = php_escape_html_entities((unsigned char *) str, len, 0, ENT_QUOTES, "utf-8");
+ written = php_output_write(new_str->val, new_str->len);
zend_string_free(new_str);
return written;
}
@@ -79,13 +78,12 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
char *buf;
size_t len, written;
va_list argv;
- TSRMLS_FETCH();
va_start(argv, fmt);
len = vspprintf(&buf, 0, fmt, argv);
va_end(argv);
- written = php_output_write(buf, len TSRMLS_CC);
+ written = php_output_write(buf, len);
efree(buf);
return written;
}
@@ -93,12 +91,11 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
static int php_info_print(const char *str) /* {{{ */
{
- TSRMLS_FETCH();
- return php_output_write(str, strlen(str) TSRMLS_CC);
+ return php_output_write(str, strlen(str));
}
/* }}} */
-static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC) /* {{{ */
+static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */
{
zend_string *key;
@@ -142,7 +139,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
}
/* }}} */
-PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {{{ */
+PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */
{
if (zend_module->info_func || zend_module->version) {
if (!sapi_module.phpinfo_as_text) {
@@ -153,7 +150,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
php_info_print_table_end();
}
if (zend_module->info_func) {
- zend_module->info_func(zend_module TSRMLS_CC);
+ zend_module->info_func(zend_module);
} else {
php_info_print_table_start();
php_info_print_table_row(2, "Version", zend_module->version);
@@ -170,21 +167,21 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module TSRMLS_DC) /* {
}
/* }}} */
-static int _display_module_info_func(zval *el TSRMLS_DC) /* {{{ */
+static int _display_module_info_func(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
if (module->info_func || module->version) {
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
-static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */
+static int _display_module_info_def(zval *el) /* {{{ */
{
zend_module_entry *module = (zend_module_entry*)Z_PTR_P(el);
if (!module->info_func && !module->version) {
- php_info_print_module(module TSRMLS_CC);
+ php_info_print_module(module);
}
return ZEND_HASH_APPLY_KEEP;
}
@@ -192,7 +189,7 @@ static int _display_module_info_def(zval *el TSRMLS_DC) /* {{{ */
/* {{{ php_print_gpcse_array
*/
-static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
+static void php_print_gpcse_array(char *name, uint name_length)
{
zval *data, *tmp, tmp2;
zend_string *string_key;
@@ -200,7 +197,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
zend_string *key;
key = zend_string_init(name, name_length, 0);
- zend_is_auto_global(key TSRMLS_CC);
+ zend_is_auto_global(key);
if ((data = zend_hash_find(&EG(symbol_table).ht, key)) != NULL && (Z_TYPE_P(data) == IS_ARRAY)) {
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), num_key, string_key, tmp) {
@@ -230,10 +227,10 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
if (Z_TYPE_P(tmp) == IS_ARRAY) {
if (!sapi_module.phpinfo_as_text) {
php_info_print("<pre>");
- zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0 TSRMLS_CC);
+ zend_print_zval_r_ex((zend_write_func_t) php_info_print_html_esc, tmp, 0);
php_info_print("</pre>");
} else {
- zend_print_zval_r(tmp, 0 TSRMLS_CC);
+ zend_print_zval_r(tmp, 0);
}
} else {
ZVAL_COPY_VALUE(&tmp2, tmp);
@@ -270,19 +267,19 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
/* {{{ php_info_print_style
*/
-void php_info_print_style(TSRMLS_D)
+void php_info_print_style(void)
{
php_info_printf("<style type=\"text/css\">\n");
- php_info_print_css(TSRMLS_C);
+ php_info_print_css();
php_info_printf("</style>\n");
}
/* }}} */
/* {{{ php_info_html_esc
*/
-PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC)
+PHPAPI zend_string *php_info_html_esc(char *string)
{
- return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL TSRMLS_CC);
+ return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL);
}
/* }}} */
@@ -663,12 +660,12 @@ PHPAPI zend_string *php_get_uname(char mode)
/* {{{ php_print_info_htmlhead
*/
-PHPAPI void php_print_info_htmlhead(TSRMLS_D)
+PHPAPI void php_print_info_htmlhead(void)
{
php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
php_info_print("<head>\n");
- php_info_print_style(TSRMLS_C);
+ php_info_print_style();
php_info_print("<title>phpinfo()</title>");
php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
php_info_print("</head>\n");
@@ -677,7 +674,7 @@ PHPAPI void php_print_info_htmlhead(TSRMLS_D)
/* }}} */
/* {{{ module_name_cmp */
-static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
+static int module_name_cmp(const void *a, const void *b)
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -689,13 +686,13 @@ static int module_name_cmp(const void *a, const void *b TSRMLS_DC)
/* {{{ php_print_info
*/
-PHPAPI void php_print_info(int flag TSRMLS_DC)
+PHPAPI void php_print_info(int flag)
{
char **env, *tmp1, *tmp2;
zend_string *php_uname;
if (!sapi_module.phpinfo_as_text) {
- php_print_info_htmlhead(TSRMLS_C);
+ php_print_info_htmlhead();
} else {
php_info_print("phpinfo()\n");
}
@@ -789,10 +786,10 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "Zend Signal Handling", "disabled" );
#endif
- php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm(TSRMLS_C) ? "enabled" : "disabled" );
+ php_info_print_table_row(2, "Zend Memory Manager", is_zend_mm() ? "enabled" : "disabled" );
{
- const zend_multibyte_functions *functions = zend_multibyte_get_functions(TSRMLS_C);
+ const zend_multibyte_functions *functions = zend_multibyte_get_functions();
char *descr;
if (functions) {
spprintf(&descr, 0, "provided by %s", functions->provider_name);
@@ -815,9 +812,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_table_row(2, "DTrace Support", "disabled" );
#endif
- php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash() TSRMLS_CC);
- php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash() TSRMLS_CC);
- php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash() TSRMLS_CC);
+ php_info_print_stream_hash("PHP Streams", php_stream_get_url_stream_wrappers_hash());
+ php_info_print_stream_hash("Stream Socket Transports", php_stream_xport_get_hash());
+ php_info_print_stream_hash("Stream Filters", php_get_stream_filters_hash());
php_info_print_table_end();
@@ -832,13 +829,13 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if (sapi_module.phpinfo_as_text) {
php_info_print(zend_version);
} else {
- zend_html_puts(zend_version, strlen(zend_version) TSRMLS_CC);
+ zend_html_puts(zend_version, strlen(zend_version));
}
php_info_print_box_end();
zend_string_free(php_uname);
}
- zend_ini_sort_entries(TSRMLS_C);
+ zend_ini_sort_entries();
if (flag & PHP_INFO_CONFIGURATION) {
php_info_print_hr();
@@ -858,14 +855,14 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1);
zend_hash_copy(&sorted_registry, &module_registry, NULL);
- zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC);
+ zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0);
- zend_hash_apply(&sorted_registry, _display_module_info_func TSRMLS_CC);
+ zend_hash_apply(&sorted_registry, _display_module_info_func);
SECTION("Additional Modules");
php_info_print_table_start();
php_info_print_table_header(1, "Module Name");
- zend_hash_apply(&sorted_registry, _display_module_info_def TSRMLS_CC);
+ zend_hash_apply(&sorted_registry, _display_module_info_def);
php_info_print_table_end();
zend_hash_destroy(&sorted_registry);
@@ -908,20 +905,20 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
if ((data = zend_hash_str_find(&EG(symbol_table).ht, "PHP_AUTH_PW", sizeof("PHP_AUTH_PW")-1)) != NULL && Z_TYPE_P(data) == IS_STRING) {
php_info_print_table_row(2, "PHP_AUTH_PW", Z_STRVAL_P(data));
}
- php_print_gpcse_array(ZEND_STRL("_REQUEST") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_GET") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_POST") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_FILES") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_COOKIE") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_SERVER") TSRMLS_CC);
- php_print_gpcse_array(ZEND_STRL("_ENV") TSRMLS_CC);
+ php_print_gpcse_array(ZEND_STRL("_REQUEST"));
+ php_print_gpcse_array(ZEND_STRL("_GET"));
+ php_print_gpcse_array(ZEND_STRL("_POST"));
+ php_print_gpcse_array(ZEND_STRL("_FILES"));
+ php_print_gpcse_array(ZEND_STRL("_COOKIE"));
+ php_print_gpcse_array(ZEND_STRL("_SERVER"));
+ php_print_gpcse_array(ZEND_STRL("_ENV"));
php_info_print_table_end();
}
if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
php_info_print_hr();
- php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE TSRMLS_CC);
+ php_print_credits(PHP_CREDITS_ALL & ~PHP_CREDITS_FULLPAGE);
}
if (flag & PHP_INFO_LICENSE) {
@@ -1170,14 +1167,14 @@ PHP_FUNCTION(phpinfo)
{
zend_long flag = PHP_INFO_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
return;
}
/* Andale! Andale! Yee-Hah! */
- php_output_start_default(TSRMLS_C);
- php_print_info((int)flag TSRMLS_CC);
- php_output_end(TSRMLS_C);
+ php_output_start_default();
+ php_print_info((int)flag);
+ php_output_end();
RETURN_TRUE;
}
@@ -1191,7 +1188,7 @@ PHP_FUNCTION(phpversion)
char *ext_name = NULL;
size_t ext_name_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ext_name, &ext_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ext_name, &ext_name_len) == FAILURE) {
return;
}
@@ -1214,11 +1211,11 @@ PHP_FUNCTION(phpcredits)
{
zend_long flag = PHP_CREDITS_ALL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
return;
}
- php_print_credits((int)flag TSRMLS_CC);
+ php_print_credits((int)flag);
RETURN_TRUE;
}
/* }}} */
@@ -1247,7 +1244,7 @@ PHP_FUNCTION(php_uname)
char *mode = "a";
size_t modelen = sizeof("a")-1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &mode, &modelen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &mode, &modelen) == FAILURE) {
return;
}
RETURN_STR(php_get_uname(*mode));
diff --git a/ext/standard/info.h b/ext/standard/info.h
index a28ac564ab..f54325fdaf 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -63,12 +63,12 @@ PHP_FUNCTION(php_sapi_name);
PHP_FUNCTION(php_uname);
PHP_FUNCTION(php_ini_scanned_files);
PHP_FUNCTION(php_ini_loaded_file);
-PHPAPI zend_string *php_info_html_esc(char *string TSRMLS_DC);
-PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC);
-PHPAPI void php_print_info_htmlhead(TSRMLS_D);
-PHPAPI void php_print_info(int flag TSRMLS_DC);
+PHPAPI zend_string *php_info_html_esc(char *string);
+PHPAPI void php_info_html_esc_write(char *string, int str_len);
+PHPAPI void php_print_info_htmlhead(void);
+PHPAPI void php_print_info(int flag);
PHPAPI void php_print_style(void);
-PHPAPI void php_info_print_style(TSRMLS_D);
+PHPAPI void php_info_print_style(void);
PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header);
PHPAPI void php_info_print_table_header(int num_cols, ...);
PHPAPI void php_info_print_table_row(int num_cols, ...);
@@ -78,7 +78,7 @@ PHPAPI void php_info_print_table_end(void);
PHPAPI void php_info_print_box_start(int bg);
PHPAPI void php_info_print_box_end(void);
PHPAPI void php_info_print_hr(void);
-PHPAPI void php_info_print_module(zend_module_entry *module TSRMLS_DC);
+PHPAPI void php_info_print_module(zend_module_entry *module);
PHPAPI zend_string *php_get_uname(char mode);
void register_phpinfo_constants(INIT_FUNC_ARGS);
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index 75bbdd22ce..c536f4b19f 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -75,7 +75,7 @@
/* {{{ php_iptc_put1
*/
-static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf)
{
if (spool > 0)
PUTC(c);
@@ -88,7 +88,7 @@ static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **s
/* {{{ php_iptc_get1
*/
-static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf)
{
int c;
char cc;
@@ -110,9 +110,9 @@ static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC
/* {{{ php_iptc_read_remaining
*/
-static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf)
{
- while (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) != EOF) continue;
+ while (php_iptc_get1(fp, spool, spoolbuf) != EOF) continue;
return M_EOI;
}
@@ -120,21 +120,21 @@ static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf
/* {{{ php_iptc_skip_variable
*/
-static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf)
{
unsigned int length;
int c1, c2;
- if ((c1 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
+ if ((c1 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI;
- if ((c2 = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF) return M_EOI;
+ if ((c2 = php_iptc_get1(fp, spool, spoolbuf)) == EOF) return M_EOI;
length = (((unsigned char) c1) << 8) + ((unsigned char) c2);
length -= 2;
while (length--)
- if (php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC) == EOF) return M_EOI;
+ if (php_iptc_get1(fp, spool, spoolbuf) == EOF) return M_EOI;
return 0;
}
@@ -142,29 +142,29 @@ static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf
/* {{{ php_iptc_next_marker
*/
-static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf TSRMLS_DC)
+static int php_iptc_next_marker(FILE *fp, int spool, unsigned char **spoolbuf)
{
int c;
/* skip unimportant stuff */
- c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC);
+ c = php_iptc_get1(fp, spool, spoolbuf);
if (c == EOF) return M_EOI;
while (c != 0xff) {
- if ((c = php_iptc_get1(fp, spool, spoolbuf TSRMLS_CC)) == EOF)
+ if ((c = php_iptc_get1(fp, spool, spoolbuf)) == EOF)
return M_EOI; /* we hit EOF */
}
/* get marker byte, swallowing possible padding */
do {
- c = php_iptc_get1(fp, 0, 0 TSRMLS_CC);
+ c = php_iptc_get1(fp, 0, 0);
if (c == EOF)
return M_EOI; /* we hit EOF */
else
if (c == 0xff)
- php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)c, spoolbuf);
} while (c == 0xff);
return (unsigned int) c;
@@ -187,16 +187,16 @@ PHP_FUNCTION(iptcembed)
zend_stat_t sb;
zend_bool written = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp|l", &iptcdata, &iptcdata_len, &jpeg_file, &jpeg_file_len, &spool) != SUCCESS) {
return;
}
- if (php_check_open_basedir(jpeg_file TSRMLS_CC)) {
+ if (php_check_open_basedir(jpeg_file)) {
RETURN_FALSE;
}
if ((fp = VCWD_FOPEN(jpeg_file, "rb")) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open %s", jpeg_file);
+ php_error_docref(NULL, E_WARNING, "Unable to open %s", jpeg_file);
RETURN_FALSE;
}
@@ -207,7 +207,7 @@ PHP_FUNCTION(iptcembed)
memset(poi, 0, iptcdata_len + sizeof(psheader) + sb.st_size + 1024 + 1);
}
- if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xFF) {
+ if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xFF) {
fclose(fp);
if (spoolbuf) {
efree(spoolbuf);
@@ -215,7 +215,7 @@ PHP_FUNCTION(iptcembed)
RETURN_FALSE;
}
- if (php_iptc_get1(fp, spool, poi?&poi:0 TSRMLS_CC) != 0xD8) {
+ if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xD8) {
fclose(fp);
if (spoolbuf) {
efree(spoolbuf);
@@ -224,19 +224,19 @@ PHP_FUNCTION(iptcembed)
}
while (!done) {
- marker = php_iptc_next_marker(fp, spool, poi?&poi:0 TSRMLS_CC);
+ marker = php_iptc_next_marker(fp, spool, poi?&poi:0);
if (marker == M_EOI) { /* EOF */
break;
} else if (marker != M_APP13) {
- php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0);
}
switch (marker) {
case M_APP13:
/* we are going to write a new APP13 marker, so don't output the old one */
- php_iptc_skip_variable(fp, 0, 0 TSRMLS_CC);
- php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, 0, 0);
+ php_iptc_read_remaining(fp, spool, poi?&poi:0);
done = 1;
break;
@@ -249,7 +249,7 @@ PHP_FUNCTION(iptcembed)
}
written = 1;
- php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, spool, poi?&poi:0);
if (iptcdata_len & 1) {
iptcdata_len++; /* make the length even */
@@ -259,25 +259,25 @@ PHP_FUNCTION(iptcembed)
psheader[ 3 ] = (iptcdata_len+28)&0xff;
for (inx = 0; inx < 28; inx++) {
- php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, psheader[inx], poi?&poi:0);
}
- php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0 TSRMLS_CC);
- php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len>>8), poi?&poi:0);
+ php_iptc_put1(fp, spool, (unsigned char)(iptcdata_len&0xff), poi?&poi:0);
for (inx = 0; inx < iptcdata_len; inx++) {
- php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0 TSRMLS_CC);
+ php_iptc_put1(fp, spool, iptcdata[inx], poi?&poi:0);
}
break;
case M_SOS:
/* we hit data, no more marker-inserting can be done! */
- php_iptc_read_remaining(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_read_remaining(fp, spool, poi?&poi:0);
done = 1;
break;
default:
- php_iptc_skip_variable(fp, spool, poi?&poi:0 TSRMLS_CC);
+ php_iptc_skip_variable(fp, spool, poi?&poi:0);
break;
}
}
@@ -305,7 +305,7 @@ PHP_FUNCTION(iptcparse)
size_t str_len;
zval values, *element;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) != SUCCESS) {
return;
}
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index 8bfa05555b..424604c0e9 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -50,15 +50,15 @@ static php_lcg_globals lcg_globals;
#define MODMULT(a, b, c, m, s) q = s/a;s=b*(s-a*q)-c*q;if(s<0)s+=m
-static void lcg_seed(TSRMLS_D);
+static void lcg_seed(void);
-PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */
+PHPAPI double php_combined_lcg(void) /* {{{ */
{
php_int32 q;
php_int32 z;
if (!LCG(seeded)) {
- lcg_seed(TSRMLS_C);
+ lcg_seed();
}
MODMULT(53668, 40014, 12211, 2147483563L, LCG(s1));
@@ -73,7 +73,7 @@ PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void lcg_seed(TSRMLS_D) /* {{{ */
+static void lcg_seed(void) /* {{{ */
{
struct timeval tv;
@@ -97,7 +97,7 @@ static void lcg_seed(TSRMLS_D) /* {{{ */
}
/* }}} */
-static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) /* {{{ */
+static void lcg_init_globals(php_lcg_globals *lcg_globals_p) /* {{{ */
{
LCG(seeded) = 0;
}
@@ -118,7 +118,7 @@ PHP_MINIT_FUNCTION(lcg) /* {{{ */
Returns a value from the combined linear congruential generator */
PHP_FUNCTION(lcg_value)
{
- RETURN_DOUBLE(php_combined_lcg(TSRMLS_C));
+ RETURN_DOUBLE(php_combined_lcg());
}
/* }}} */
diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c
index e776934e1f..0723781c49 100644
--- a/ext/standard/levenshtein.c
+++ b/ext/standard/levenshtein.c
@@ -79,9 +79,9 @@ static zend_long reference_levdist(const char *s1, size_t l1, const char *s2, si
/* {{{ custom_levdist
*/
-static int custom_levdist(char *str1, char *str2, char *callback_name TSRMLS_DC)
+static int custom_levdist(char *str1, char *str2, char *callback_name)
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet");
+ php_error_docref(NULL, E_WARNING, "The general Levenshtein support is not there yet");
/* not there yet */
return -1;
@@ -101,24 +101,24 @@ PHP_FUNCTION(levenshtein)
switch (argc) {
case 2: /* just two strings: use maximum performance version */
- if (zend_parse_parameters(2 TSRMLS_CC, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) {
+ if (zend_parse_parameters(2, "ss", &str1, &str1_len, &str2, &str2_len) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, 1, 1, 1);
break;
case 5: /* more general version: calc cost by ins/rep/del weights */
- if (zend_parse_parameters(5 TSRMLS_CC, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
+ if (zend_parse_parameters(5, "sslll", &str1, &str1_len, &str2, &str2_len, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
return;
}
distance = reference_levdist(str1, str1_len, str2, str2_len, cost_ins, cost_rep, cost_del);
break;
case 3: /* most general version: calc cost by user-supplied function */
- if (zend_parse_parameters(3 TSRMLS_CC, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) {
+ if (zend_parse_parameters(3, "sss", &str1, &str1_len, &str2, &str2_len, &callback_name, &callback_len) == FAILURE) {
return;
}
- distance = custom_levdist(str1, str2, callback_name TSRMLS_CC);
+ distance = custom_levdist(str1, str2, callback_name);
break;
default:
@@ -126,7 +126,7 @@ PHP_FUNCTION(levenshtein)
}
if (distance < 0 && /* TODO */ ZEND_NUM_ARGS() != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument string(s) too long");
+ php_error_docref(NULL, E_WARNING, "Argument string(s) too long");
}
RETURN_LONG(distance);
diff --git a/ext/standard/link.c b/ext/standard/link.c
index 4618ffe983..7bdb48e973 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -59,18 +59,18 @@ PHP_FUNCTION(readlink)
char buff[MAXPATHLEN];
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &link, &link_len) == FAILURE) {
return;
}
- if (php_check_open_basedir(link TSRMLS_CC)) {
+ if (php_check_open_basedir(link)) {
RETURN_FALSE;
}
ret = php_sys_readlink(link, buff, MAXPATHLEN-1);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
/* Append NULL to the end of the string */
@@ -90,21 +90,21 @@ PHP_FUNCTION(linkinfo)
zend_stat_t sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
dirname = estrndup(link, link_len);
dir_len = php_dirname(dirname, link_len);
- if (php_check_open_basedir(dirname TSRMLS_CC)) {
+ if (php_check_open_basedir(dirname)) {
efree(dirname);
RETURN_FALSE;
}
ret = VCWD_LSTAT(link, &sb);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
efree(dirname);
RETURN_LONG(-1L);
}
@@ -126,35 +126,35 @@ PHP_FUNCTION(symlink)
char dirname[MAXPATHLEN];
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
memcpy(dirname, source_p, sizeof(source_p));
len = php_dirname(dirname, strlen(dirname));
- if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_ex(topath, dest_p, dirname, len)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL");
RETURN_FALSE;
}
- if (php_check_open_basedir(dest_p TSRMLS_CC)) {
+ if (php_check_open_basedir(dest_p)) {
RETURN_FALSE;
}
- if (php_check_open_basedir(source_p TSRMLS_CC)) {
+ if (php_check_open_basedir(source_p)) {
RETURN_FALSE;
}
@@ -164,7 +164,7 @@ PHP_FUNCTION(symlink)
ret = symlink(topath, source_p);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -182,27 +182,27 @@ PHP_FUNCTION(link)
char source_p[MAXPATHLEN];
char dest_p[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}
- if (php_check_open_basedir(dest_p TSRMLS_CC)) {
+ if (php_check_open_basedir(dest_p)) {
RETURN_FALSE;
}
- if (php_check_open_basedir(source_p TSRMLS_CC)) {
+ if (php_check_open_basedir(source_p)) {
RETURN_FALSE;
}
@@ -212,7 +212,7 @@ PHP_FUNCTION(link)
ret = link(dest_p, source_p);
#endif
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index ab904d9571..9fa60a1c3d 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -66,7 +66,7 @@ PHP_FUNCTION(readlink)
size_t link_len;
char target[MAXPATHLEN];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
@@ -75,7 +75,7 @@ PHP_FUNCTION(readlink)
}
if (php_sys_readlink(link, target, MAXPATHLEN) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError());
+ php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError());
RETURN_FALSE;
}
RETURN_STRING(target);
@@ -91,13 +91,13 @@ PHP_FUNCTION(linkinfo)
zend_stat_t sb;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
return;
}
ret = VCWD_STAT(link, &sb);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_LONG(Z_L(-1));
}
@@ -126,35 +126,35 @@ PHP_FUNCTION(symlink)
if (kernel32) {
pCreateSymbolicLinkA = (csla_func)GetProcAddress(kernel32, "CreateSymbolicLinkA");
if (pCreateSymbolicLinkA == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call CreateSymbolicLinkA");
+ php_error_docref(NULL, E_WARNING, "Can't call CreateSymbolicLinkA");
RETURN_FALSE;
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't call get a handle on kernel32.dll");
+ php_error_docref(NULL, E_WARNING, "Can't call get a handle on kernel32.dll");
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
memcpy(dirname, source_p, sizeof(source_p));
len = php_dirname(dirname, strlen(dirname));
- if (!expand_filepath_ex(topath, dest_p, dirname, len TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath_ex(topath, dest_p, dirname, len)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL");
RETURN_FALSE;
}
@@ -167,7 +167,7 @@ PHP_FUNCTION(symlink)
}
if ((attr = GetFileAttributes(topath)) == INVALID_FILE_ATTRIBUTES) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch file information(error %d)", GetLastError());
+ php_error_docref(NULL, E_WARNING, "Could not fetch file information(error %d)", GetLastError());
RETURN_FALSE;
}
@@ -177,7 +177,7 @@ PHP_FUNCTION(symlink)
ret = pCreateSymbolicLinkA(source_p, topath, (attr & FILE_ATTRIBUTE_DIRECTORY ? 1 : 0));
if (!ret) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError());
+ php_error_docref(NULL, E_WARNING, "Cannot create symlink, error code(%d)", GetLastError());
RETURN_FALSE;
}
@@ -197,19 +197,19 @@ PHP_FUNCTION(link)
/*First argument to link function is the target and hence should go to frompath
Second argument to link function is the link itself and hence should go to topath */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &frompath, &frompath_len, &topath, &topath_len) == FAILURE) {
return;
}
- if (!expand_filepath(frompath, source_p TSRMLS_CC) || !expand_filepath(topath, dest_p TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
+ if (!expand_filepath(frompath, source_p) || !expand_filepath(topath, dest_p)) {
+ php_error_docref(NULL, E_WARNING, "No such file or directory");
RETURN_FALSE;
}
- if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ||
- php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
+ if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ||
+ php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) )
{
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
+ php_error_docref(NULL, E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}
@@ -228,7 +228,7 @@ PHP_FUNCTION(link)
#endif
if (ret == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 5d2b576c7e..69b80e7baa 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -72,7 +72,7 @@
*p = ' '; \
} \
-extern zend_long php_getuid(TSRMLS_D);
+extern zend_long php_getuid(void);
/* {{{ proto int ezmlm_hash(string addr)
Calculate EZMLM list hash value. */
@@ -82,7 +82,7 @@ PHP_FUNCTION(ezmlm_hash)
unsigned int h = 5381;
size_t j, str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -109,7 +109,7 @@ PHP_FUNCTION(mail)
char *to_r, *subject_r;
char *p, *e;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|sS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &headers_len, &extra_cmd) == FAILURE) {
return;
}
@@ -119,7 +119,7 @@ PHP_FUNCTION(mail)
MAIL_ASCIIZ_CHECK(message, message_len);
if (headers) {
MAIL_ASCIIZ_CHECK(headers, headers_len);
- headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2 TSRMLS_CC);
+ headers_trimmed = php_trim(headers, headers_len, NULL, 0, NULL, 2);
}
if (extra_cmd) {
MAIL_ASCIIZ_CHECK(extra_cmd->val, extra_cmd->len);
@@ -171,7 +171,7 @@ PHP_FUNCTION(mail)
extra_cmd = php_escape_shell_cmd(extra_cmd->val);
}
- if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL TSRMLS_CC)) {
+ if (php_mail(to_r, subject_r, message, headers_trimmed, extra_cmd ? extra_cmd->val : NULL)) {
RETVAL_TRUE;
} else {
RETVAL_FALSE;
@@ -213,7 +213,7 @@ void php_mail_log_to_syslog(char *message) {
}
-void php_mail_log_to_file(char *filename, char *message, size_t message_size TSRMLS_DC) {
+void php_mail_log_to_file(char *filename, char *message, size_t message_size) {
/* Write 'message' to the given file. */
uint flags = IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR;
php_stream *stream = php_stream_open_wrapper(filename, "a", flags, NULL);
@@ -226,7 +226,7 @@ void php_mail_log_to_file(char *filename, char *message, size_t message_size TSR
/* {{{ php_mail
*/
-PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC)
+PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd)
{
#if (defined PHP_WIN32 || defined NETWARE)
int tsm_err;
@@ -255,9 +255,9 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
zend_string *date_str;
time(&curtime);
- date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1 TSRMLS_CC);
+ date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1);
- l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : "");
+ l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str->val, zend_get_executed_filename(), zend_get_executed_lineno(), to, hdr ? hdr : "");
zend_string_free(date_str);
@@ -273,21 +273,21 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
else {
/* Convert the final space to a newline when logging to file. */
tmp[l - 1] = '\n';
- php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC);
+ php_mail_log_to_file(mail_log, tmp, l);
}
efree(tmp);
}
if (PG(mail_x_header)) {
- const char *tmp = zend_get_executed_filename(TSRMLS_C);
+ const char *tmp = zend_get_executed_filename();
zend_string *f;
- f = php_basename(tmp, strlen(tmp), NULL, 0 TSRMLS_CC);
+ f = php_basename(tmp, strlen(tmp), NULL, 0);
if (headers != NULL) {
- spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(TSRMLS_C), f->val, headers);
+ spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s\n%s", php_getuid(), f->val, headers);
} else {
- spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(TSRMLS_C), f->val);
+ spprintf(&hdr, 0, "X-PHP-Originating-Script: " ZEND_LONG_FMT ":%s", php_getuid(), f->val);
}
zend_string_release(f);
}
@@ -295,12 +295,12 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (!sendmail_path) {
#if (defined PHP_WIN32 || defined NETWARE)
/* handle old style win smtp sending */
- if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) {
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, hdr, subject, to, message, NULL, NULL, NULL) == FAILURE) {
if (tsm_errmsg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg);
+ php_error_docref(NULL, E_WARNING, "%s", tsm_errmsg);
efree(tsm_errmsg);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err));
+ php_error_docref(NULL, E_WARNING, "%s", GetSMErrorText(tsm_err));
}
MAIL_RET(0);
}
@@ -326,7 +326,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
#endif
#ifdef PHP_WIN32
- sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL TSRMLS_CC);
+ sendmail = popen_ex(sendmail_cmd, "wb", NULL, NULL);
#else
/* Since popen() doesn't indicate if the internal fork() doesn't work
* (e.g. the shell can't be executed) we explicitly set it to 0 to be
@@ -341,7 +341,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
if (sendmail) {
#ifndef PHP_WIN32
if (EACCES == errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path);
+ php_error_docref(NULL, E_WARNING, "Permission denied: unable to execute shell to run mail delivery binary '%s'", sendmail_path);
pclose(sendmail);
#if PHP_SIGCHILD
/* Restore handler in case of error on Windows
@@ -384,7 +384,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
MAIL_RET(1);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
+ php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
#if PHP_SIGCHILD
if (sig_handler) {
signal(SIGCHLD, sig_handler);
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 31eb259829..6d18c0b2dd 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -295,7 +295,7 @@ PHP_FUNCTION(abs)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -319,7 +319,7 @@ PHP_FUNCTION(ceil)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -339,7 +339,7 @@ PHP_FUNCTION(floor)
{
zval *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
convert_scalar_to_number_ex(value);
@@ -363,7 +363,7 @@ PHP_FUNCTION(round)
zend_long mode = PHP_ROUND_HALF_UP;
double return_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &value, &precision, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &value, &precision, &mode) == FAILURE) {
return;
}
@@ -400,7 +400,7 @@ PHP_FUNCTION(sin)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -419,7 +419,7 @@ PHP_FUNCTION(cos)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -438,7 +438,7 @@ PHP_FUNCTION(tan)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -457,7 +457,7 @@ PHP_FUNCTION(asin)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -476,7 +476,7 @@ PHP_FUNCTION(acos)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -495,7 +495,7 @@ PHP_FUNCTION(atan)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -514,7 +514,7 @@ PHP_FUNCTION(atan2)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -534,7 +534,7 @@ PHP_FUNCTION(sinh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -553,7 +553,7 @@ PHP_FUNCTION(cosh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -572,7 +572,7 @@ PHP_FUNCTION(tanh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -591,7 +591,7 @@ PHP_FUNCTION(asinh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -610,7 +610,7 @@ PHP_FUNCTION(acosh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -629,7 +629,7 @@ PHP_FUNCTION(atanh)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -656,7 +656,7 @@ PHP_FUNCTION(is_finite)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -675,7 +675,7 @@ PHP_FUNCTION(is_infinite)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -694,7 +694,7 @@ PHP_FUNCTION(is_nan)
double dval;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &dval) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
return;
}
#else
@@ -712,11 +712,11 @@ PHP_FUNCTION(pow)
{
zval *zbase, *zexp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &zbase, &zexp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &zbase, &zexp) == FAILURE) {
return;
}
- pow_function(return_value, zbase, zexp TSRMLS_CC);
+ pow_function(return_value, zbase, zexp);
}
/* }}} */
@@ -727,7 +727,7 @@ PHP_FUNCTION(exp)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -751,7 +751,7 @@ PHP_FUNCTION(expm1)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -775,7 +775,7 @@ PHP_FUNCTION(log1p)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -795,7 +795,7 @@ PHP_FUNCTION(log)
double num, base = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|d", &num, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|d", &num, &base) == FAILURE) {
return;
}
#else
@@ -825,7 +825,7 @@ PHP_FUNCTION(log)
}
if (base <= 0.0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "base must be greater than 0");
RETURN_FALSE;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(log10)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -860,7 +860,7 @@ PHP_FUNCTION(sqrt)
double num;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
return;
}
#else
@@ -880,7 +880,7 @@ PHP_FUNCTION(hypot)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -907,7 +907,7 @@ PHP_FUNCTION(deg2rad)
double deg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &deg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &deg) == FAILURE) {
return;
}
#else
@@ -926,7 +926,7 @@ PHP_FUNCTION(rad2deg)
double rad;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &rad) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &rad) == FAILURE) {
return;
}
#else
@@ -973,9 +973,8 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base)
continue;
{
- TSRMLS_FETCH();
-
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is too big to fit in long", s);
+
+ php_error_docref(NULL, E_WARNING, "Number '%s' is too big to fit in long", s);
return ZEND_LONG_MAX;
}
}
@@ -1052,7 +1051,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
* Convert a long to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[(sizeof(zend_ulong) << 3) + 1];
@@ -1082,7 +1081,7 @@ PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
* Convert a zval to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
+PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -1097,7 +1096,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
/* Don't try to convert +/- infinity */
if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large");
+ php_error_docref(NULL, E_WARNING, "Number too large");
return STR_EMPTY_ALLOC();
}
@@ -1112,7 +1111,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
return zend_string_init(ptr, end - ptr, 0);
}
- return _php_math_longtobase(arg, base TSRMLS_CC);
+ return _php_math_longtobase(arg, base);
}
/* }}} */
@@ -1122,7 +1121,7 @@ PHP_FUNCTION(bindec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1138,7 +1137,7 @@ PHP_FUNCTION(hexdec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1154,7 +1153,7 @@ PHP_FUNCTION(octdec)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_string_ex(arg);
@@ -1171,11 +1170,11 @@ PHP_FUNCTION(decbin)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 2 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 2);
RETURN_STR(result);
}
/* }}} */
@@ -1187,11 +1186,11 @@ PHP_FUNCTION(decoct)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 8 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 8);
RETURN_STR(result);
}
/* }}} */
@@ -1203,11 +1202,11 @@ PHP_FUNCTION(dechex)
zval *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 16 TSRMLS_CC);
+ result = _php_math_longtobase(arg, 16);
RETURN_STR(result);
}
/* }}} */
@@ -1220,24 +1219,24 @@ PHP_FUNCTION(base_convert)
zend_long frombase, tobase;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &number, &frombase, &tobase) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &number, &frombase, &tobase) == FAILURE) {
return;
}
convert_to_string_ex(number);
if (frombase < 2 || frombase > 36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base' (%pd)", frombase);
+ php_error_docref(NULL, E_WARNING, "Invalid `from base' (%pd)", frombase);
RETURN_FALSE;
}
if (tobase < 2 || tobase > 36) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%pd)", tobase);
+ php_error_docref(NULL, E_WARNING, "Invalid `to base' (%pd)", tobase);
RETURN_FALSE;
}
if(_php_math_basetozval(number, (int)frombase, &temp) == FAILURE) {
RETURN_FALSE;
}
- result = _php_math_zvaltobase(&temp, (int)tobase TSRMLS_CC);
+ result = _php_math_zvaltobase(&temp, (int)tobase);
RETVAL_STR(result);
}
/* }}} */
@@ -1373,7 +1372,7 @@ PHP_FUNCTION(number_format)
size_t thousand_sep_len = 0, dec_point_len = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
return;
}
#else
@@ -1421,7 +1420,7 @@ PHP_FUNCTION(fmod)
double num1, num2;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
return;
}
#else
@@ -1441,12 +1440,12 @@ PHP_FUNCTION(intdiv)
{
zend_long numerator, divisor;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &numerator, &divisor) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) {
return;
}
if (divisor == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
+ php_error_docref(NULL, E_WARNING, "Division by zero");
RETURN_BOOL(0);
} else if (divisor == -1 && numerator == ZEND_LONG_MIN) {
/* Prevent overflow error/crash
diff --git a/ext/standard/md5.c b/ext/standard/md5.c
index e5359c2bcf..1a06e95b40 100644
--- a/ext/standard/md5.c
+++ b/ext/standard/md5.c
@@ -52,7 +52,7 @@ PHP_NAMED_FUNCTION(php_if_md5)
PHP_MD5_CTX context;
unsigned char digest[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) {
return;
}
@@ -84,7 +84,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
size_t n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c
index 55b8509f04..8ce43c6710 100644
--- a/ext/standard/metaphone.c
+++ b/ext/standard/metaphone.c
@@ -35,7 +35,7 @@ PHP_FUNCTION(metaphone)
zend_string *result = NULL;
zend_long phones = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &phones) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &phones) == FAILURE) {
return;
}
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 811731ee20..d8f72b20d4 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -55,7 +55,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_bool get_as_float = 0;
struct timeval tp = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &get_as_float) == FAILURE) {
return;
}
@@ -70,7 +70,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (mode) {
timelib_time_offset *offset;
- offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info(TSRMLS_C));
+ offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info());
array_init(return_value);
add_assoc_long(return_value, "sec", tp.tv_sec);
@@ -114,7 +114,7 @@ PHP_FUNCTION(getrusage)
zend_long pwho = 0;
int who = RUSAGE_SELF;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &pwho) == FAILURE) {
return;
}
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index f773eb26c5..d1c7cf9e0b 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -57,7 +57,7 @@
if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \
efree(formatcodes); \
efree(formatargs); \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \
+ php_error_docref(NULL, E_WARNING, "Type %c: integer overflow in format string", code); \
RETURN_FALSE; \
} \
outputpos += (a)*(b);
@@ -122,7 +122,7 @@ PHP_FUNCTION(pack)
int outputpos = 0, outputsize = 0;
char *output;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &argv, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &argv, &num_args) == FAILURE) {
return;
}
@@ -168,7 +168,7 @@ PHP_FUNCTION(pack)
case 'X':
case '@':
if (arg < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: '*' ignored", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", code);
arg = 1;
}
break;
@@ -182,7 +182,7 @@ PHP_FUNCTION(pack)
if (currentarg >= num_args) {
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough arguments", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough arguments", code);
RETURN_FALSE;
}
@@ -211,7 +211,7 @@ PHP_FUNCTION(pack)
#if SIZEOF_ZEND_LONG < 8
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
RETURN_FALSE;
#endif
case 'c':
@@ -237,7 +237,7 @@ PHP_FUNCTION(pack)
if (currentarg > num_args) {
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: too few arguments", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: too few arguments", code);
RETURN_FALSE;
}
break;
@@ -245,7 +245,7 @@ PHP_FUNCTION(pack)
default:
efree(formatcodes);
efree(formatargs);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: unknown format code", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: unknown format code", code);
RETURN_FALSE;
}
@@ -254,7 +254,7 @@ PHP_FUNCTION(pack)
}
if (currentarg < num_args) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d arguments unused", (num_args - currentarg));
+ php_error_docref(NULL, E_WARNING, "%d arguments unused", (num_args - currentarg));
}
/* Calculate output length and upper bound while processing*/
@@ -317,7 +317,7 @@ PHP_FUNCTION(pack)
outputpos -= arg;
if (outputpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", code);
outputpos = 0;
}
break;
@@ -368,7 +368,7 @@ PHP_FUNCTION(pack)
outputpos--;
if(arg > str->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough characters in string", code);
arg = str->len;
}
@@ -382,7 +382,7 @@ PHP_FUNCTION(pack)
} else if (n >= 'a' && n <= 'f') {
n -= ('a' - 10);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: illegal hex digit %c", code, n);
+ php_error_docref(NULL, E_WARNING, "Type %c: illegal hex digit %c", code, n);
n = 0;
}
@@ -563,7 +563,7 @@ PHP_FUNCTION(unpack)
zend_long formatlen, inputpos, inputlen;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &formatarg,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &formatarg,
&inputarg) == FAILURE) {
return;
}
@@ -677,7 +677,7 @@ PHP_FUNCTION(unpack)
size = 8;
break;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
zval_dtor(return_value);
RETURN_FALSE;
#endif
@@ -693,7 +693,7 @@ PHP_FUNCTION(unpack)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format type %c", type);
+ php_error_docref(NULL, E_WARNING, "Invalid format type %c", type);
zval_dtor(return_value);
RETURN_FALSE;
break;
@@ -713,7 +713,7 @@ PHP_FUNCTION(unpack)
}
if (size != 0 && size != -1 && INT_MAX - size + 1 < inputpos) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: integer overflow", type);
inputpos = 0;
}
@@ -963,7 +963,7 @@ PHP_FUNCTION(unpack)
i = arg - 1; /* Break out of for loop */
if (arg >= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
}
break;
@@ -972,7 +972,7 @@ PHP_FUNCTION(unpack)
if (arg <= inputlen) {
inputpos = arg;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
i = arg - 1; /* Done, break out of for loop */
@@ -982,7 +982,7 @@ PHP_FUNCTION(unpack)
inputpos += size;
if (inputpos < 0) {
if (size != -1) { /* only print warning if not working with * */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
+ php_error_docref(NULL, E_WARNING, "Type %c: outside of string", type);
}
inputpos = 0;
}
@@ -990,7 +990,7 @@ PHP_FUNCTION(unpack)
/* Reached end of input for '*' repeater */
break;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);
+ php_error_docref(NULL, E_WARNING, "Type %c: not enough input, need %d, have %d", type, size, inputlen - inputpos);
zval_dtor(return_value);
RETURN_FALSE;
}
diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c
index 8db9995d27..de13dd399f 100644
--- a/ext/standard/pageinfo.c
+++ b/ext/standard/pageinfo.c
@@ -57,11 +57,11 @@
/* {{{ php_statpage
*/
-PHPAPI void php_statpage(TSRMLS_D)
+PHPAPI void php_statpage(void)
{
zend_stat_t *pstat;
- pstat = sapi_get_stat(TSRMLS_C);
+ pstat = sapi_get_stat();
if (BG(page_uid)==-1 || BG(page_gid)==-1) {
if(pstat) {
@@ -79,16 +79,16 @@ PHPAPI void php_statpage(TSRMLS_D)
/* {{{ php_getuid
*/
-zend_long php_getuid(TSRMLS_D)
+zend_long php_getuid(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return (BG(page_uid));
}
/* }}} */
-zend_long php_getgid(TSRMLS_D)
+zend_long php_getgid(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return (BG(page_gid));
}
@@ -102,7 +102,7 @@ PHP_FUNCTION(getmyuid)
return;
}
- uid = php_getuid(TSRMLS_C);
+ uid = php_getuid();
if (uid < 0) {
RETURN_FALSE;
} else {
@@ -121,7 +121,7 @@ PHP_FUNCTION(getmygid)
return;
}
- gid = php_getgid(TSRMLS_C);
+ gid = php_getgid();
if (gid < 0) {
RETURN_FALSE;
} else {
@@ -157,7 +157,7 @@ PHP_FUNCTION(getmyinode)
return;
}
- php_statpage(TSRMLS_C);
+ php_statpage();
if (BG(page_inode) < 0) {
RETURN_FALSE;
} else {
@@ -166,9 +166,9 @@ PHP_FUNCTION(getmyinode)
}
/* }}} */
-PHPAPI time_t php_getlastmod(TSRMLS_D)
+PHPAPI time_t php_getlastmod(void)
{
- php_statpage(TSRMLS_C);
+ php_statpage();
return BG(page_mtime);
}
@@ -182,7 +182,7 @@ PHP_FUNCTION(getlastmod)
return;
}
- lm = php_getlastmod(TSRMLS_C);
+ lm = php_getlastmod();
if (lm < 0) {
RETURN_FALSE;
} else {
diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h
index ec5823246a..338d162cfe 100644
--- a/ext/standard/pageinfo.h
+++ b/ext/standard/pageinfo.h
@@ -27,9 +27,9 @@ PHP_FUNCTION(getmypid);
PHP_FUNCTION(getmyinode);
PHP_FUNCTION(getlastmod);
-PHPAPI void php_statpage(TSRMLS_D);
-PHPAPI time_t php_getlastmod(TSRMLS_D);
-extern zend_long php_getuid(TSRMLS_D);
-extern zend_long php_getgid(TSRMLS_D);
+PHPAPI void php_statpage(void);
+PHPAPI time_t php_getlastmod(void);
+extern zend_long php_getuid(void);
+extern zend_long php_getgid(void);
#endif
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 087b3ace76..5e1c26de54 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -107,7 +107,7 @@ static int php_password_salt_to64(const char *str, const size_t str_len, const s
}
/* }}} */
-static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
+static int php_password_make_salt(size_t length, char *ret) /* {{{ */
{
int buffer_valid = 0;
size_t i, raw_length;
@@ -115,7 +115,7 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
char *result;
if (length > (INT_MAX / 3)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length is too large to safely generate");
+ php_error_docref(NULL, E_WARNING, "Length is too large to safely generate");
return FAILURE;
}
@@ -152,13 +152,13 @@ static int php_password_make_salt(size_t length, char *ret TSRMLS_DC) /* {{{ */
#endif
if (!buffer_valid) {
for (i = 0; i < raw_length; i++) {
- buffer[i] ^= (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX);
+ buffer[i] ^= (char) (255.0 * php_rand() / RAND_MAX);
}
}
result = safe_emalloc(length, 1, 1);
if (php_password_salt_to64(buffer, raw_length, length, result) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Generated salt too short");
+ php_error_docref(NULL, E_WARNING, "Generated salt too short");
efree(buffer);
efree(result);
return FAILURE;
@@ -178,7 +178,7 @@ PHP_FUNCTION(password_get_info)
char *hash, *algo_name;
zval options;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &hash, &hash_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &hash, &hash_len) == FAILURE) {
return;
}
@@ -216,7 +216,7 @@ PHP_FUNCTION(password_needs_rehash)
HashTable *options = 0;
zval *option_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) {
return;
}
@@ -265,7 +265,7 @@ PHP_FUNCTION(password_verify)
char *password, *hash;
zend_string *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &password, &password_len, &hash, &hash_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &password, &password_len, &hash, &hash_len) == FAILURE) {
RETURN_FALSE;
}
if ((ret = php_crypt(password, (int)password_len, hash, (int)hash_len)) == NULL) {
@@ -305,7 +305,7 @@ PHP_FUNCTION(password_hash)
zval *option_buffer;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &password, &password_len, &algo, &options) == FAILURE) {
return;
}
@@ -327,7 +327,7 @@ PHP_FUNCTION(password_hash)
}
if (cost < 4 || cost > 31) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost);
+ php_error_docref(NULL, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost);
RETURN_NULL();
}
@@ -339,7 +339,7 @@ PHP_FUNCTION(password_hash)
break;
case PHP_PASSWORD_UNKNOWN:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo);
+ php_error_docref(NULL, E_WARNING, "Unknown password hashing algorithm: " ZEND_LONG_FMT, algo);
RETURN_NULL();
}
@@ -373,7 +373,7 @@ PHP_FUNCTION(password_hash)
case IS_ARRAY:
default:
efree(hash_format);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-string salt parameter supplied");
+ php_error_docref(NULL, E_WARNING, "Non-string salt parameter supplied");
RETURN_NULL();
}
@@ -383,12 +383,12 @@ PHP_FUNCTION(password_hash)
if (buffer_len > INT_MAX) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long");
+ php_error_docref(NULL, E_WARNING, "Supplied salt is too long");
RETURN_NULL();
} else if (buffer_len < required_salt_len) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
+ php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
RETURN_NULL();
} else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) {
salt = safe_emalloc(required_salt_len, 1, 1);
@@ -396,7 +396,7 @@ PHP_FUNCTION(password_hash)
efree(hash_format);
efree(buffer);
efree(salt);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd", buffer_len);
+ php_error_docref(NULL, E_WARNING, "Provided salt is too short: %zd", buffer_len);
RETURN_NULL();
}
salt_len = required_salt_len;
@@ -408,7 +408,7 @@ PHP_FUNCTION(password_hash)
efree(buffer);
} else {
salt = safe_emalloc(required_salt_len, 1, 1);
- if (php_password_make_salt(required_salt_len, salt TSRMLS_CC) == FAILURE) {
+ if (php_password_make_salt(required_salt_len, salt) == FAILURE) {
efree(hash_format);
efree(salt);
RETURN_FALSE;
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index dee00e6218..b35ce30c8b 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -104,11 +104,11 @@ PHP_FUNCTION(array_chunk);
PHP_FUNCTION(array_combine);
PHPAPI HashTable* php_splice(HashTable *, int, int, zval *, int, HashTable *);
-PHPAPI int php_array_merge(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC);
-PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC);
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC);
+PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
+PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
+PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
+PHPAPI int php_multisort_compare(const void *a, const void *b);
+PHPAPI zend_long php_count_recursive(zval *array, zend_long mode);
#define PHP_SORT_REGULAR 0
#define PHP_SORT_NUMERIC 1
@@ -127,7 +127,7 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode TSRMLS_DC);
ZEND_BEGIN_MODULE_GLOBALS(array)
int *multisort_flags[2];
- int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ int (*compare_func)(zval *result, zval *op1, zval *op2);
ZEND_END_MODULE_GLOBALS(array)
#ifdef ZTS
diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h
index e32c4a2cb9..2018694e65 100644
--- a/ext/standard/php_filestat.h
+++ b/ext/standard/php_filestat.h
@@ -84,8 +84,8 @@ typedef unsigned int php_stat_len;
typedef int php_stat_len;
#endif
-PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC);
-PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value TSRMLS_DC);
+PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len);
+PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int type, zval *return_value);
/* Switches for various filestat functions: */
#define FS_PERMS 0
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 8026b08d45..9239b37032 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -31,21 +31,21 @@
#include "php_fopen_wrappers.h"
#include "SAPI.h"
-static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_output_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
PHPWRITE(buf, count);
return count;
}
/* }}} */
-static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_output_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
stream->eof = 1;
return 0;
}
/* }}} */
-static int php_stream_output_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_stream_output_close(php_stream *stream, int close_handle) /* {{{ */
{
return 0;
}
@@ -69,20 +69,20 @@ typedef struct php_stream_input { /* {{{ */
} php_stream_input_t;
/* }}} */
-static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_input_write(php_stream *stream, const char *buf, size_t count) /* {{{ */
{
return -1;
}
/* }}} */
-static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
+static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count) /* {{{ */
{
php_stream_input_t *input = stream->abstract;
size_t read;
if (!SG(post_read) && SG(read_post_bytes) < (int64_t)(input->position + count)) {
/* read requested data from SAPI */
- int read_bytes = sapi_read_post_block(buf, count TSRMLS_CC);
+ int read_bytes = sapi_read_post_block(buf, count);
if (read_bytes > 0) {
php_stream_seek(input->body, 0, SEEK_END);
@@ -103,7 +103,7 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
}
/* }}} */
-static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
+static int php_stream_input_close(php_stream *stream, int close_handle) /* {{{ */
{
efree(stream->abstract);
stream->abstract = NULL;
@@ -112,13 +112,13 @@ static int php_stream_input_close(php_stream *stream, int close_handle TSRMLS_DC
}
/* }}} */
-static int php_stream_input_flush(php_stream *stream TSRMLS_DC) /* {{{ */
+static int php_stream_input_flush(php_stream *stream) /* {{{ */
{
return -1;
}
/* }}} */
-static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset TSRMLS_DC) /* {{{ */
+static int php_stream_input_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffset) /* {{{ */
{
php_stream_input_t *input = stream->abstract;
@@ -144,7 +144,7 @@ php_stream_ops php_stream_input_ops = {
NULL /* set_option */
};
-static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */
+static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain) /* {{{ */
{
char *p, *token;
php_stream_filter *temp_filter;
@@ -153,17 +153,17 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
while (p) {
php_url_decode(p, strlen(p));
if (read_chain) {
- if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
+ if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) {
php_stream_filter_append(&stream->readfilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
+ php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p);
}
}
if (write_chain) {
- if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) {
+ if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream)))) {
php_stream_filter_append(&stream->writefilters, temp_filter);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create filter (%s)", p);
+ php_error_docref(NULL, E_WARNING, "Unable to create filter (%s)", p);
}
}
p = php_strtok_r(NULL, "|", &token);
@@ -172,7 +172,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i
/* }}} */
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */
+ char **opened_path, php_stream_context *context STREAMS_DC) /* {{{ */
{
int fd = -1;
int mode_rw = 0;
@@ -192,7 +192,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
path += 11;
max_memory = ZEND_STRTOL(path, NULL, 10);
if (max_memory < 0) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "Max memory must be >= 0");
return NULL;
}
}
@@ -222,7 +222,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -241,7 +241,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if (!strcasecmp(path, "stdin")) {
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -291,14 +291,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
if (strcmp(sapi_module.name, "cli")) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
+ php_error_docref(NULL, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
}
return NULL;
}
if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ php_error_docref(NULL, E_WARNING, "URL file-access is disabled in the server configuration");
}
return NULL;
}
@@ -306,7 +306,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
start = &path[3];
fildes_ori = ZEND_STRTOL(start, &end, 10);
if (end == start || *end != '\0') {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"php://fd/ stream must be specified in the form php://fd/<orig fd>");
return NULL;
}
@@ -318,14 +318,14 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
#endif
if (fildes_ori < 0 || fildes_ori >= dtablesize) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"The file descriptors must be non-negative numbers smaller than %d", dtablesize);
return NULL;
}
fd = dup((int)fildes_ori);
if (fd == -1) {
- php_stream_wrapper_log_error(wrapper, options TSRMLS_CC,
+ php_stream_wrapper_log_error(wrapper, options,
"Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: "
"[%d]: %s", fildes_ori, errno, strerror(errno));
return NULL;
@@ -341,7 +341,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
pathdup = estrndup(path + 6, strlen(path + 6));
p = strstr(pathdup, "/resource=");
if (!p) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "No URL resource specified");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "No URL resource specified");
efree(pathdup);
return NULL;
}
@@ -355,11 +355,11 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
p = php_strtok_r(pathdup + 1, "/", &token);
while (p) {
if (!strncasecmp(p, "read=", 5)) {
- php_stream_apply_filter_list(stream, p + 5, 1, 0 TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p + 5, 1, 0);
} else if (!strncasecmp(p, "write=", 6)) {
- php_stream_apply_filter_list(stream, p + 6, 0, 1 TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p + 6, 0, 1);
} else {
- php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE TSRMLS_CC);
+ php_stream_apply_filter_list(stream, p, mode_rw & PHP_STREAM_FILTER_READ, mode_rw & PHP_STREAM_FILTER_WRITE);
}
p = php_strtok_r(NULL, "/", &token);
}
@@ -368,7 +368,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
return stream;
} else {
/* invalid php://thingy */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid php:// URL specified");
+ php_error_docref(NULL, E_WARNING, "Invalid php:// URL specified");
return NULL;
}
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 6d6a5bde27..b82a1f8913 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -23,8 +23,8 @@
#ifndef PHP_FOPEN_WRAPPERS_H
#define PHP_FOPEN_WRAPPERS_H
-php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
extern PHPAPI php_stream_wrapper php_stream_php_wrapper;
diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h
index 712e297fe3..81a5b45bb6 100644
--- a/ext/standard/php_http.h
+++ b/ext/standard/php_http.h
@@ -28,8 +28,8 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
const char *num_prefix, size_t num_prefix_len,
const char *key_prefix, size_t key_prefix_len,
const char *key_suffix, size_t key_suffix_len,
- zval *type, char *arg_sep, int enc_type TSRMLS_DC);
-#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL TSRMLS_CC)
+ zval *type, char *arg_sep, int enc_type);
+#define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL)
PHP_FUNCTION(http_build_query);
diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h
index 3853b0e6c3..de6527ebb2 100644
--- a/ext/standard/php_image.h
+++ b/ext/standard/php_image.h
@@ -59,7 +59,7 @@ typedef enum
PHP_MINIT_FUNCTION(imagetypes);
-PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC);
+PHPAPI int php_getimagetype(php_stream *stream, char *filetype);
PHPAPI char * php_image_type_to_mime_type(int image_type);
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index fa2747f3bf..6fb97e9d77 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -52,7 +52,7 @@
extern "C" {
#endif
-PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
+PHPAPI zend_class_entry *php_create_incomplete_class(void);
PHPAPI zend_string *php_lookup_class_name(zval *object);
PHPAPI void php_store_class_name(zval *object, const char *name, size_t len);
diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h
index 81d251c513..c89f4f3034 100644
--- a/ext/standard/php_lcg.h
+++ b/ext/standard/php_lcg.h
@@ -29,7 +29,7 @@ typedef struct {
int seeded;
} php_lcg_globals;
-PHPAPI double php_combined_lcg(TSRMLS_D);
+PHPAPI double php_combined_lcg(void);
PHP_FUNCTION(lcg_value);
PHP_MINIT_FUNCTION(lcg);
diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h
index f7ee5e983a..68f806db5d 100644
--- a/ext/standard/php_mail.h
+++ b/ext/standard/php_mail.h
@@ -25,6 +25,6 @@ PHP_FUNCTION(mail);
PHP_MINFO_FUNCTION(mail);
PHP_FUNCTION(ezmlm_hash);
-PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd TSRMLS_DC);
+PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd);
#endif /* PHP_MAIL_H */
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 7fb6909e7f..075e69058d 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -24,10 +24,10 @@
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC);
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);
PHPAPI zend_long _php_math_basetolong(zval *arg, int base);
PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret);
-PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC);
+PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base);
PHP_FUNCTION(sin);
PHP_FUNCTION(cos);
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h
index bbdf16d385..e775d1b465 100644
--- a/ext/standard/php_rand.h
+++ b/ext/standard/php_rand.h
@@ -48,14 +48,14 @@
#define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */
#ifdef PHP_WIN32
-#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C))))
+#define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#else
-#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg(TSRMLS_C))))
+#define GENERATE_SEED() (((zend_long) (time(0) * getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
#endif
-PHPAPI void php_srand(zend_long seed TSRMLS_DC);
-PHPAPI zend_long php_rand(TSRMLS_D);
-PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC);
-PHPAPI php_uint32 php_mt_rand(TSRMLS_D);
+PHPAPI void php_srand(zend_long seed);
+PHPAPI zend_long php_rand(void);
+PHPAPI void php_mt_srand(php_uint32 seed);
+PHPAPI php_uint32 php_mt_rand(void);
#endif /* PHP_RAND_H */
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index 0b655bfbdf..c79bfb20fe 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -121,31 +121,31 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out);
PHPAPI char *php_strtoupper(char *s, size_t len);
PHPAPI char *php_strtolower(char *s, size_t len);
PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen);
-PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC);
-PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength TSRMLS_DC);
-PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC);
+PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free);
+PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int freeit, char *what, size_t wlength);
+PHPAPI void php_stripslashes(char *str, size_t *len);
PHPAPI void php_stripcslashes(char *str, size_t *len);
-PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC);
+PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen);
PHPAPI size_t php_dirname(char *str, size_t len);
PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len);
PHPAPI zend_string *php_str_to_str_ex(char *haystack, size_t length, char *needle,
size_t needle_len, char *str, size_t str_len, int case_sensitivity, size_t *replace_count);
PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
size_t needle_len, char *str, size_t str_len);
-PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC);
+PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode);
PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, char *allow, size_t allow_len);
PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, int *stateptr, char *allow, size_t allow_len, zend_bool allow_tag_spaces);
PHPAPI size_t php_char_to_str_ex(char *str, size_t len, char from, char *to, size_t to_len, zval *result, int case_sensitivity, size_t *replace_count);
PHPAPI size_t php_char_to_str(char *str, size_t len, char from, char *to, size_t to_len, zval *result);
-PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC);
+PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value);
PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit);
PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC);
-PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
-PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive);
+PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2);
+PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2);
#ifndef HAVE_STRERROR
PHPAPI char *php_strerror(int errnum);
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index a4df8f51f9..a3b0dbf94f 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -32,11 +32,11 @@ PHP_FUNCTION(unserialize);
PHP_FUNCTION(memory_get_usage);
PHP_FUNCTION(memory_get_peak_usage);
-PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC);
-PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC);
-PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC);
+PHPAPI void php_var_dump(zval *struc, int level);
+PHPAPI void php_var_export(zval *struc, int level);
+PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf);
-PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC);
+PHPAPI void php_debug_zval_dump(zval *struc, int level);
struct php_serialize_data {
HashTable ht;
@@ -53,11 +53,11 @@ struct php_unserialize_data {
typedef struct php_serialize_data *php_serialize_data_t;
typedef struct php_unserialize_data *php_unserialize_data_t;
-PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC);
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC);
-PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes TSRMLS_DC);
+PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data);
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_ref(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_intern(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash);
+PHPAPI int php_var_unserialize_ex(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash, HashTable *classes);
#define PHP_VAR_SERIALIZE_INIT(d) \
do { \
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index d6a6f2be50..6f2516bca6 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -73,7 +73,7 @@
static int le_proc_open;
/* {{{ _php_array_to_envp */
-static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent TSRMLS_DC)
+static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent)
{
zval *element;
php_process_env_t env;
@@ -186,7 +186,7 @@ static void _php_free_envp(php_process_env_t env, int is_persistent)
/* }}} */
/* {{{ proc_open_rsrc_dtor */
-static void proc_open_rsrc_dtor(zend_resource *rsrc TSRMLS_DC)
+static void proc_open_rsrc_dtor(zend_resource *rsrc)
{
struct php_process_handle *proc = (struct php_process_handle*)rsrc->ptr;
int i;
@@ -262,7 +262,7 @@ PHP_FUNCTION(proc_terminate)
struct php_process_handle *proc;
zend_long sig_no = SIGTERM;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zproc, &sig_no) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zproc, &sig_no) == FAILURE) {
RETURN_FALSE;
}
@@ -291,7 +291,7 @@ PHP_FUNCTION(proc_close)
zval *zproc;
struct php_process_handle *proc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) {
RETURN_FALSE;
}
@@ -319,7 +319,7 @@ PHP_FUNCTION(proc_get_status)
int running = 1, signaled = 0, stopped = 0;
int exitcode = -1, termsig = 0, stopsig = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zproc) == FAILURE) {
RETURN_FALSE;
}
@@ -459,7 +459,7 @@ PHP_FUNCTION(proc_open)
php_file_descriptor_t slave_pty = -1;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz/|s!a!a!", &command,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "saz/|s!a!a!", &command,
&command_len, &descriptorspec, &pipes, &cwd, &cwd_len, &environment,
&other_options) == FAILURE) {
RETURN_FALSE;
@@ -488,7 +488,7 @@ PHP_FUNCTION(proc_open)
command_len = strlen(command);
if (environment) {
- env = _php_array_to_envp(environment, is_persistent TSRMLS_CC);
+ env = _php_array_to_envp(environment, is_persistent);
} else {
memset(&env, 0, sizeof(env));
}
@@ -508,7 +508,7 @@ PHP_FUNCTION(proc_open)
zval *ztype;
if (str_index) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor spec must be an integer indexed array");
+ php_error_docref(NULL, E_WARNING, "descriptor spec must be an integer indexed array");
goto exit_fail;
}
@@ -528,27 +528,27 @@ PHP_FUNCTION(proc_open)
#ifdef PHP_WIN32
descriptors[ndesc].childend = dup_fd_as_handle((int)fd);
if (descriptors[ndesc].childend == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex);
+ php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex);
goto exit_fail;
}
#else
descriptors[ndesc].childend = dup(fd);
if (descriptors[ndesc].childend < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to dup File-Handle for descriptor %pd - %s", nindex, strerror(errno));
goto exit_fail;
}
#endif
descriptors[ndesc].mode = DESC_FILE;
} else if (Z_TYPE_P(descitem) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor item must be either an array or a File-Handle");
+ php_error_docref(NULL, E_WARNING, "Descriptor item must be either an array or a File-Handle");
goto exit_fail;
} else {
if ((ztype = zend_hash_index_find(Z_ARRVAL_P(descitem), 0)) != NULL) {
convert_to_string_ex(ztype);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing handle qualifier in array");
+ php_error_docref(NULL, E_WARNING, "Missing handle qualifier in array");
goto exit_fail;
}
@@ -559,14 +559,14 @@ PHP_FUNCTION(proc_open)
if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) {
convert_to_string_ex(zmode);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'");
+ php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'pipe'");
goto exit_fail;
}
descriptors[ndesc].mode = DESC_PIPE;
if (0 != pipe(newpipe)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create pipe %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "unable to create pipe %s", strerror(errno));
goto exit_fail;
}
@@ -598,14 +598,14 @@ PHP_FUNCTION(proc_open)
if ((zfile = zend_hash_index_find(Z_ARRVAL_P(descitem), 1)) != NULL) {
convert_to_string_ex(zfile);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'");
+ php_error_docref(NULL, E_WARNING, "Missing file name parameter for 'file'");
goto exit_fail;
}
if ((zmode = zend_hash_index_find(Z_ARRVAL_P(descitem), 2)) != NULL) {
convert_to_string_ex(zmode);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'");
+ php_error_docref(NULL, E_WARNING, "Missing mode parameter for 'file'");
goto exit_fail;
}
@@ -638,7 +638,7 @@ PHP_FUNCTION(proc_open)
/* open things up */
dev_ptmx = open("/dev/ptmx", O_RDWR);
if (dev_ptmx == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open /dev/ptmx, errno %d", errno);
+ php_error_docref(NULL, E_WARNING, "failed to open /dev/ptmx, errno %d", errno);
goto exit_fail;
}
grantpt(dev_ptmx);
@@ -646,7 +646,7 @@ PHP_FUNCTION(proc_open)
slave_pty = open(ptsname(dev_ptmx), O_RDWR);
if (slave_pty == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to open slave pty, errno %d", errno);
+ php_error_docref(NULL, E_WARNING, "failed to open slave pty, errno %d", errno);
goto exit_fail;
}
}
@@ -655,11 +655,11 @@ PHP_FUNCTION(proc_open)
descriptors[ndesc].parentend = dup(dev_ptmx);
descriptors[ndesc].mode_flags = O_RDWR;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "pty pseudo terminal not supported on this system");
+ php_error_docref(NULL, E_WARNING, "pty pseudo terminal not supported on this system");
goto exit_fail;
#endif
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype));
+ php_error_docref(NULL, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_P(ztype));
goto exit_fail;
}
}
@@ -673,7 +673,7 @@ PHP_FUNCTION(proc_open)
char *getcwd_result;
getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
if (!getcwd_result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get current directory");
+ php_error_docref(NULL, E_WARNING, "Cannot get current directory");
goto exit_fail;
}
cwd = cur_cwd;
@@ -738,7 +738,7 @@ PHP_FUNCTION(proc_open)
CloseHandle(descriptors[i].parentend);
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed, error code - %u", dw);
+ php_error_docref(NULL, E_WARNING, "CreateProcess failed, error code - %u", dw);
goto exit_fail;
}
@@ -787,7 +787,7 @@ PHP_FUNCTION(proc_open)
if (descriptors[i].parentend)
close(descriptors[i].parentend);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "procve failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "procve failed - %s", strerror(errno));
goto exit_fail;
}
#elif HAVE_FORK
@@ -856,7 +856,7 @@ PHP_FUNCTION(proc_open)
close(descriptors[i].parentend);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "fork failed - %s", strerror(errno));
goto exit_fail;
diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c
index 441b65288c..6699566863 100644
--- a/ext/standard/quot_print.c
+++ b/ext/standard/quot_print.c
@@ -206,7 +206,7 @@ PHP_FUNCTION(quoted_printable_decode)
zend_string *str_out;
size_t i = 0, j = 0, k;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg1) == FAILURE) {
return;
}
@@ -267,7 +267,7 @@ PHP_FUNCTION(quoted_printable_encode)
zend_string *str;
zend_string *new_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) != SUCCESS) {
return;
}
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 47b55af466..528b38fd41 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -38,7 +38,7 @@
/* {{{ php_srand
*/
-PHPAPI void php_srand(zend_long seed TSRMLS_DC)
+PHPAPI void php_srand(zend_long seed)
{
#ifdef ZTS
BG(rand_seed) = (unsigned int) seed;
@@ -59,12 +59,12 @@ PHPAPI void php_srand(zend_long seed TSRMLS_DC)
/* {{{ php_rand
*/
-PHPAPI zend_long php_rand(TSRMLS_D)
+PHPAPI zend_long php_rand(void)
{
zend_long ret;
if (!BG(rand_is_seeded)) {
- php_srand(GENERATE_SEED() TSRMLS_CC);
+ php_srand(GENERATE_SEED());
}
#ifdef ZTS
@@ -171,7 +171,7 @@ static inline void php_mt_initialize(php_uint32 seed, php_uint32 *state)
/* {{{ php_mt_reload
*/
-static inline void php_mt_reload(TSRMLS_D)
+static inline void php_mt_reload(void)
{
/* Generate N new values in state
Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) */
@@ -192,11 +192,11 @@ static inline void php_mt_reload(TSRMLS_D)
/* {{{ php_mt_srand
*/
-PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC)
+PHPAPI void php_mt_srand(php_uint32 seed)
{
/* Seed the generator with a simple uint32 */
php_mt_initialize(seed, BG(state));
- php_mt_reload(TSRMLS_C);
+ php_mt_reload();
/* Seed only once */
BG(mt_rand_is_seeded) = 1;
@@ -205,7 +205,7 @@ PHPAPI void php_mt_srand(php_uint32 seed TSRMLS_DC)
/* {{{ php_mt_rand
*/
-PHPAPI php_uint32 php_mt_rand(TSRMLS_D)
+PHPAPI php_uint32 php_mt_rand(void)
{
/* Pull a 32-bit integer from the generator state
Every other access function simply transforms the numbers extracted here */
@@ -213,7 +213,7 @@ PHPAPI php_uint32 php_mt_rand(TSRMLS_D)
register php_uint32 s1;
if (BG(left) == 0) {
- php_mt_reload(TSRMLS_C);
+ php_mt_reload();
}
--BG(left);
@@ -231,13 +231,13 @@ PHP_FUNCTION(srand)
{
zend_long seed = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE)
return;
if (ZEND_NUM_ARGS() == 0)
seed = GENERATE_SEED();
- php_srand(seed TSRMLS_CC);
+ php_srand(seed);
}
/* }}} */
@@ -247,13 +247,13 @@ PHP_FUNCTION(mt_srand)
{
zend_long seed = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &seed) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE)
return;
if (ZEND_NUM_ARGS() == 0)
seed = GENERATE_SEED();
- php_mt_srand(seed TSRMLS_CC);
+ php_mt_srand(seed);
}
/* }}} */
@@ -293,10 +293,10 @@ PHP_FUNCTION(rand)
zend_long number;
int argc = ZEND_NUM_ARGS();
- if (argc != 0 && zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE)
+ if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE)
return;
- number = php_rand(TSRMLS_C);
+ number = php_rand();
if (argc == 2) {
RAND_RANGE(number, min, max, PHP_RAND_MAX);
}
@@ -315,16 +315,16 @@ PHP_FUNCTION(mt_rand)
int argc = ZEND_NUM_ARGS();
if (argc != 0) {
- if (zend_parse_parameters(argc TSRMLS_CC, "ll", &min, &max) == FAILURE) {
+ if (zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) {
return;
} else if (max < min) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min);
+ php_error_docref(NULL, E_WARNING, "max(" ZEND_LONG_FMT ") is smaller than min(" ZEND_LONG_FMT ")", max, min);
RETURN_FALSE;
}
}
if (!BG(mt_rand_is_seeded)) {
- php_mt_srand(GENERATE_SEED() TSRMLS_CC);
+ php_mt_srand(GENERATE_SEED());
}
/*
@@ -335,7 +335,7 @@ PHP_FUNCTION(mt_rand)
* Update:
* I talked with Cokus via email and it won't ruin the algorithm
*/
- number = (zend_long) (php_mt_rand(TSRMLS_C) >> 1);
+ number = (zend_long) (php_mt_rand() >> 1);
if (argc == 2) {
RAND_RANGE(number, min, max, PHP_MT_RAND_MAX);
}
diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c
index 62437831bb..ad5e2d1850 100644
--- a/ext/standard/scanf.c
+++ b/ext/standard/scanf.c
@@ -316,7 +316,6 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs)
int staticAssign[STATIC_LIST_SIZE];
int *nassign = staticAssign;
int objIndex, xpgSize, nspace = STATIC_LIST_SIZE;
- TSRMLS_FETCH();
/*
* Initialize an array that records the number of times a variable
@@ -394,7 +393,7 @@ notXpg:
gotSequential = 1;
if (gotXpg) {
mixedXPG:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "%s", "cannot mix \"%\" and \"%n$\" conversion specifiers");
goto error;
}
@@ -445,7 +444,7 @@ xpgCheckDone:
/* problem - cc */
/*
if (flags & SCAN_WIDTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field width may not be specified in %c conversion");
+ php_error_docref(NULL, E_WARNING, "Field width may not be specified in %c conversion");
goto error;
}
*/
@@ -476,11 +475,11 @@ xpgCheckDone:
}
break;
badSet:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unmatched [ in format string");
+ php_error_docref(NULL, E_WARNING, "Unmatched [ in format string");
goto error;
default: {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion character \"%c\"", *ch);
+ php_error_docref(NULL, E_WARNING, "Bad scan conversion character \"%c\"", *ch);
goto error;
}
}
@@ -530,14 +529,14 @@ badSet:
}
for (i = 0; i < numVars; i++) {
if (nassign[i] > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "%s", "Variable is assigned by multiple \"%n$\" conversion specifiers");
goto error;
} else if (!xpgSize && (nassign[i] == 0)) {
/*
* If the space is empty, and xpgSize is 0 (means XPG wasn't
* used, and/or numVars != 0), then too many vars were given
*/
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is not assigned by any conversion specifiers");
+ php_error_docref(NULL, E_WARNING, "Variable is not assigned by any conversion specifiers");
goto error;
}
}
@@ -549,9 +548,9 @@ badSet:
badIndex:
if (gotXpg) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "\"%n$\" argument index out of range");
+ php_error_docref(NULL, E_WARNING, "%s", "\"%n$\" argument index out of range");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of variable names and field specifiers");
+ php_error_docref(NULL, E_WARNING, "Different numbers of variable names and field specifiers");
}
error:
@@ -578,7 +577,7 @@ error:
PHPAPI int php_sscanf_internal( char *string, char *format,
int argCount, zval *args,
- int varStart, zval *return_value TSRMLS_DC)
+ int varStart, zval *return_value)
{
int numVars, nconversions, totalVars = -1;
int i, result;
@@ -625,7 +624,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
if (numVars) {
for (i = varStart;i < argCount;i++){
if ( ! Z_ISREF(args[ i ] ) ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d must be passed by reference", i);
+ php_error_docref(NULL, E_WARNING, "Parameter %d must be passed by reference", i);
scan_set_error_return(numVars, return_value);
return SCAN_ERROR_VAR_PASSED_BYVAL;
}
diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h
index 6d9e8a443c..a94e8006de 100644
--- a/ext/standard/scanf.h
+++ b/ext/standard/scanf.h
@@ -43,7 +43,7 @@
*/
PHPAPI int ValidateFormat(char *format, int numVars, int *totalVars);
PHPAPI int php_sscanf_internal(char *string,char *format,int argCount,zval *args,
- int varStart, zval *return_value TSRMLS_DC);
+ int varStart, zval *return_value);
#endif /* SCANF_H */
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c
index 249828fb3d..e966149e76 100644
--- a/ext/standard/sha1.c
+++ b/ext/standard/sha1.c
@@ -40,7 +40,7 @@ PHP_FUNCTION(sha1)
PHP_SHA1_CTX context;
unsigned char digest[20];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) {
return;
}
@@ -74,7 +74,7 @@ PHP_FUNCTION(sha1_file)
size_t n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c
index d882f5cab6..b9f89a8ac1 100644
--- a/ext/standard/soundex.c
+++ b/ext/standard/soundex.c
@@ -60,7 +60,7 @@ PHP_FUNCTION(soundex)
0, /* Y */
'2'}; /* Z */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
if (str_len == 0) {
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 51e3c14e7a..31ab31cf3f 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -42,7 +42,7 @@ typedef unsigned __int64 php_timeout_ull;
#define GET_CTX_OPT(stream, wrapper, name, val) (PHP_STREAM_CONTEXT(stream) && NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), wrapper, name)))
-static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
+static php_stream_context *decode_context_param(zval *contextresource);
/* Streams based network functions */
@@ -55,14 +55,14 @@ PHP_FUNCTION(stream_socket_pair)
php_stream *s1, *s2;
php_socket_t pair[2];
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "lll",
&domain, &type, &protocol)) {
RETURN_FALSE;
}
if (0 != socketpair((int)domain, (int)type, (int)protocol, pair)) {
char errbuf[256];
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create sockets: [%d]: %s",
+ php_error_docref(NULL, E_WARNING, "failed to create sockets: [%d]: %s",
php_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf)));
RETURN_FALSE;
}
@@ -102,7 +102,7 @@ PHP_FUNCTION(stream_socket_client)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/dlr", &host, &host_len, &zerrno, &zerrstr, &timeout, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -138,9 +138,9 @@ PHP_FUNCTION(stream_socket_client)
if (stream == NULL) {
/* host might contain binary characters */
- zend_string *quoted_host = php_addslashes(host, host_len, 0 TSRMLS_CC);
+ zend_string *quoted_host = php_addslashes(host, host_len, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", quoted_host->val, errstr == NULL ? "Unknown error" : errstr->val);
zend_string_release(quoted_host);
}
@@ -186,7 +186,7 @@ PHP_FUNCTION(stream_socket_server)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/z/lr", &host, &host_len, &zerrno, &zerrstr, &flags, &zcontext) == FAILURE) {
RETURN_FALSE;
}
@@ -210,7 +210,7 @@ PHP_FUNCTION(stream_socket_server)
NULL, NULL, context, &errstr, &err);
if (stream == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val);
+ php_error_docref(NULL, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr->val);
}
if (stream == NULL) {
@@ -248,7 +248,7 @@ PHP_FUNCTION(stream_socket_accept)
zval *zstream;
zend_string *errstr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) {
RETURN_FALSE;
}
@@ -279,7 +279,7 @@ PHP_FUNCTION(stream_socket_accept)
}
php_stream_to_zval(clistream, return_value);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error");
+ php_error_docref(NULL, E_WARNING, "accept failed: %s", errstr ? errstr->val : "Unknown error");
RETVAL_FALSE;
}
@@ -298,7 +298,7 @@ PHP_FUNCTION(stream_socket_get_name)
zend_bool want_peer;
zend_string *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &zstream, &want_peer) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &zstream, &want_peer) == FAILURE) {
RETURN_FALSE;
}
@@ -327,20 +327,20 @@ PHP_FUNCTION(stream_socket_sendto)
php_sockaddr_storage sa;
socklen_t sl = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|ls", &zstream, &data, &datalen, &flags, &target_addr, &target_addr_len) == FAILURE) {
RETURN_FALSE;
}
php_stream_from_zval(stream, zstream);
if (target_addr_len) {
/* parse the address */
- if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr);
+ if (FAILURE == php_network_parse_network_address_with_port(target_addr, target_addr_len, (struct sockaddr*)&sa, &sl)) {
+ php_error_docref(NULL, E_WARNING, "Failed to parse `%s' into a valid network address", target_addr);
RETURN_FALSE;
}
}
- RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl TSRMLS_CC));
+ RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl));
}
/* }}} */
@@ -356,7 +356,7 @@ PHP_FUNCTION(stream_socket_recvfrom)
zend_long flags = 0;
int recvd;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|lz/", &zstream, &to_read, &flags, &zremote) == FAILURE) {
RETURN_FALSE;
}
@@ -368,7 +368,7 @@ PHP_FUNCTION(stream_socket_recvfrom)
}
if (to_read <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
@@ -402,7 +402,7 @@ PHP_FUNCTION(stream_get_contents)
desiredpos = -1L;
zend_string *contents;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ll", &zsrc, &maxlen, &desiredpos) == FAILURE) {
RETURN_FALSE;
}
@@ -422,14 +422,14 @@ PHP_FUNCTION(stream_get_contents)
}
if (seek_res != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Failed to seek to position %pd in the stream", desiredpos);
RETURN_FALSE;
}
}
if (maxlen > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
+ php_error_docref(NULL, E_WARNING, "maxlen truncated from %pd to %d bytes", maxlen, INT_MAX);
maxlen = INT_MAX;
}
if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) {
@@ -450,7 +450,7 @@ PHP_FUNCTION(stream_copy_to_stream)
size_t len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|ll", &zsrc, &zdest, &maxlen, &pos) == FAILURE) {
RETURN_FALSE;
}
@@ -458,7 +458,7 @@ PHP_FUNCTION(stream_copy_to_stream)
php_stream_from_zval(dest, zdest);
if (pos > 0 && php_stream_seek(src, pos, SEEK_SET) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos);
+ php_error_docref(NULL, E_WARNING, "Failed to seek to position " ZEND_LONG_FMT " in the stream", pos);
RETURN_FALSE;
}
@@ -478,7 +478,7 @@ PHP_FUNCTION(stream_get_meta_data)
zval *arg1;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
php_stream_from_zval(stream, arg1);
@@ -575,7 +575,7 @@ PHP_FUNCTION(stream_get_wrappers)
/* }}} */
/* {{{ stream_select related functions */
-static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd TSRMLS_DC)
+static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd)
{
zval *elem;
php_stream *stream;
@@ -613,7 +613,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
return cnt ? 1 : 0;
}
-static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
+static int stream_array_from_fd_set(zval *stream_array, fd_set *fds)
{
zval *elem, *dest_elem, new_array;
php_stream *stream;
@@ -666,7 +666,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
return ret;
}
-static int stream_array_emulate_read_fd_set(zval *stream_array TSRMLS_DC)
+static int stream_array_emulate_read_fd_set(zval *stream_array)
{
zval *elem, *dest_elem, new_array;
php_stream *stream;
@@ -726,7 +726,7 @@ PHP_FUNCTION(stream_select)
zend_long usec = 0;
int set_count, max_set_count = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE)
return;
FD_ZERO(&rfds);
@@ -734,28 +734,28 @@ PHP_FUNCTION(stream_select)
FD_ZERO(&efds);
if (r_array != NULL) {
- set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(r_array, &rfds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (w_array != NULL) {
- set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(w_array, &wfds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (e_array != NULL) {
- set_count = stream_array_to_fd_set(e_array, &efds, &max_fd TSRMLS_CC);
+ set_count = stream_array_to_fd_set(e_array, &efds, &max_fd);
if (set_count > max_set_count)
max_set_count = set_count;
sets += set_count;
}
if (!sets) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed");
+ php_error_docref(NULL, E_WARNING, "No stream arrays were passed");
RETURN_FALSE;
}
@@ -766,10 +766,10 @@ PHP_FUNCTION(stream_select)
convert_to_long_ex(sec);
if (Z_LVAL_P(sec) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The seconds parameter must be greater than 0");
RETURN_FALSE;
} else if (usec < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The microseconds parameter must be greater than 0");
+ php_error_docref(NULL, E_WARNING, "The microseconds parameter must be greater than 0");
RETURN_FALSE;
}
@@ -794,7 +794,7 @@ PHP_FUNCTION(stream_select)
* that we selected, but return only the readable sockets */
if (r_array != NULL) {
- retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC);
+ retval = stream_array_emulate_read_fd_set(r_array);
if (retval > 0) {
if (w_array != NULL) {
zend_hash_clean(Z_ARRVAL_P(w_array));
@@ -809,14 +809,14 @@ PHP_FUNCTION(stream_select)
retval = php_select(max_fd+1, &rfds, &wfds, &efds, tv_p);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
+ php_error_docref(NULL, E_WARNING, "unable to select [%d]: %s (max_fd=%d)",
errno, strerror(errno), max_fd);
RETURN_FALSE;
}
- if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds TSRMLS_CC);
- if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds TSRMLS_CC);
- if (e_array != NULL) stream_array_from_fd_set(e_array, &efds TSRMLS_CC);
+ if (r_array != NULL) stream_array_from_fd_set(r_array, &rfds);
+ if (w_array != NULL) stream_array_from_fd_set(w_array, &wfds);
+ if (e_array != NULL) stream_array_from_fd_set(e_array, &efds);
RETURN_LONG(retval);
}
@@ -824,7 +824,7 @@ PHP_FUNCTION(stream_select)
/* {{{ stream_context related functions */
static void user_space_stream_notifier(php_stream_context *context, int notifycode, int severity,
- char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC)
+ char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr)
{
zval *callback = &context->notifier->ptr;
zval retval;
@@ -842,8 +842,8 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco
ZVAL_LONG(&zvs[4], bytes_sofar);
ZVAL_LONG(&zvs[5], bytes_max);
- if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier");
+ if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, zvs, 0, NULL)) {
+ php_error_docref(NULL, E_WARNING, "failed to call user notifier");
}
for (i = 0; i < 6; i++) {
zval_ptr_dtor(&zvs[i]);
@@ -859,7 +859,7 @@ static void user_space_stream_notifier_dtor(php_stream_notifier *notifier)
}
}
-static int parse_context_options(php_stream_context *context, zval *options TSRMLS_DC)
+static int parse_context_options(php_stream_context *context, zval *options)
{
zval *wval, *oval;
zend_string *wkey, *okey;
@@ -875,14 +875,14 @@ static int parse_context_options(php_stream_context *context, zval *options TSRM
} ZEND_HASH_FOREACH_END();
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value");
+ php_error_docref(NULL, E_WARNING, "options should have the form [\"wrappername\"][\"optionname\"] = $value");
}
} ZEND_HASH_FOREACH_END();
return ret;
}
-static int parse_context_params(php_stream_context *context, zval *params TSRMLS_DC)
+static int parse_context_params(php_stream_context *context, zval *params)
{
int ret = SUCCESS;
zval *tmp;
@@ -901,9 +901,9 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
}
if (NULL != (tmp = zend_hash_str_find(Z_ARRVAL_P(params), "options", sizeof("options")-1))) {
if (Z_TYPE_P(tmp) == IS_ARRAY) {
- parse_context_options(context, tmp TSRMLS_CC);
+ parse_context_options(context, tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
}
}
@@ -913,15 +913,15 @@ static int parse_context_params(php_stream_context *context, zval *params TSRMLS
/* given a zval which is either a stream or a context, return the underlying
* stream_context. If it is a stream that does not have a context assigned, it
* will create and assign a context and return that. */
-static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
+static php_stream_context *decode_context_param(zval *contextresource)
{
php_stream_context *context = NULL;
- context = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context(TSRMLS_C));
+ context = zend_fetch_resource(contextresource, -1, NULL, NULL, 1, php_le_stream_context());
if (context == NULL) {
php_stream *stream;
- stream = zend_fetch_resource(contextresource TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream);
+ stream = zend_fetch_resource(contextresource, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream);
if (stream) {
context = PHP_STREAM_CONTEXT(stream);
@@ -930,7 +930,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
param, but then something is called which requires a context.
Don't give them the default one though since they already said they
didn't want it. */
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
stream->ctx = context->res;
}
}
@@ -947,12 +947,12 @@ PHP_FUNCTION(stream_context_get_options)
zval *zcontext;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
@@ -969,26 +969,26 @@ PHP_FUNCTION(stream_context_set_option)
char *wrappername, *optionname;
size_t wrapperlen, optionlen;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"rssz", &zcontext, &wrappername, &wrapperlen,
&optionname, &optionlen, &zvalue) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"ra", &zcontext, &options) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "called with wrong number or type of parameters; please RTM");
+ php_error_docref(NULL, E_WARNING, "called with wrong number or type of parameters; please RTM");
RETURN_FALSE;
}
}
/* figure out where the context is coming from exactly */
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
if (options) {
/* handle the array syntax */
- RETVAL_BOOL(parse_context_options(context, options TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(parse_context_options(context, options) == SUCCESS);
} else {
php_stream_context_set_option(context, wrappername, optionname, zvalue);
RETVAL_TRUE;
@@ -1003,17 +1003,17 @@ PHP_FUNCTION(stream_context_set_params)
zval *params, *zcontext;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &zcontext, &params) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
- RETVAL_BOOL(parse_context_params(context, params TSRMLS_CC) == SUCCESS);
+ RETVAL_BOOL(parse_context_params(context, params) == SUCCESS);
}
/* }}} */
@@ -1024,13 +1024,13 @@ PHP_FUNCTION(stream_context_get_params)
zval *zcontext, options;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zcontext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
RETURN_FALSE;
}
- context = decode_context_param(zcontext TSRMLS_CC);
+ context = decode_context_param(zcontext);
if (!context) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid stream/context parameter");
+ php_error_docref(NULL, E_WARNING, "Invalid stream/context parameter");
RETURN_FALSE;
}
@@ -1051,17 +1051,17 @@ PHP_FUNCTION(stream_context_get_default)
zval *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a", &params) == FAILURE) {
RETURN_FALSE;
}
if (FG(default_context) == NULL) {
- FG(default_context) = php_stream_context_alloc(TSRMLS_C);
+ FG(default_context) = php_stream_context_alloc();
}
context = FG(default_context);
if (params) {
- parse_context_options(context, params TSRMLS_CC);
+ parse_context_options(context, params);
}
php_stream_context_to_zval(context, return_value);
@@ -1075,16 +1075,16 @@ PHP_FUNCTION(stream_context_set_default)
zval *options = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &options) == FAILURE) {
return;
}
if (FG(default_context) == NULL) {
- FG(default_context) = php_stream_context_alloc(TSRMLS_C);
+ FG(default_context) = php_stream_context_alloc();
}
context = FG(default_context);
- parse_context_options(context, options TSRMLS_CC);
+ parse_context_options(context, options);
php_stream_context_to_zval(context, return_value);
}
@@ -1097,18 +1097,18 @@ PHP_FUNCTION(stream_context_create)
zval *options = NULL, *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &options, &params) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|a!a!", &options, &params) == FAILURE) {
RETURN_FALSE;
}
- context = php_stream_context_alloc(TSRMLS_C);
+ context = php_stream_context_alloc();
if (options) {
- parse_context_options(context, options TSRMLS_CC);
+ parse_context_options(context, options);
}
if (params) {
- parse_context_params(context, params TSRMLS_CC);
+ parse_context_params(context, params);
}
RETURN_RES(context->res);
@@ -1127,7 +1127,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
php_stream_filter *filter = NULL;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lz", &zstream,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|lz", &zstream,
&filtername, &filternamelen, &read_write, &filterparams) == FAILURE) {
RETURN_FALSE;
}
@@ -1149,35 +1149,35 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS)
}
if (read_write & PHP_STREAM_FILTER_READ) {
- filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream));
if (filter == NULL) {
RETURN_FALSE;
}
if (append) {
- ret = php_stream_filter_append_ex(&stream->readfilters, filter TSRMLS_CC);
+ ret = php_stream_filter_append_ex(&stream->readfilters, filter);
} else {
- ret = php_stream_filter_prepend_ex(&stream->readfilters, filter TSRMLS_CC);
+ ret = php_stream_filter_prepend_ex(&stream->readfilters, filter);
}
if (ret != SUCCESS) {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_FALSE;
}
}
if (read_write & PHP_STREAM_FILTER_WRITE) {
- filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream) TSRMLS_CC);
+ filter = php_stream_filter_create(filtername, filterparams, php_stream_is_persistent(stream));
if (filter == NULL) {
RETURN_FALSE;
}
if (append) {
- ret = php_stream_filter_append_ex(&stream->writefilters, filter TSRMLS_CC);
+ ret = php_stream_filter_append_ex(&stream->writefilters, filter);
} else {
- ret = php_stream_filter_prepend_ex(&stream->writefilters, filter TSRMLS_CC);
+ ret = php_stream_filter_prepend_ex(&stream->writefilters, filter);
}
if (ret != SUCCESS) {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_FALSE;
}
}
@@ -1215,26 +1215,26 @@ PHP_FUNCTION(stream_filter_remove)
zval *zfilter;
php_stream_filter *filter;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zfilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zfilter) == FAILURE) {
RETURN_FALSE;
}
- filter = zend_fetch_resource(zfilter TSRMLS_CC, -1, NULL, NULL, 1, php_file_le_stream_filter());
+ filter = zend_fetch_resource(zfilter, -1, NULL, NULL, 1, php_file_le_stream_filter());
if (!filter) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid resource given, not a stream filter");
+ php_error_docref(NULL, E_WARNING, "Invalid resource given, not a stream filter");
RETURN_FALSE;
}
if (php_stream_filter_flush(filter, 1) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to flush filter, not removing");
+ php_error_docref(NULL, E_WARNING, "Unable to flush filter, not removing");
RETURN_FALSE;
}
if (zend_list_close(Z_RES_P(zfilter)) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not invalidate filter, not removing");
+ php_error_docref(NULL, E_WARNING, "Could not invalidate filter, not removing");
RETURN_FALSE;
} else {
- php_stream_filter_remove(filter, 1 TSRMLS_CC);
+ php_stream_filter_remove(filter, 1);
RETURN_TRUE;
}
}
@@ -1251,12 +1251,12 @@ PHP_FUNCTION(stream_get_line)
zend_string *buf;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|s", &zstream, &max_length, &str, &str_len) == FAILURE) {
RETURN_FALSE;
}
if (max_length < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The maximum allowed length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The maximum allowed length must be greater than or equal to zero");
RETURN_FALSE;
}
if (!max_length) {
@@ -1265,7 +1265,7 @@ PHP_FUNCTION(stream_get_line)
php_stream_from_zval(stream, zstream);
- if ((buf = php_stream_get_record(stream, max_length, str, str_len TSRMLS_CC))) {
+ if ((buf = php_stream_get_record(stream, max_length, str, str_len))) {
RETURN_STR(buf);
} else {
RETURN_FALSE;
@@ -1282,7 +1282,7 @@ PHP_FUNCTION(stream_set_blocking)
zend_long block;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &block) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &block) == FAILURE) {
return;
}
@@ -1308,7 +1308,7 @@ PHP_FUNCTION(stream_set_timeout)
php_stream *stream;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "rl|l", &socket, &seconds, &microseconds) == FAILURE) {
+ if (zend_parse_parameters(argc, "rl|l", &socket, &seconds, &microseconds) == FAILURE) {
return;
}
@@ -1353,7 +1353,7 @@ PHP_FUNCTION(stream_set_write_buffer)
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1381,12 +1381,12 @@ PHP_FUNCTION(stream_set_chunk_size)
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &csize) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &csize) == FAILURE) {
RETURN_FALSE;
}
if (csize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize);
+ php_error_docref(NULL, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize);
RETURN_FALSE;
}
/* stream.chunk_size is actually a size_t, but php_stream_set_option
@@ -1394,7 +1394,7 @@ PHP_FUNCTION(stream_set_chunk_size)
* In any case, values larger than INT_MAX for a chunk size make no sense.
*/
if (csize > INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX);
+ php_error_docref(NULL, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX);
RETURN_FALSE;
}
@@ -1416,7 +1416,7 @@ PHP_FUNCTION(stream_set_read_buffer)
size_t buff;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &arg1, &arg2) == FAILURE) {
RETURN_FALSE;
}
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(stream_socket_enable_crypto)
zend_bool enable, cryptokindnull;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
RETURN_FALSE;
}
@@ -1456,7 +1456,7 @@ PHP_FUNCTION(stream_socket_enable_crypto)
zval *val;
if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
+ php_error_docref(NULL, E_WARNING, "When enabling encryption you must specify the crypto type");
RETURN_FALSE;
}
@@ -1467,12 +1467,12 @@ PHP_FUNCTION(stream_socket_enable_crypto)
php_stream_from_zval(sessstream, zsessstream);
}
- if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {
+ if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream) < 0) {
RETURN_FALSE;
}
}
- ret = php_stream_xport_crypto_enable(stream, enable TSRMLS_CC);
+ ret = php_stream_xport_crypto_enable(stream, enable);
switch (ret) {
case -1:
RETURN_FALSE;
@@ -1493,11 +1493,11 @@ PHP_FUNCTION(stream_resolve_include_path)
char *filename, *resolved_path;
size_t filename_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
- resolved_path = zend_resolve_path(filename, (int)filename_len TSRMLS_CC);
+ resolved_path = zend_resolve_path(filename, (int)filename_len);
if (resolved_path) {
// TODO: avoid reallocation ???
@@ -1517,7 +1517,7 @@ PHP_FUNCTION(stream_is_local)
php_stream *stream = NULL;
php_stream_wrapper *wrapper = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zstream) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zstream) == FAILURE) {
RETURN_FALSE;
}
@@ -1530,7 +1530,7 @@ PHP_FUNCTION(stream_is_local)
} else {
convert_to_string_ex(zstream);
- wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0 TSRMLS_CC);
+ wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0);
}
if (!wrapper) {
@@ -1548,7 +1548,7 @@ PHP_FUNCTION(stream_supports_lock)
php_stream *stream;
zval *zsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zsrc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zsrc) == FAILURE) {
RETURN_FALSE;
}
@@ -1574,7 +1574,7 @@ PHP_FUNCTION(stream_socket_shutdown)
zval *zstream;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zstream, &how) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &how) == FAILURE) {
RETURN_FALSE;
}
@@ -1586,7 +1586,7 @@ PHP_FUNCTION(stream_socket_shutdown)
php_stream_from_zval(stream, zstream);
- RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how TSRMLS_CC) == 0);
+ RETURN_BOOL(php_stream_xport_shutdown(stream, (stream_shutdown_t)how) == 0);
}
/* }}} */
#endif
diff --git a/ext/standard/string.c b/ext/standard/string.c
index ec86b08d3c..c686cdd56a 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -249,7 +249,7 @@ PHP_FUNCTION(bin2hex)
zend_string *result;
zend_string *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) {
return;
}
@@ -269,19 +269,19 @@ PHP_FUNCTION(hex2bin)
{
zend_string *result, *data;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &data) == FAILURE) {
return;
}
if (data->len % 2 != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hexadecimal input string must have an even length");
+ php_error_docref(NULL, E_WARNING, "Hexadecimal input string must have an even length");
RETURN_FALSE;
}
result = php_hex2bin((unsigned char *)data->val, data->len);
if (!result) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input string must be hexadecimal string");
+ php_error_docref(NULL, E_WARNING, "Input string must be hexadecimal string");
RETURN_FALSE;
}
@@ -294,7 +294,7 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) /
zend_string *s11, *s22;
zend_long start = 0, len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", &s11,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", &s11,
&s22, &start, &len) == FAILURE) {
return;
}
@@ -537,7 +537,7 @@ PHP_FUNCTION(nl_langinfo)
zend_long item;
char *value;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &item) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &item) == FAILURE) {
return;
}
@@ -702,7 +702,7 @@ PHP_FUNCTION(nl_langinfo)
#endif
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item);
+ php_error_docref(NULL, E_WARNING, "Item '" ZEND_LONG_FMT "' is not valid", item);
RETURN_FALSE;
}
/* }}} */
@@ -724,7 +724,7 @@ PHP_FUNCTION(strcoll)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -739,7 +739,7 @@ PHP_FUNCTION(strcoll)
* it needs to be incrementing.
* Returns: FAILURE/SUCCESS whether the input was correct (i.e. no range errors)
*/
-static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRMLS_DC)
+static inline int php_charmask(unsigned char *input, size_t len, char *mask)
{
unsigned char *end;
unsigned char c;
@@ -756,22 +756,22 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM
/* Error, try to be as helpful as possible:
(a range ending/starting with '.' won't be captured here) */
if (end-len >= input) { /* there was no 'left' char */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the left of '..'");
result = FAILURE;
continue;
}
if (input+2 >= end) { /* there is no 'right' char */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, no character to the right of '..'");
result = FAILURE;
continue;
}
if (input[-1] > input[2]) { /* wrong order */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing");
result = FAILURE;
continue;
}
/* FIXME: better error (a..b..c is the only left possibility?) */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range");
+ php_error_docref(NULL, E_WARNING, "Invalid '..'-range");
result = FAILURE;
continue;
} else {
@@ -788,16 +788,16 @@ static inline int php_charmask(unsigned char *input, size_t len, char *mask TSRM
* mode 3 : trim left and right
* what indicates which chars are to be trimmed. NULL->default (' \t\n\r\v\0')
*/
-PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode TSRMLS_DC)
+PHPAPI char *php_trim(char *c, size_t len, char *what, size_t what_len, zval *return_value, int mode)
{
register size_t i;
size_t trimmed = 0;
char mask[256];
if (what) {
- php_charmask((unsigned char*)what, what_len, mask TSRMLS_CC);
+ php_charmask((unsigned char*)what, what_len, mask);
} else {
- php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask TSRMLS_CC);
+ php_charmask((unsigned char*)" \n\r\t\v\0", 6, mask);
}
if (mode & 1) {
@@ -842,7 +842,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
zend_string *what = NULL;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &what) == FAILURE) {
return;
}
#else
@@ -853,7 +853,7 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
ZEND_PARSE_PARAMETERS_END();
#endif
- php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode TSRMLS_CC);
+ php_trim(str->val, str->len, (what ? what->val : NULL), (what ? what->len : 0), return_value, mode);
}
/* }}} */
@@ -894,7 +894,7 @@ PHP_FUNCTION(wordwrap)
zend_bool docut = 0;
zend_string *newtext;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lsb", &text, &linelength, &breakchar, &breakchar_len, &docut) == FAILURE) {
return;
}
@@ -903,12 +903,12 @@ PHP_FUNCTION(wordwrap)
}
if (breakchar_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Break string cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Break string cannot be empty");
RETURN_FALSE;
}
if (linelength == 0 && docut) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't force cut when width is zero");
+ php_error_docref(NULL, E_WARNING, "Can't force cut when width is zero");
RETURN_FALSE;
}
@@ -1094,7 +1094,7 @@ PHP_FUNCTION(explode)
zend_long limit = ZEND_LONG_MAX; /* No limit */
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &delim, &str, &limit) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &delim, &str, &limit) == FAILURE) {
return;
}
#else
@@ -1107,7 +1107,7 @@ PHP_FUNCTION(explode)
#endif
if (delim->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter");
+ php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
@@ -1136,7 +1136,7 @@ PHP_FUNCTION(explode)
/* {{{ php_implode
*/
-PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC)
+PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value)
{
zval *tmp;
smart_str implstr = {0};
@@ -1212,7 +1212,7 @@ PHP_FUNCTION(implode)
zend_string *delim;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &arg1, &arg2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|z", &arg1, &arg2) == FAILURE) {
return;
}
#else
@@ -1225,7 +1225,7 @@ PHP_FUNCTION(implode)
if (arg2 == NULL) {
if (Z_TYPE_P(arg1) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument must be an array");
+ php_error_docref(NULL, E_WARNING, "Argument must be an array");
return;
}
@@ -1239,12 +1239,12 @@ PHP_FUNCTION(implode)
delim = zval_get_string(arg1);
arr = arg2;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments passed");
+ php_error_docref(NULL, E_WARNING, "Invalid arguments passed");
return;
}
}
- php_implode(delim, arr, return_value TSRMLS_CC);
+ php_implode(delim, arr, return_value);
zend_string_release(delim);
}
/* }}} */
@@ -1262,7 +1262,7 @@ PHP_FUNCTION(strtok)
char *pe;
size_t skipped = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &tok) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &tok) == FAILURE) {
return;
}
@@ -1350,7 +1350,7 @@ PHP_FUNCTION(strtoupper)
zend_string *arg;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
@@ -1385,7 +1385,7 @@ PHP_FUNCTION(strtolower)
zend_string *result;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -1402,7 +1402,7 @@ PHP_FUNCTION(strtolower)
/* {{{ php_basename
*/
-PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen TSRMLS_DC)
+PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t sufflen)
{
char *c, *comp, *cend;
size_t inc_len, cnt;
@@ -1487,11 +1487,11 @@ PHP_FUNCTION(basename)
char *string, *suffix = NULL;
size_t string_len, suffix_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &string, &string_len, &suffix, &suffix_len) == FAILURE) {
return;
}
- RETURN_STR(php_basename(string, string_len, suffix, suffix_len TSRMLS_CC));
+ RETURN_STR(php_basename(string, string_len, suffix, suffix_len));
}
/* }}} */
@@ -1511,7 +1511,7 @@ PHP_FUNCTION(dirname)
zend_string *ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
@@ -1533,7 +1533,7 @@ PHP_FUNCTION(pathinfo)
zend_long opt = PHP_PATHINFO_ALL;
zend_string *ret = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &path_len, &opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &path, &path_len, &opt) == FAILURE) {
return;
}
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(pathinfo)
}
if (have_basename) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
add_assoc_str(&tmp, "basename", zend_string_copy(ret));
}
@@ -1560,7 +1560,7 @@ PHP_FUNCTION(pathinfo)
ptrdiff_t idx;
if (!have_basename) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
}
p = zend_memrchr(ret->val, '.', ret->len);
@@ -1577,7 +1577,7 @@ PHP_FUNCTION(pathinfo)
/* Have we already looked up the basename? */
if (!have_basename && !ret) {
- ret = php_basename(path, path_len, NULL, 0 TSRMLS_CC);
+ ret = php_basename(path, path_len, NULL, 0);
}
p = zend_memrchr(ret->val, '.', ret->len);
@@ -1655,7 +1655,7 @@ PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end)
/* {{{ php_needle_char
*/
-static int php_needle_char(zval *needle, char *target TSRMLS_DC)
+static int php_needle_char(zval *needle, char *target)
{
switch (Z_TYPE_P(needle)) {
case IS_LONG:
@@ -1675,7 +1675,7 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC)
*target = (char) zval_get_long(needle);
return SUCCESS;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer");
+ php_error_docref(NULL, E_WARNING, "needle is not a string or an integer");
return FAILURE;
}
}
@@ -1693,7 +1693,7 @@ PHP_FUNCTION(stristr)
char needle_char[2];
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) {
return;
}
@@ -1702,7 +1702,7 @@ PHP_FUNCTION(stristr)
if (Z_TYPE_P(needle) == IS_STRING) {
char *orig_needle;
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1710,7 +1710,7 @@ PHP_FUNCTION(stristr)
found = php_stristr(haystack_dup, orig_needle, haystack->len, Z_STRLEN_P(needle));
efree(orig_needle);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1745,19 +1745,19 @@ PHP_FUNCTION(strstr)
zend_long found_offset;
zend_bool part = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|b", &haystack, &needle, &part) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &haystack, &needle, &part) == FAILURE) {
return;
}
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
RETURN_FALSE;
}
found = (char*)php_memnstr(haystack->val, Z_STRVAL_P(needle), Z_STRLEN_P(needle), haystack->val + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
RETURN_FALSE;
}
needle_char[1] = 0;
@@ -1792,7 +1792,7 @@ PHP_FUNCTION(strpos)
zend_long offset = 0;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) {
return;
}
#else
@@ -1805,13 +1805,13 @@ PHP_FUNCTION(strpos)
#endif
if (offset < 0 || (size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
if (Z_TYPE_P(needle) == IS_STRING) {
if (!Z_STRLEN_P(needle)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty needle");
+ php_error_docref(NULL, E_WARNING, "Empty needle");
RETURN_FALSE;
}
@@ -1820,7 +1820,7 @@ PHP_FUNCTION(strpos)
Z_STRLEN_P(needle),
haystack->val + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
RETURN_FALSE;
}
needle_char[1] = 0;
@@ -1850,12 +1850,12 @@ PHP_FUNCTION(stripos)
char needle_char[2];
zval *needle;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &needle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) {
return;
}
if (offset < 0 || (size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
@@ -1876,7 +1876,7 @@ PHP_FUNCTION(stripos)
php_strtolower(needle_dup, Z_STRLEN_P(needle));
found = (char*)php_memnstr(haystack_dup + offset, needle_dup, Z_STRLEN_P(needle), haystack_dup + haystack->len);
} else {
- if (php_needle_char(needle, needle_char TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, needle_char) != SUCCESS) {
efree(haystack_dup);
RETURN_FALSE;
}
@@ -1913,7 +1913,7 @@ PHP_FUNCTION(strrpos)
char *p, *e, ord_needle[2];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
#else
@@ -1929,7 +1929,7 @@ PHP_FUNCTION(strrpos)
needle = Z_STRVAL_P(zneedle);
needle_len = Z_STRLEN_P(zneedle);
} else {
- if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(zneedle, ord_needle) != SUCCESS) {
RETURN_FALSE;
}
ord_needle[1] = '\0';
@@ -1943,14 +1943,14 @@ PHP_FUNCTION(strrpos)
if (offset >= 0) {
if ((size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack->val + (size_t)offset;
e = haystack->val + haystack->len - needle_len;
} else {
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
@@ -1996,7 +1996,7 @@ PHP_FUNCTION(strripos)
char *p, *e, ord_needle[2];
char *needle_dup, *haystack_dup;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) {
RETURN_FALSE;
}
@@ -2004,7 +2004,7 @@ PHP_FUNCTION(strripos)
needle = Z_STRVAL_P(zneedle);
needle_len = Z_STRLEN_P(zneedle);
} else {
- if (php_needle_char(zneedle, ord_needle TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(zneedle, ord_needle) != SUCCESS) {
RETURN_FALSE;
}
ord_needle[1] = '\0';
@@ -2021,7 +2021,7 @@ PHP_FUNCTION(strripos)
Can also avoid tolower emallocs */
if (offset >= 0) {
if ((size_t)offset > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack->val + offset;
@@ -2029,7 +2029,7 @@ PHP_FUNCTION(strripos)
} else {
p = haystack->val;
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
e = haystack->val + haystack->len + offset;
@@ -2054,7 +2054,7 @@ PHP_FUNCTION(strripos)
if ((size_t)offset > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack_dup + offset;
@@ -2063,7 +2063,7 @@ PHP_FUNCTION(strripos)
if (offset < -INT_MAX || (size_t)(-offset) > haystack->len) {
efree(needle_dup);
efree(haystack_dup);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset is greater than the length of haystack string");
+ php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
RETURN_FALSE;
}
p = haystack_dup;
@@ -2098,7 +2098,7 @@ PHP_FUNCTION(strrchr)
const char *found = NULL;
zend_long found_offset;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &haystack, &needle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &haystack, &needle) == FAILURE) {
return;
}
@@ -2106,7 +2106,7 @@ PHP_FUNCTION(strrchr)
found = zend_memrchr(haystack->val, *Z_STRVAL_P(needle), haystack->len);
} else {
char needle_chr;
- if (php_needle_char(needle, &needle_chr TSRMLS_CC) != SUCCESS) {
+ if (php_needle_char(needle, &needle_chr) != SUCCESS) {
RETURN_FALSE;
}
@@ -2182,12 +2182,12 @@ PHP_FUNCTION(chunk_split)
zend_long chunklen = 76;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &chunklen, &end, &endlen) == FAILURE) {
return;
}
if (chunklen <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Chunk length should be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Chunk length should be greater than zero");
RETURN_FALSE;
}
@@ -2223,7 +2223,7 @@ PHP_FUNCTION(substr)
int argc = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &str, &f, &l) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &str, &f, &l) == FAILURE) {
return;
}
#else
@@ -2303,7 +2303,7 @@ PHP_FUNCTION(substr_replace)
HashPosition pos_from, pos_repl, pos_len;
zval *tmp_str = NULL, *tmp_from = NULL, *tmp_repl = NULL, *tmp_len= NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &str, &repl, &from, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &str, &repl, &from, &len) == FAILURE) {
return;
}
@@ -2332,12 +2332,12 @@ PHP_FUNCTION(substr_replace)
(argc == 3 && Z_TYPE_P(from) == IS_ARRAY) ||
(argc == 4 && Z_TYPE_P(from) != Z_TYPE_P(len))
) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should be of same type - numerical or array ");
+ php_error_docref(NULL, E_WARNING, "'from' and 'len' should be of same type - numerical or array ");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
if (argc == 4 && Z_TYPE_P(from) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(from)) != zend_hash_num_elements(Z_ARRVAL_P(len))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'from' and 'len' should have the same number of elements");
+ php_error_docref(NULL, E_WARNING, "'from' and 'len' should have the same number of elements");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
}
@@ -2399,7 +2399,7 @@ PHP_FUNCTION(substr_replace)
result->val[result->len] = '\0';
RETURN_NEW_STR(result);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented");
+ php_error_docref(NULL, E_WARNING, "Functionality of 'from' and 'len' as arrays is not implemented");
RETURN_STR(zend_string_copy(Z_STR_P(str)));
}
} else { /* str is array of strings */
@@ -2511,7 +2511,7 @@ PHP_FUNCTION(substr_replace)
}
/*???
if (Z_REFCOUNT_P(orig_str) != refcount) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument was modified while replacing");
+ php_error_docref(NULL, E_WARNING, "Argument was modified while replacing");
if (Z_TYPE_P(tmp_repl) != IS_STRING) {
zval_dtor(repl_str);
}
@@ -2576,7 +2576,7 @@ PHP_FUNCTION(quotemeta)
char c;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &old) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &old) == FAILURE) {
return;
}
@@ -2623,7 +2623,7 @@ PHP_FUNCTION(ord)
size_t str_len;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) {
return;
}
#else
@@ -2647,7 +2647,7 @@ PHP_FUNCTION(chr)
WRONG_PARAM_COUNT;
}
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "l", &c) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l", &c) == FAILURE) {
c = 0;
}
@@ -2675,7 +2675,7 @@ PHP_FUNCTION(ucfirst)
zend_string *str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -2709,7 +2709,7 @@ PHP_FUNCTION(lcfirst)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -2733,7 +2733,7 @@ PHP_FUNCTION(ucwords)
char mask[256];
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s", &str, &delims, &delims_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s", &str, &delims, &delims_len) == FAILURE) {
return;
}
#else
@@ -2748,7 +2748,7 @@ PHP_FUNCTION(ucwords)
RETURN_EMPTY_STRING();
}
- php_charmask((unsigned char *)delims, delims_len, mask TSRMLS_CC);
+ php_charmask((unsigned char *)delims, delims_len, mask);
ZVAL_STRINGL(return_value, str->val, str->len);
r = Z_STRVAL_P(return_value);
@@ -2787,7 +2787,7 @@ PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size
}
/* }}} */
-static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ */
+static int php_strtr_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
@@ -2797,7 +2797,7 @@ static int php_strtr_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{
/* }}} */
/* {{{ php_strtr_array */
-static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats TSRMLS_DC)
+static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTable *pats)
{
zend_ulong num_key;
zend_string *str_key;
@@ -2887,7 +2887,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl
len = zend_hash_num_elements(&num_hash);
if ((maxlen - (minlen - 1) - len > 0) &&
/* smart algorithm, sort key lengths first */
- zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0 TSRMLS_CC) == SUCCESS) {
+ zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0) == SUCCESS) {
pos = 0;
while (pos <= slen - minlen) {
@@ -2956,7 +2956,7 @@ PHP_FUNCTION(strtr)
int ac = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|s", &str, &str_len, &from, &to, &to_len) == FAILURE) {
return;
}
#else
@@ -2969,7 +2969,7 @@ PHP_FUNCTION(strtr)
#endif
if (ac == 2 && Z_TYPE_P(from) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument is not an array");
+ php_error_docref(NULL, E_WARNING, "The second argument is not an array");
RETURN_FALSE;
}
@@ -2979,7 +2979,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2) {
- php_strtr_array(return_value, str, str_len, HASH_OF(from) TSRMLS_CC);
+ php_strtr_array(return_value, str, str_len, HASH_OF(from));
} else {
convert_to_string_ex(from);
@@ -3003,7 +3003,7 @@ PHP_FUNCTION(strrev)
char *e, *p;
zend_string *n;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -3077,7 +3077,7 @@ PHP_FUNCTION(similar_text)
int ac = ZEND_NUM_ARGS();
size_t sim;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|z/", &t1, &t2, &percent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/", &t1, &t2, &percent) == FAILURE) {
return;
}
@@ -3106,7 +3106,7 @@ PHP_FUNCTION(similar_text)
/* {{{ php_stripslashes
*
* be careful, this edits the string in-place */
-PHPAPI void php_stripslashes(char *str, size_t *len TSRMLS_DC)
+PHPAPI void php_stripslashes(char *str, size_t *len)
{
char *s, *t;
size_t l;
@@ -3152,7 +3152,7 @@ PHP_FUNCTION(addcslashes)
{
zend_string *str, *what;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &str, &what) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &str, &what) == FAILURE) {
return;
}
@@ -3164,7 +3164,7 @@ PHP_FUNCTION(addcslashes)
RETURN_STRINGL(str->val, str->len);
}
- RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len TSRMLS_CC));
+ RETURN_STR(php_addcslashes(str->val, str->len, 0, what->val, what->len));
}
/* }}} */
@@ -3175,7 +3175,7 @@ PHP_FUNCTION(addslashes)
zend_string *str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
#else
@@ -3188,7 +3188,7 @@ PHP_FUNCTION(addslashes)
RETURN_EMPTY_STRING();
}
- RETURN_STR(php_addslashes(str->val, str->len, 0 TSRMLS_CC));
+ RETURN_STR(php_addslashes(str->val, str->len, 0));
}
/* }}} */
@@ -3198,7 +3198,7 @@ PHP_FUNCTION(stripcslashes)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
@@ -3213,12 +3213,12 @@ PHP_FUNCTION(stripslashes)
{
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return;
}
ZVAL_STRINGL(return_value, str->val, str->len);
- php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC);
+ php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value));
}
/* }}} */
@@ -3229,7 +3229,6 @@ char *php_strerror(int errnum)
{
extern int sys_nerr;
extern char *sys_errlist[];
- TSRMLS_FETCH();
if ((unsigned int) errnum < sys_nerr) {
return(sys_errlist[errnum]);
@@ -3306,7 +3305,7 @@ PHPAPI void php_stripcslashes(char *str, size_t *len)
/* {{{ php_addcslashes
*/
-PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength TSRMLS_DC)
+PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_free, char *what, size_t wlength)
{
char flags[256];
char *source, *target;
@@ -3319,7 +3318,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f
wlength = strlen(what);
}
- php_charmask((unsigned char *)what, wlength, flags TSRMLS_CC);
+ php_charmask((unsigned char *)what, wlength, flags);
for (source = (char*)str, end = source + length, target = new_str->val; source < end; source++) {
c = *source;
@@ -3356,7 +3355,7 @@ PHPAPI zend_string *php_addcslashes(const char *str, size_t length, int should_f
/* {{{ php_addslashes
*/
-PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free TSRMLS_DC)
+PHPAPI zend_string *php_addslashes(char *str, size_t length, int should_free)
{
/* maximum string length, worst case situation */
char *source, *target;
@@ -3663,7 +3662,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle,
/* {{{ php_str_replace_in_subject
*/
-static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count TSRMLS_DC)
+static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, size_t *replace_count)
{
zval *search_entry,
*replace_entry = NULL,
@@ -3792,7 +3791,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
int argc = ZEND_NUM_ARGS();
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) {
return;
}
#else
@@ -3826,7 +3825,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
and add the result to the return_value array. */
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(subject), num_key, string_key, subject_entry) {
if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) {
- php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
+ php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL);
} else {
ZVAL_COPY(&result, subject_entry);
}
@@ -3838,7 +3837,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
}
} ZEND_HASH_FOREACH_END();
} else { /* if subject is not an array */
- php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
+ php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL);
}
if (argc > 3) {
zval_dtor(zcount);
@@ -3878,7 +3877,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
size_t str_len;
zend_string *broken_str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &max_chars) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &max_chars) == FAILURE) {
return;
}
@@ -4063,7 +4062,7 @@ PHP_FUNCTION(nl2br)
zend_bool is_xhtml = 1;
zend_string *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &str, &is_xhtml) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &str, &is_xhtml) == FAILURE) {
return;
}
@@ -4142,7 +4141,7 @@ PHP_FUNCTION(strip_tags)
char *allowed_tags=NULL;
size_t allowed_tags_len=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|z", &str, &allow) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|z", &str, &allow) == FAILURE) {
return;
}
@@ -4180,7 +4179,7 @@ PHP_FUNCTION(setlocale)
char *loc, *retval;
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z+", &pcategory, &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z+", &pcategory, &args, &num_args) == FAILURE) {
return;
}
@@ -4192,7 +4191,7 @@ PHP_FUNCTION(setlocale)
char *category;
zval tmp;
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
+ php_error_docref(NULL, E_DEPRECATED, "Passing locale category name as string is deprecated. Use the LC_* -constants instead");
ZVAL_DUP(&tmp, pcategory);
convert_to_string_ex(&tmp);
@@ -4215,7 +4214,7 @@ PHP_FUNCTION(setlocale)
} else if (!strcasecmp("LC_TIME", category)) {
cat = LC_TIME;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category);
+ php_error_docref(NULL, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category);
zval_dtor(&tmp);
RETURN_FALSE;
@@ -4248,7 +4247,7 @@ PHP_FUNCTION(setlocale)
} else {
loc = Z_STRVAL(tmp);
if (Z_STRLEN(tmp) >= 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Specified locale name is too long");
+ php_error_docref(NULL, E_WARNING, "Specified locale name is too long");
zval_dtor(&tmp);
break;
}
@@ -4292,7 +4291,7 @@ PHP_FUNCTION(parse_str)
char *res = NULL;
size_t arglen;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &arg, &arglen, &arrayArg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z/", &arg, &arglen, &arrayArg) == FAILURE) {
return;
}
@@ -4300,17 +4299,17 @@ PHP_FUNCTION(parse_str)
if (arrayArg == NULL) {
zval tmp;
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
ZVAL_ARR(&tmp, symbol_table);
- sapi_module.treat_data(PARSE_STRING, res, &tmp TSRMLS_CC);
+ sapi_module.treat_data(PARSE_STRING, res, &tmp);
} else {
zval ret;
/* Clear out the array that was passed in. */
zval_dtor(arrayArg);
array_init(&ret);
- sapi_module.treat_data(PARSE_STRING, res, &ret TSRMLS_CC);
+ sapi_module.treat_data(PARSE_STRING, res, &ret);
ZVAL_COPY_VALUE(arrayArg, &ret);
}
}
@@ -4692,7 +4691,7 @@ PHP_FUNCTION(str_getcsv)
char *delim_str = NULL, *enc_str = NULL, *esc_str = NULL;
size_t delim_len = 0, enc_len = 0, esc_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|sss", &str, &delim_str, &delim_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|sss", &str, &delim_str, &delim_len,
&enc_str, &enc_len, &esc_str, &esc_len) == FAILURE) {
return;
}
@@ -4701,7 +4700,7 @@ PHP_FUNCTION(str_getcsv)
enc = enc_len ? enc_str[0] : enc;
esc = esc_len ? esc_str[0] : esc;
- php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value TSRMLS_CC);
+ php_fgetcsv(NULL, delim, enc, esc, str->len, str->val, return_value);
}
/* }}} */
@@ -4714,12 +4713,12 @@ PHP_FUNCTION(str_repeat)
zend_string *result; /* Resulting string */
size_t result_len; /* Length of the resulting string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl", &input_str, &mult) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl", &input_str, &mult) == FAILURE) {
return;
}
if (mult < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Second argument has to be greater than or equal to 0");
return;
}
@@ -4769,12 +4768,12 @@ PHP_FUNCTION(count_chars)
size_t retlen=0;
size_t tmp = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &input, &mymode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &input, &mymode) == FAILURE) {
return;
}
if (mymode < 0 || mymode > 4) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown mode");
+ php_error_docref(NULL, E_WARNING, "Unknown mode");
RETURN_FALSE;
}
@@ -4831,7 +4830,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
{
zend_string *s1, *s2;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &s1, &s2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &s1, &s2) == FAILURE) {
return;
}
@@ -4841,7 +4840,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
}
/* }}} */
-PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive) /* {{{ */
{
zend_string *str1 = zval_get_string(op1);
zend_string *str2 = zval_get_string(op2);
@@ -4854,15 +4853,15 @@ PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2
}
/* }}} */
-PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- return string_natural_compare_function_ex(result, op1, op2, 1 TSRMLS_CC);
+ return string_natural_compare_function_ex(result, op1, op2, 1);
}
/* }}} */
-PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
+PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- return string_natural_compare_function_ex(result, op1, op2, 0 TSRMLS_CC);
+ return string_natural_compare_function_ex(result, op1, op2, 0);
}
/* }}} */
@@ -4976,12 +4975,12 @@ PHP_FUNCTION(substr_count)
size_t haystack_len, needle_len;
char *p, *endp, cmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ll", &haystack, &haystack_len, &needle, &needle_len, &offset, &length) == FAILURE) {
return;
}
if (needle_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty substring");
+ php_error_docref(NULL, E_WARNING, "Empty substring");
RETURN_FALSE;
}
@@ -4989,12 +4988,12 @@ PHP_FUNCTION(substr_count)
endp = p + haystack_len;
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset should be greater than or equal to 0");
+ php_error_docref(NULL, E_WARNING, "Offset should be greater than or equal to 0");
RETURN_FALSE;
}
if ((size_t)offset > haystack_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset);
+ php_error_docref(NULL, E_WARNING, "Offset value " ZEND_LONG_FMT " exceeds string length", offset);
RETURN_FALSE;
}
p += offset;
@@ -5002,11 +5001,11 @@ PHP_FUNCTION(substr_count)
if (ac == 4) {
if (length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0");
+ php_error_docref(NULL, E_WARNING, "Length should be greater than 0");
RETURN_FALSE;
}
if (length > (haystack_len - offset)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length);
+ php_error_docref(NULL, E_WARNING, "Length value " ZEND_LONG_FMT " exceeds string length", length);
RETURN_FALSE;
}
endp = p + length;
@@ -5046,7 +5045,7 @@ PHP_FUNCTION(str_pad)
size_t i, left_pad=0, right_pad=0;
zend_string *result = NULL; /* Resulting string */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|sl", &input, &pad_length, &pad_str, &pad_str_len, &pad_type_val) == FAILURE) {
return;
}
@@ -5057,18 +5056,18 @@ PHP_FUNCTION(str_pad)
}
if (pad_str_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Padding string cannot be empty");
return;
}
if (pad_type_val < STR_PAD_LEFT || pad_type_val > STR_PAD_BOTH) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH");
+ php_error_docref(NULL, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH");
return;
}
num_pad_chars = pad_length - input->len;
if (num_pad_chars >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding length is too long");
+ php_error_docref(NULL, E_WARNING, "Padding length is too long");
return;
}
@@ -5120,12 +5119,12 @@ PHP_FUNCTION(sscanf)
size_t str_len, format_len;
int result, num_args = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss*", &str, &str_len, &format, &format_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss*", &str, &str_len, &format, &format_len,
&args, &num_args) == FAILURE) {
return;
}
- result = php_sscanf_internal(str, format, num_args, args, 0, return_value TSRMLS_CC);
+ result = php_sscanf_internal(str, format, num_args, args, 0, return_value);
if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
WRONG_PARAM_COUNT;
@@ -5142,7 +5141,7 @@ PHP_FUNCTION(str_rot13)
{
zend_string *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
@@ -5152,7 +5151,7 @@ PHP_FUNCTION(str_rot13)
}
/* }}} */
-static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */
+static void php_string_shuffle(char *str, zend_long len) /* {{{ */
{
zend_long n_elems, rnd_idx, n_left;
char temp;
@@ -5167,7 +5166,7 @@ static void php_string_shuffle(char *str, zend_long len TSRMLS_DC) /* {{{ */
n_left = n_elems;
while (--n_left) {
- rnd_idx = php_rand(TSRMLS_C);
+ rnd_idx = php_rand();
RAND_RANGE(rnd_idx, 0, n_left, PHP_RAND_MAX);
if (rnd_idx != n_left) {
temp = str[n_left];
@@ -5184,13 +5183,13 @@ PHP_FUNCTION(str_shuffle)
{
zend_string *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) {
return;
}
RETVAL_STRINGL(arg->val, arg->len);
if (Z_STRLEN_P(return_value) > 1) {
- php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value) TSRMLS_CC);
+ php_string_shuffle(Z_STRVAL_P(return_value), (zend_long) Z_STRLEN_P(return_value));
}
}
/* }}} */
@@ -5213,7 +5212,7 @@ PHP_FUNCTION(str_word_count)
size_t char_list_len = 0, word_count = 0;
zend_long type = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls", &str, &type, &char_list, &char_list_len) == FAILURE) {
return;
}
@@ -5232,12 +5231,12 @@ PHP_FUNCTION(str_word_count)
/* nothing to be done */
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type);
+ php_error_docref(NULL, E_WARNING, "Invalid format value " ZEND_LONG_FMT, type);
RETURN_FALSE;
}
if (char_list) {
- php_charmask((unsigned char *)char_list, char_list_len, ch TSRMLS_CC);
+ php_charmask((unsigned char *)char_list, char_list_len, ch);
}
p = str->val;
@@ -5292,7 +5291,7 @@ PHP_FUNCTION(money_format)
zend_bool check = 0;
zend_string *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sd", &format, &format_len, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sd", &format, &format_len, &value) == FAILURE) {
return;
}
@@ -5305,7 +5304,7 @@ PHP_FUNCTION(money_format)
check = 1;
p++;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only a single %%i or %%n token can be used");
+ php_error_docref(NULL, E_WARNING, "Only a single %%i or %%n token can be used");
RETURN_FALSE;
}
}
@@ -5331,12 +5330,12 @@ PHP_FUNCTION(str_split)
char *p;
size_t n_reg_segments;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|l", &str, &split_length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|l", &str, &split_length) == FAILURE) {
return;
}
if (split_length <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length of each segment must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "The length of each segment must be greater than zero");
RETURN_FALSE;
}
@@ -5370,12 +5369,12 @@ PHP_FUNCTION(strpbrk)
zend_string *haystack, *char_list;
char *haystack_ptr, *cl_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &haystack, &char_list) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &haystack, &char_list) == FAILURE) {
RETURN_FALSE;
}
if (!char_list->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The character list cannot be empty");
+ php_error_docref(NULL, E_WARNING, "The character list cannot be empty");
RETURN_FALSE;
}
@@ -5400,7 +5399,7 @@ PHP_FUNCTION(substr_compare)
zend_bool cs=0;
size_t cmp_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSl|lb", &s1, &s2, &offset, &len, &cs) == FAILURE) {
RETURN_FALSE;
}
@@ -5408,7 +5407,7 @@ PHP_FUNCTION(substr_compare)
if (len == 0) {
RETURN_LONG(0L);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The length must be greater than or equal to zero");
+ php_error_docref(NULL, E_WARNING, "The length must be greater than or equal to zero");
RETURN_FALSE;
}
}
@@ -5419,7 +5418,7 @@ PHP_FUNCTION(substr_compare)
}
if ((size_t)offset >= s1->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
+ php_error_docref(NULL, E_WARNING, "The start position cannot exceed initial string length");
RETURN_FALSE;
}
diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c
index 036c189e75..49bb871ca5 100644
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -138,7 +138,7 @@ PHP_FUNCTION(openlog)
zend_long option, facility;
size_t ident_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &ident,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll", &ident,
&ident_len, &option, &facility) == FAILURE) {
return;
}
@@ -179,7 +179,7 @@ PHP_FUNCTION(syslog)
char *message;
size_t message_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &priority,
&message, &message_len) == FAILURE) {
return;
}
diff --git a/ext/standard/type.c b/ext/standard/type.c
index a773e6c53c..acd1ac8613 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -27,7 +27,7 @@ PHP_FUNCTION(gettype)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -74,7 +74,7 @@ PHP_FUNCTION(gettype)
case IS_RESOURCE:
{
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg));
if (type_name) {
RETVAL_STRING("resource");
@@ -96,7 +96,7 @@ PHP_FUNCTION(settype)
char *type;
size_t type_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &var, &type, &type_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &var, &type, &type_len) == FAILURE) {
return;
}
@@ -123,10 +123,10 @@ PHP_FUNCTION(settype)
} else if (!strcasecmp(type, "null")) {
convert_to_null(var);
} else if (!strcasecmp(type, "resource")) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type");
+ php_error_docref(NULL, E_WARNING, "Cannot convert to resource type");
RETURN_FALSE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type");
+ php_error_docref(NULL, E_WARNING, "Invalid type");
RETURN_FALSE;
}
RETVAL_TRUE;
@@ -144,7 +144,7 @@ PHP_FUNCTION(intval)
WRONG_PARAM_COUNT;
}
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &num, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &num, &base) == FAILURE) {
return;
}
#else
@@ -166,7 +166,7 @@ PHP_FUNCTION(floatval)
{
zval *num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) {
return;
}
@@ -181,11 +181,11 @@ PHP_FUNCTION(boolval)
{
zval *val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &val) == FAILURE) {
return;
}
- RETURN_BOOL(zend_is_true(val TSRMLS_CC));
+ RETURN_BOOL(zend_is_true(val));
}
/* }}} */
@@ -194,7 +194,7 @@ PHP_FUNCTION(boolval)
PHP_FUNCTION(strval)
{
zval *num;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &num) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) {
return;
}
@@ -207,7 +207,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
zval *arg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
RETURN_FALSE;
}
ZVAL_DEREF(arg);
@@ -225,7 +225,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
RETURN_FALSE;
}
} else if (type == IS_RESOURCE) {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg));
if (!type_name) {
RETURN_FALSE;
}
@@ -262,7 +262,7 @@ PHP_FUNCTION(is_bool)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
RETURN_FALSE;
}
@@ -322,7 +322,7 @@ PHP_FUNCTION(is_numeric)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -354,7 +354,7 @@ PHP_FUNCTION(is_scalar)
zval *arg;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
#else
@@ -390,7 +390,7 @@ PHP_FUNCTION(is_callable)
zend_bool syntax_only = 0;
int check_flags = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|bz/", &var,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|bz/", &var,
&syntax_only, &callable_name) == FAILURE) {
return;
}
@@ -399,7 +399,7 @@ PHP_FUNCTION(is_callable)
check_flags |= IS_CALLABLE_CHECK_SYNTAX_ONLY;
}
if (ZEND_NUM_ARGS() > 2) {
- retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error TSRMLS_CC);
+ retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error);
zval_dtor(callable_name);
//??? is it necessary to be consistent with old PHP ("\0" support)
if (UNEXPECTED(name->len) != strlen(name->val)) {
@@ -409,7 +409,7 @@ PHP_FUNCTION(is_callable)
ZVAL_STR(callable_name, name);
}
} else {
- retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error TSRMLS_CC);
+ retval = zend_is_callable_ex(var, NULL, check_flags, NULL, NULL, &error);
}
if (error) {
/* ignore errors */
diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c
index 1014f5d9ba..1030d97410 100644
--- a/ext/standard/uniqid.c
+++ b/ext/standard/uniqid.c
@@ -54,7 +54,7 @@ PHP_FUNCTION(uniqid)
size_t prefix_len = 0;
struct timeval tv;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &prefix, &prefix_len,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sb", &prefix, &prefix_len,
&more_entropy)) {
return;
}
@@ -62,7 +62,7 @@ PHP_FUNCTION(uniqid)
#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!more_entropy) {
#if defined(__CYGWIN__)
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must use 'more entropy' under CYGWIN");
+ php_error_docref(NULL, E_WARNING, "You must use 'more entropy' under CYGWIN");
RETURN_FALSE;
#else
usleep(1);
@@ -77,7 +77,7 @@ PHP_FUNCTION(uniqid)
* digits for usecs.
*/
if (more_entropy) {
- uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg(TSRMLS_C) * 10);
+ uniqid = strpprintf(0, "%s%08x%05x%.8F", prefix, sec, usec, php_combined_lcg() * 10);
} else {
uniqid = strpprintf(0, "%s%08x%05x", prefix, sec, usec);
}
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 7d408ef88a..ebd2c4108e 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -375,7 +375,7 @@ PHP_FUNCTION(parse_url)
php_url *resource;
zend_long key = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &str, &str_len, &key) == FAILURE) {
return;
}
@@ -412,7 +412,7 @@ PHP_FUNCTION(parse_url)
if (resource->fragment != NULL) RETVAL_STRING(resource->fragment);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key);
+ php_error_docref(NULL, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key);
RETVAL_FALSE;
}
goto done;
@@ -534,7 +534,7 @@ PHP_FUNCTION(urlencode)
zend_string *in_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -554,7 +554,7 @@ PHP_FUNCTION(urldecode)
zend_string *in_str, *out_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -641,7 +641,7 @@ PHP_FUNCTION(rawurlencode)
zend_string *in_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -661,7 +661,7 @@ PHP_FUNCTION(rawurldecode)
zend_string *in_str, *out_str;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &in_str) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
return;
}
#else
@@ -717,10 +717,10 @@ PHP_FUNCTION(get_headers)
HashTable *hashT;
zend_long format = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &url, &url_len, &format) == FAILURE) {
return;
}
- context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc(TSRMLS_C));
+ context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc());
if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) {
RETURN_FALSE;
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 6b406e673f..292d0a9315 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -218,7 +218,7 @@ done:
#undef YYLIMIT
#undef YYMARKER
-static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC)
+static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type)
{
char f = 0;
@@ -343,10 +343,10 @@ static inline void handle_arg(STD_PARA)
static inline void handle_val(STD_PARA, char quotes, char type)
{
smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2);
- tag_arg(ctx, quotes, type TSRMLS_CC);
+ tag_arg(ctx, quotes, type);
}
-static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC)
+static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
char *xp;
@@ -918,7 +918,7 @@ stop:
ctx->buf.s->len = rest;
}
-char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC)
+char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen)
{
char *result;
smart_str surl = {0};
@@ -944,14 +944,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}
-static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
+static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush)
{
url_adapt_state_ex_t *ctx;
char *retval;
ctx = &BG(url_adapt_state_ex);
- xx_mainloop(ctx, src, srclen TSRMLS_CC);
+ xx_mainloop(ctx, src, srclen);
if (!ctx->result.s) {
smart_str_appendl(&ctx->result, "", 0);
@@ -971,7 +971,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_
return retval;
}
-static int php_url_scanner_ex_activate(TSRMLS_D)
+static int php_url_scanner_ex_activate(void)
{
url_adapt_state_ex_t *ctx;
@@ -982,7 +982,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D)
return SUCCESS;
}
-static int php_url_scanner_ex_deactivate(TSRMLS_D)
+static int php_url_scanner_ex_deactivate(void)
{
url_adapt_state_ex_t *ctx;
@@ -996,12 +996,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)
{
size_t len;
if (BG(url_adapt_state_ex).url_app.s->len != 0) {
- *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC);
+ *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0));
if (sizeof(uint) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
@@ -1026,14 +1026,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char
}
}
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode)
{
smart_str val = {0};
zend_string *encoded;
if (!BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_activate(TSRMLS_C);
- php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_url_scanner_ex_activate();
+ php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
BG(url_adapt_state_ex).active = 1;
}
@@ -1067,7 +1067,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz
return SUCCESS;
}
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D)
+PHPAPI int php_url_scanner_reset_vars(void)
{
if (BG(url_adapt_state_ex).form_app.s) {
BG(url_adapt_state_ex).form_app.s->len = 0;
@@ -1106,7 +1106,7 @@ PHP_RINIT_FUNCTION(url_scanner)
PHP_RSHUTDOWN_FUNCTION(url_scanner)
{
if (BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_deactivate(TSRMLS_C);
+ php_url_scanner_ex_deactivate();
BG(url_adapt_state_ex).active = 0;
}
diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h
index 2a9b6921bf..ff0e644d01 100644
--- a/ext/standard/url_scanner_ex.h
+++ b/ext/standard/url_scanner_ex.h
@@ -27,9 +27,9 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner_ex);
PHP_RINIT_FUNCTION(url_scanner_ex);
PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
-PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC);
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC);
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D);
+PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen);
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode);
+PHPAPI int php_url_scanner_reset_vars(void);
#include "zend_smart_str_public.h"
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index fed628f089..97611954f2 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -154,7 +154,7 @@ done:
#undef YYLIMIT
#undef YYMARKER
-static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC)
+static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type)
{
char f = 0;
@@ -279,10 +279,10 @@ static inline void handle_arg(STD_PARA)
static inline void handle_val(STD_PARA, char quotes, char type)
{
smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2);
- tag_arg(ctx, quotes, type TSRMLS_CC);
+ tag_arg(ctx, quotes, type);
}
-static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC)
+static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen)
{
char *end, *q;
char *xp;
@@ -370,7 +370,7 @@ stop:
ctx->buf.s->len = rest;
}
-char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC)
+char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen)
{
char *result;
smart_str surl = {0};
@@ -396,14 +396,14 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha
}
-static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC)
+static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush)
{
url_adapt_state_ex_t *ctx;
char *retval;
ctx = &BG(url_adapt_state_ex);
- xx_mainloop(ctx, src, srclen TSRMLS_CC);
+ xx_mainloop(ctx, src, srclen);
if (!ctx->result.s) {
smart_str_appendl(&ctx->result, "", 0);
@@ -423,7 +423,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_
return retval;
}
-static int php_url_scanner_ex_activate(TSRMLS_D)
+static int php_url_scanner_ex_activate(void)
{
url_adapt_state_ex_t *ctx;
@@ -434,7 +434,7 @@ static int php_url_scanner_ex_activate(TSRMLS_D)
return SUCCESS;
}
-static int php_url_scanner_ex_deactivate(TSRMLS_D)
+static int php_url_scanner_ex_deactivate(void)
{
url_adapt_state_ex_t *ctx;
@@ -448,12 +448,12 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode)
{
size_t len;
if (BG(url_adapt_state_ex).url_app.s->len != 0) {
- *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0) TSRMLS_CC);
+ *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0));
if (sizeof(uint) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
@@ -478,14 +478,14 @@ static void php_url_scanner_output_handler(char *output, size_t output_len, char
}
}
-PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode)
{
smart_str val = {0};
zend_string *encoded;
if (!BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_activate(TSRMLS_C);
- php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_url_scanner_ex_activate();
+ php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS);
BG(url_adapt_state_ex).active = 1;
}
@@ -519,7 +519,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz
return SUCCESS;
}
-PHPAPI int php_url_scanner_reset_vars(TSRMLS_D)
+PHPAPI int php_url_scanner_reset_vars(void)
{
if (BG(url_adapt_state_ex).form_app.s) {
BG(url_adapt_state_ex).form_app.s->len = 0;
@@ -558,7 +558,7 @@ PHP_RINIT_FUNCTION(url_scanner)
PHP_RSHUTDOWN_FUNCTION(url_scanner)
{
if (BG(url_adapt_state_ex).active) {
- php_url_scanner_ex_deactivate(TSRMLS_C);
+ php_url_scanner_ex_deactivate();
BG(url_adapt_state_ex).active = 0;
}
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index f310e64ae9..9f748623c4 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -43,7 +43,7 @@ static int le_bucket;
#define GET_FILTER_FROM_OBJ() { \
zval **tmp; \
if (FAILURE == zend_hash_index_find(Z_OBJPROP_P(this_ptr), 0, (void**)&tmp)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "filter property vanished"); \
+ php_error_docref(NULL, E_WARNING, "filter property vanished"); \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(filter, php_stream_filter*, tmp, -1, "filter", le_userfilters); \
@@ -80,7 +80,7 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
{
php_stream_bucket *bucket = (php_stream_bucket *)res->ptr;
if (bucket) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
bucket = NULL;
}
}
@@ -90,11 +90,11 @@ PHP_MINIT_FUNCTION(user_filters)
zend_class_entry *php_user_filter;
/* init the filter class ancestor */
INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs);
- if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) {
+ if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry)) == NULL) {
return FAILURE;
}
- zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
- zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC);
+ zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC);
/* init the filter resource; it has no dtor, as streams will always clean it up
* at the correct time */
@@ -135,7 +135,7 @@ PHP_RSHUTDOWN_FUNCTION(user_filters)
return SUCCESS;
}
-static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void userfilter_dtor(php_stream_filter *thisfilter)
{
zval *obj = &thisfilter->abstract;
zval func_name;
@@ -153,7 +153,7 @@ static void userfilter_dtor(php_stream_filter *thisfilter TSRMLS_DC)
&func_name,
&retval,
0, NULL,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&func_name);
@@ -215,7 +215,7 @@ php_stream_filter_status_t userfilter_filter(
&func_name,
&retval,
4, args,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
zval_ptr_dtor(&func_name);
@@ -223,7 +223,7 @@ php_stream_filter_status_t userfilter_filter(
convert_to_long(&retval);
ret = (int)Z_LVAL(retval);
} else if (call_result == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function");
+ php_error_docref(NULL, E_WARNING, "failed to call filter function");
}
if (bytes_consumed) {
@@ -233,18 +233,18 @@ php_stream_filter_status_t userfilter_filter(
if (buckets_in->head) {
php_stream_bucket *bucket = buckets_in->head;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unprocessed filter buckets remaining on input brigade");
+ php_error_docref(NULL, E_WARNING, "Unprocessed filter buckets remaining on input brigade");
while ((bucket = buckets_in->head)) {
/* Remove unconsumed buckets from the brigade */
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
}
}
if (ret != PSFS_PASS_ON) {
php_stream_bucket *bucket = buckets_out->head;
while (bucket != NULL) {
- php_stream_bucket_unlink(bucket TSRMLS_CC);
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
+ php_stream_bucket_delref(bucket);
bucket = buckets_out->head;
}
}
@@ -253,7 +253,7 @@ php_stream_filter_status_t userfilter_filter(
* keeping a reference to the stream resource here would prevent it
* from being destroyed properly */
ZVAL_STRINGL(&zpropname, "stream", sizeof("stream")-1);
- Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL TSRMLS_CC);
+ Z_OBJ_HANDLER_P(obj, unset_property)(obj, &zpropname, NULL);
zval_ptr_dtor(&zpropname);
zval_ptr_dtor(&args[3]);
@@ -271,7 +271,7 @@ static php_stream_filter_ops userfilter_ops = {
};
static php_stream_filter *user_filter_factory_create(const char *filtername,
- zval *filterparams, int persistent TSRMLS_DC)
+ zval *filterparams, int persistent)
{
struct php_user_filter_data *fdat = NULL;
php_stream_filter *filter;
@@ -282,7 +282,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* some sanity checks */
if (persistent) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"cannot use a user-space filter with a persistent stream");
return NULL;
}
@@ -317,7 +317,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
efree(wildcard);
}
if (fdat == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Err, filter \"%s\" is not in the user-filter map, but somehow the user-filter-factory was invoked for it!?", filtername);
return NULL;
}
@@ -325,8 +325,8 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* bind the classname to the actual class */
if (fdat->ce == NULL) {
- if (NULL == (fdat->ce = zend_lookup_class(fdat->classname TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ if (NULL == (fdat->ce = zend_lookup_class(fdat->classname))) {
+ php_error_docref(NULL, E_WARNING,
"user-filter \"%s\" requires class \"%s\", but that class is not defined",
filtername, fdat->classname->val);
return NULL;
@@ -359,7 +359,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
&func_name,
&retval,
0, NULL,
- 0, NULL TSRMLS_CC);
+ 0, NULL);
if (Z_TYPE(retval) != IS_UNDEF) {
if (Z_TYPE(retval) == IS_FALSE) {
@@ -368,7 +368,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
/* Kill the filter (safely) */
ZVAL_UNDEF(&filter->abstract);
- php_stream_filter_free(filter TSRMLS_CC);
+ php_stream_filter_free(filter);
/* Kill the object */
zval_ptr_dtor(&obj);
@@ -409,7 +409,7 @@ PHP_FUNCTION(stream_bucket_make_writeable)
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zbrigade) == FAILURE) {
RETURN_FALSE;
}
@@ -417,7 +417,7 @@ PHP_FUNCTION(stream_bucket_make_writeable)
ZVAL_NULL(return_value);
- if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) {
+ if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head))) {
ZEND_REGISTER_RESOURCE(&zbucket, bucket, le_bucket);
object_init(return_value);
add_property_zval(return_value, "bucket", &zbucket);
@@ -437,12 +437,12 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zo", &zbrigade, &zobject) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zo", &zbrigade, &zobject) == FAILURE) {
RETURN_FALSE;
}
if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has no bucket property");
+ php_error_docref(NULL, E_WARNING, "Object has no bucket property");
RETURN_FALSE;
}
@@ -451,7 +451,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
if (NULL != (pzdata = zend_hash_str_find(Z_OBJPROP_P(zobject), "data", sizeof("data")-1)) && Z_TYPE_P(pzdata) == IS_STRING) {
if (!bucket->own_buf) {
- bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(bucket);
}
if ((int)bucket->buflen != Z_STRLEN_P(pzdata)) {
bucket->buf = perealloc(bucket->buf, Z_STRLEN_P(pzdata), bucket->is_persistent);
@@ -461,9 +461,9 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
}
if (append) {
- php_stream_bucket_append(brigade, bucket TSRMLS_CC);
+ php_stream_bucket_append(brigade, bucket);
} else {
- php_stream_bucket_prepend(brigade, bucket TSRMLS_CC);
+ php_stream_bucket_prepend(brigade, bucket);
}
/* This is a hack necessary to accommodate situations where bucket is appended to the stream
* multiple times. See bug35916.phpt for reference.
@@ -501,7 +501,7 @@ PHP_FUNCTION(stream_bucket_new)
size_t buffer_len;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
RETURN_FALSE;
}
@@ -513,7 +513,7 @@ PHP_FUNCTION(stream_bucket_new)
memcpy(pbuffer, buffer, buffer_len);
- bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream) TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream));
if (bucket == NULL) {
RETURN_FALSE;
@@ -562,19 +562,19 @@ PHP_FUNCTION(stream_filter_register)
zend_string *filtername, *classname;
struct php_user_filter_data *fdat;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &filtername, &classname) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &filtername, &classname) == FAILURE) {
RETURN_FALSE;
}
RETVAL_FALSE;
if (!filtername->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Filter name cannot be empty");
return;
}
if (!classname->len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Class name cannot be empty");
return;
}
@@ -587,7 +587,7 @@ PHP_FUNCTION(stream_filter_register)
fdat->classname = zend_string_copy(classname);
if (zend_hash_add_ptr(BG(user_filter_map), filtername, fdat) != NULL &&
- php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory TSRMLS_CC) == SUCCESS) {
+ php_stream_filter_register_factory_volatile(filtername->val, &user_filter_factory) == SUCCESS) {
RETVAL_TRUE;
} else {
zend_string_release(classname);
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index ea171a658a..0a25b770f6 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -202,7 +202,7 @@ PHP_FUNCTION(convert_uuencode)
{
zend_string *src;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) {
RETURN_FALSE;
}
@@ -217,12 +217,12 @@ PHP_FUNCTION(convert_uudecode)
zend_string *src;
zend_string *dest;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &src) == FAILURE || src->len < 1) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &src) == FAILURE || src->len < 1) {
RETURN_FALSE;
}
if ((dest = php_uudecode(src->val, src->len)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The given parameter is not a valid uuencoded string");
+ php_error_docref(NULL, E_WARNING, "The given parameter is not a valid uuencoded string");
RETURN_FALSE;
}
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 24bdd385a5..94b43ca399 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -54,7 +54,7 @@ static uint zend_obj_num_elements(HashTable *ht)
return num;
}
-static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
@@ -63,11 +63,11 @@ static void php_array_element_dump(zval *zv, zend_ulong index, zend_string *key,
PHPWRITE(key->val, key->len);
php_printf("\"]=>\n");
}
- php_var_dump(zv, level + 2 TSRMLS_CC);
+ php_var_dump(zv, level + 2);
}
/* }}} */
-static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
const char *prop_name, *class_name;
@@ -90,11 +90,11 @@ static void php_object_property_dump(zval *zv, zend_ulong index, zend_string *ke
}
ZEND_PUTS("]=>\n");
}
- php_var_dump(zv, level + 2 TSRMLS_CC);
+ php_var_dump(zv, level + 2);
}
/* }}} */
-PHPAPI void php_var_dump(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_dump(zval *struc, int level) /* {{{ */
{
HashTable *myht;
zend_string *class_name;
@@ -141,7 +141,7 @@ again:
is_temp = 0;
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
- php_array_element_dump(val, num, key, level TSRMLS_CC);
+ php_array_element_dump(val, num, key, level);
} ZEND_HASH_FOREACH_END();
if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
--myht->u.v.nApplyCount;
@@ -163,7 +163,7 @@ again:
return;
}
- class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC);
+ class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0);
zend_string_release(class_name);
@@ -173,7 +173,7 @@ again:
zval *val;
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
- php_object_property_dump(val, num, key, level TSRMLS_CC);
+ php_object_property_dump(val, num, key, level);
} ZEND_HASH_FOREACH_END();
--myht->u.v.nApplyCount;
if (is_temp) {
@@ -187,7 +187,7 @@ again:
PUTS("}\n");
break;
case IS_RESOURCE: {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
php_printf("%sresource(%pd) of type (%s)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown");
break;
}
@@ -214,17 +214,17 @@ PHP_FUNCTION(var_dump)
int argc;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
- php_var_dump(&args[i], 1 TSRMLS_CC);
+ php_var_dump(&args[i], 1);
}
}
/* }}} */
-static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
if (key == NULL) { /* numeric key */
php_printf("%*c[" ZEND_LONG_FMT "]=>\n", level + 1, ' ', index);
@@ -233,11 +233,11 @@ static void zval_array_element_dump(zval *zv, zend_ulong index, zend_string *key
PHPWRITE(key->val, key->len);
php_printf("\"]=>\n");
}
- php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
+ php_debug_zval_dump(zv, level + 2);
}
/* }}} */
-static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level TSRMLS_DC) /* {{{ */
+static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *key, int level) /* {{{ */
{
const char *prop_name, *class_name;
@@ -258,11 +258,11 @@ static void zval_object_property_dump(zval *zv, zend_ulong index, zend_string *k
}
ZEND_PUTS("]=>\n");
}
- php_debug_zval_dump(zv, level + 2 TSRMLS_CC);
+ php_debug_zval_dump(zv, level + 2);
}
/* }}} */
-PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_debug_zval_dump(zval *struc, int level) /* {{{ */
{
HashTable *myht = NULL;
zend_string *class_name;
@@ -307,7 +307,7 @@ again:
}
php_printf("%sarray(%d) refcount(%u){\n", COMMON, zend_hash_num_elements(myht), Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- zval_array_element_dump(val, index, key, level TSRMLS_CC);
+ zval_array_element_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
myht->u.v.nApplyCount--;
@@ -331,12 +331,12 @@ again:
myht->u.v.nApplyCount++;
}
}
- class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC);
+ class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name->val, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
zend_string_release(class_name);
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- zval_object_property_dump(val, index, key, level TSRMLS_CC);
+ zval_object_property_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
myht->u.v.nApplyCount--;
if (is_temp) {
@@ -350,7 +350,7 @@ again:
PUTS("}\n");
break;
case IS_RESOURCE: {
- const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc) TSRMLS_CC);
+ const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
php_printf("%sresource(" ZEND_LONG_FMT ") of type (%s) refcount(%u)\n", COMMON, Z_RES_P(struc)->handle, type_name ? type_name : "Unknown", Z_REFCOUNT_P(struc));
break;
}
@@ -376,12 +376,12 @@ PHP_FUNCTION(debug_zval_dump)
int argc;
int i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
return;
}
for (i = 0; i < argc; i++) {
- php_debug_zval_dump(&args[i], 1 TSRMLS_CC);
+ php_debug_zval_dump(&args[i], 1);
}
}
/* }}} */
@@ -395,7 +395,7 @@ PHP_FUNCTION(debug_zval_dump)
efree(tmp_spaces); \
} while(0);
-static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+static void php_array_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */
{
if (key == NULL) { /* numeric key */
buffer_append_spaces(buf, level+1);
@@ -404,7 +404,7 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke
} else { /* string key */
zend_string *tmp_str;
- zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2 TSRMLS_CC);
+ zend_string *ckey = php_addcslashes(key->val, key->len, 0, "'\\", 2);
tmp_str = php_str_to_str_ex(ckey->val, ckey->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL);
buffer_append_spaces(buf, level + 1);
@@ -416,14 +416,14 @@ static void php_array_element_export(zval *zv, zend_ulong index, zend_string *ke
zend_string_free(ckey);
zend_string_free(tmp_str);
}
- php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
+ php_var_export_ex(zv, level + 2, buf);
smart_str_appendc(buf, ',');
smart_str_appendc(buf, '\n');
}
/* }}} */
-static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+static void php_object_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */
{
buffer_append_spaces(buf, level + 2);
if (key != NULL) {
@@ -432,7 +432,7 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k
zend_string *pname_esc;
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
- pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2 TSRMLS_CC);
+ pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2);
smart_str_appendc(buf, '\'');
smart_str_append(buf, pname_esc);
@@ -442,13 +442,13 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k
smart_str_append_long(buf, (zend_long) index);
}
smart_str_appendl(buf, " => ", 4);
- php_var_export_ex(zv, level + 2, buf TSRMLS_CC);
+ php_var_export_ex(zv, level + 2, buf);
smart_str_appendc(buf, ',');
smart_str_appendc(buf, '\n');
}
/* }}} */
-PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */
{
HashTable *myht;
char *tmp_str;
@@ -478,7 +478,7 @@ again:
efree(tmp_str);
break;
case IS_STRING:
- ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2 TSRMLS_CC);
+ ztmp = php_addcslashes(Z_STRVAL_P(struc), Z_STRLEN_P(struc), 0, "'\\", 2);
ztmp2 = php_str_to_str_ex(ztmp->val, ztmp->len, "\0", 1, "' . \"\\0\" . '", 12, 0, NULL);
smart_str_appendc(buf, '\'');
@@ -502,7 +502,7 @@ again:
}
smart_str_appendl(buf, "array (\n", 8);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- php_array_element_export(val, index, key, level, buf TSRMLS_CC);
+ php_array_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
if (ZEND_HASH_APPLY_PROTECTION(myht)) {
myht->u.v.nApplyCount--;
@@ -535,7 +535,7 @@ again:
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
- php_object_element_export(val, index, key, level, buf TSRMLS_CC);
+ php_object_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
myht->u.v.nApplyCount--;
}
@@ -557,10 +557,10 @@ again:
/* }}} */
/* FOR BC reasons, this will always perform and then print */
-PHPAPI void php_var_export(zval *struc, int level TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_export(zval *struc, int level) /* {{{ */
{
smart_str buf = {0};
- php_var_export_ex(struc, level, &buf TSRMLS_CC);
+ php_var_export_ex(struc, level, &buf);
smart_str_0(&buf);
PHPWRITE(buf.s->val, buf.s->len);
smart_str_free(&buf);
@@ -576,11 +576,11 @@ PHP_FUNCTION(var_export)
zend_bool return_output = 0;
smart_str buf = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &return_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &return_output) == FAILURE) {
return;
}
- php_var_export_ex(var, 1, &buf TSRMLS_CC);
+ php_var_export_ex(var, 1, &buf);
smart_str_0 (&buf);
if (return_output) {
@@ -592,9 +592,9 @@ PHP_FUNCTION(var_export)
}
/* }}} */
-static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC);
+static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash);
-static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var TSRMLS_DC) /* {{{ */
+static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var) /* {{{ */
{
zval *zv;
zend_ulong key;
@@ -658,7 +658,7 @@ static inline void php_var_serialize_string(smart_str *buf, char *str, size_t le
}
/* }}} */
-static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc TSRMLS_DC) /* {{{ */
+static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */
{
PHP_CLASS_ATTRIBUTES;
@@ -673,12 +673,12 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc
}
/* }}} */
-static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */
+static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash) /* {{{ */
{
uint32_t count;
zend_bool incomplete_class;
- incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
+ incomplete_class = php_var_serialize_class_name(buf, struc);
/* count after serializing name, since php_var_serialize_class_name
* changes the count if the variable is incomplete class */
count = zend_hash_num_elements(HASH_OF(retval_ptr));
@@ -704,7 +704,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
if (Z_TYPE_P(name) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
smart_str_appendl(buf,"N;", 2);
@@ -719,7 +719,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
}
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
} else {
zend_class_entry *ce = Z_OBJ_P(struc)->ce;
if (ce) {
@@ -736,7 +736,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
php_var_serialize_string(buf, priv_name->val, priv_name->len);
zend_string_free(priv_name);
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(priv_name);
@@ -751,17 +751,17 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
php_var_serialize_string(buf, prot_name->val, prot_name->len);
zend_string_free(prot_name);
- php_var_serialize_intern(buf, d, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, d, var_hash);
break;
}
zend_string_free(prot_name);
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name));
+ php_var_serialize_intern(buf, nvalp, var_hash);
+ php_error_docref(NULL, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_P(name));
} while (0);
} else {
php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name));
- php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, nvalp, var_hash);
}
}
} ZEND_HASH_FOREACH_END();
@@ -770,7 +770,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
/* }}} */
-static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */
+static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash) /* {{{ */
{
zend_long var_already;
HashTable *myht;
@@ -779,7 +779,7 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_
return;
}
- if (var_hash && (var_already = php_add_var_hash(var_hash, struc TSRMLS_CC))) {
+ if (var_hash && (var_already = php_add_var_hash(var_hash, struc))) {
if (Z_ISREF_P(struc)) {
smart_str_appendl(buf, "R:", 2);
smart_str_append_long(buf, var_already);
@@ -838,7 +838,7 @@ again:
unsigned char *serialized_data = NULL;
size_t serialized_length;
- if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) {
+ if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash) == SUCCESS) {
smart_str_appendl(buf, "C:", 2);
smart_str_append_unsigned(buf, Z_OBJCE_P(struc)->name->len);
smart_str_appendl(buf, ":\"", 2);
@@ -861,7 +861,7 @@ again:
if (ce && ce != PHP_IC_ENTRY && zend_hash_str_exists(&ce->function_table, "__sleep", sizeof("__sleep")-1)) {
ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1);
BG(serialize_lock)++;
- res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
@@ -873,9 +873,9 @@ again:
if (res == SUCCESS) {
if (Z_TYPE(retval) != IS_UNDEF) {
if (HASH_OF(&retval)) {
- php_var_serialize_class(buf, struc, &retval, var_hash TSRMLS_CC);
+ php_var_serialize_class(buf, struc, &retval, var_hash);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize");
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
smart_str_appendl(buf,"N;", 2);
@@ -896,7 +896,7 @@ again:
smart_str_appendl(buf, "a:", 2);
myht = HASH_OF(struc);
} else {
- incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
+ incomplete_class = php_var_serialize_class_name(buf, struc);
myht = Z_OBJPROP_P(struc);
}
/* count after serializing name, since php_var_serialize_class_name
@@ -934,7 +934,7 @@ again:
if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
Z_ARRVAL_P(data)->u.v.nApplyCount++;
}
- php_var_serialize_intern(buf, data, var_hash TSRMLS_CC);
+ php_var_serialize_intern(buf, data, var_hash);
if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
Z_ARRVAL_P(data)->u.v.nApplyCount--;
}
@@ -954,9 +954,9 @@ again:
}
/* }}} */
-PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC) /* {{{ */
+PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data) /* {{{ */
{
- php_var_serialize_intern(buf, struc, *data TSRMLS_CC);
+ php_var_serialize_intern(buf, struc, *data);
smart_str_0(buf);
}
/* }}} */
@@ -969,12 +969,12 @@ PHP_FUNCTION(serialize)
php_serialize_data_t var_hash;
smart_str buf = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &struc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &struc) == FAILURE) {
return;
}
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&buf, struc, &var_hash TSRMLS_CC);
+ php_var_serialize(&buf, struc, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
if (EG(exception)) {
@@ -1001,7 +1001,7 @@ PHP_FUNCTION(unserialize)
zval *options = NULL, *classes = NULL;
HashTable *class_hash = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &buf, &buf_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|a", &buf, &buf_len, &options) == FAILURE) {
RETURN_FALSE;
}
@@ -1013,7 +1013,7 @@ PHP_FUNCTION(unserialize)
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if(options != NULL) {
classes = zend_hash_str_find(Z_ARRVAL_P(options), "allowed_classes", sizeof("allowed_classes")-1);
- if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes TSRMLS_CC))) {
+ if(classes && (Z_TYPE_P(classes) == IS_ARRAY || !zend_is_true(classes))) {
ALLOC_HASHTABLE(class_hash);
zend_hash_init(class_hash, (Z_TYPE_P(classes) == IS_ARRAY)?zend_hash_num_elements(Z_ARRVAL_P(classes)):0, NULL, NULL, 0);
}
@@ -1031,7 +1031,7 @@ PHP_FUNCTION(unserialize)
}
}
- if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(return_value, &p, p + buf_len, &var_hash, class_hash)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
if(class_hash) {
zend_hash_destroy(class_hash);
@@ -1039,7 +1039,7 @@ PHP_FUNCTION(unserialize)
}
zval_dtor(return_value);
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
+ php_error_docref(NULL, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %d bytes", (zend_long)((char*)p - buf), buf_len);
}
RETURN_FALSE;
}
@@ -1056,11 +1056,11 @@ PHP_FUNCTION(unserialize)
PHP_FUNCTION(memory_get_usage) {
zend_bool real_usage = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) {
RETURN_FALSE;
}
- RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
+ RETURN_LONG(zend_memory_usage(real_usage));
}
/* }}} */
@@ -1069,11 +1069,11 @@ PHP_FUNCTION(memory_get_usage) {
PHP_FUNCTION(memory_get_peak_usage) {
zend_bool real_usage = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &real_usage) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &real_usage) == FAILURE) {
RETURN_FALSE;
}
- RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
+ RETURN_LONG(zend_memory_peak_usage(real_usage));
}
/* }}} */
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 0217bba5fa..f51a42095e 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -329,7 +329,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
ZVAL_UNDEF(&key);
- if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
@@ -381,7 +381,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) {
return 0;
}
@@ -421,7 +421,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
if (ce->unserialize == NULL) {
zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val);
object_init_ex(rval, ce);
- } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) {
return 0;
}
@@ -472,7 +472,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) {
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1);
BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
zval_dtor(&retval);
@@ -489,7 +489,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash)
{
HashTable *classes = NULL;
return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
@@ -623,7 +623,7 @@ yy14:
#line 860 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
+ php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
#line 630 "ext/standard/var_unserializer.c"
@@ -714,7 +714,7 @@ yy20:
/* Try to find class directly */
BG(serialize_lock)++;
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (ce) {
BG(serialize_lock)--;
if (EG(exception)) {
@@ -742,7 +742,7 @@ yy20:
ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
- if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) {
BG(serialize_lock)--;
if (EG(exception)) {
zend_string_release(class_name);
@@ -750,7 +750,7 @@ yy20:
zval_ptr_dtor(&args[0]);
return 0;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
+ php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
zval_ptr_dtor(&user_func);
@@ -767,8 +767,8 @@ yy20:
}
/* The callback function may have defined the class */
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index c7871671b6..99600995a5 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -333,7 +333,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
ZVAL_UNDEF(&key);
- if (!php_var_unserialize_ex(&key, p, max, NULL, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(&key, p, max, NULL, classes)) {
zval_dtor(&key);
return 0;
}
@@ -385,7 +385,7 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, zend
zval_dtor(&key);
- if (!php_var_unserialize_ex(data, p, max, var_hash, classes TSRMLS_CC)) {
+ if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) {
return 0;
}
@@ -425,7 +425,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
if (ce->unserialize == NULL) {
zend_error(E_WARNING, "Class %s has no unserializer", ce->name->val);
object_init_ex(rval, ce);
- } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) {
+ } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash) != SUCCESS) {
return 0;
}
@@ -476,7 +476,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1)) {
ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1);
BG(serialize_lock)++;
- call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC);
+ call_user_function_ex(CG(function_table), rval, &fname, &retval, 0, 0, 1, NULL);
BG(serialize_lock)--;
zval_dtor(&fname);
zval_dtor(&retval);
@@ -493,7 +493,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
# pragma optimize("", on)
#endif
-PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC)
+PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash)
{
HashTable *classes = NULL;
return php_var_unserialize_ex(UNSERIALIZE_PASSTHRU);
@@ -769,7 +769,7 @@ object ":" uiv ":" ["] {
/* Try to find class directly */
BG(serialize_lock)++;
- ce = zend_lookup_class(class_name TSRMLS_CC);
+ ce = zend_lookup_class(class_name);
if (ce) {
BG(serialize_lock)--;
if (EG(exception)) {
@@ -797,7 +797,7 @@ object ":" uiv ":" ["] {
ZVAL_STR_COPY(&args[0], class_name);
BG(serialize_lock)++;
- if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+ if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) {
BG(serialize_lock)--;
if (EG(exception)) {
zend_string_release(class_name);
@@ -805,7 +805,7 @@ object ":" uiv ":" ["] {
zval_ptr_dtor(&args[0]);
return 0;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
+ php_error_docref(NULL, E_WARNING, "defined (%s) but not found", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
zval_ptr_dtor(&user_func);
@@ -822,8 +822,8 @@ object ":" uiv ":" ["] {
}
/* The callback function may have defined the class */
- if ((ce = zend_lookup_class(class_name TSRMLS_CC)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
+ if ((ce = zend_lookup_class(class_name)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func));
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
@@ -859,7 +859,7 @@ object ":" uiv ":" ["] {
"}" {
/* this is the case where we have less data than planned */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
+ php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c
index ffdd5abf0d..1823e1646e 100644
--- a/ext/standard/versioning.c
+++ b/ext/standard/versioning.c
@@ -215,7 +215,7 @@ PHP_FUNCTION(version_compare)
int compare, argc;
argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|s", &v1, &v1_len, &v2,
+ if (zend_parse_parameters(argc, "ss|s", &v1, &v1_len, &v2,
&v2_len, &op, &op_len) == FAILURE) {
return;
}
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index c079ff383d..16b6db01ca 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -232,10 +232,10 @@ ZEND_GET_MODULE(sybase)
ZEND_DECLARE_MODULE_GLOBALS(sybase)
-#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } }
+#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } }
-static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC)
+static int _clean_invalid_results(zend_rsrc_list_entry *le)
{
if (Z_TYPE_P(le) == le_result) {
sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr;
@@ -304,9 +304,9 @@ static void _free_sybase_result(sybase_result *result)
}
/* Forward declaration */
-static int php_sybase_finish_results (sybase_result *result TSRMLS_DC);
+static int php_sybase_finish_results (sybase_result *result);
-static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_free_sybase_result(zend_rsrc_list_entry *rsrc)
{
sybase_result *result = (sybase_result *)rsrc->ptr;
@@ -315,13 +315,13 @@ static void php_free_sybase_result(zend_rsrc_list_entry *rsrc TSRMLS_DC)
if (result->sybase_ptr->cmd) {
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
}
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
FREE_SYBASE_RESULT(result);
}
-static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_sybase_link(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
CS_INT con_status;
@@ -331,7 +331,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
zval_ptr_dtor(&sybase_ptr->callback_name);
sybase_ptr->callback_name= NULL;
}
- zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results TSRMLS_CC);
+ zend_hash_apply(&EG(regular_list), (apply_func_t) _clean_invalid_results);
/* Non-persistent connections will always be connected or we wouldn't
* get here, but since we want to check the death status anyway
@@ -339,7 +339,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status on close");
/* Assume the worst. */
con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;
}
@@ -356,7 +356,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
-static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void _close_sybase_plink(zend_rsrc_list_entry *rsrc)
{
sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr;
CS_INT con_status;
@@ -366,7 +366,7 @@ static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status on close");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status on close");
/* Assume the worst. */
con_status = CS_CONSTAT_CONNECTED | CS_CONSTAT_DEAD;
}
@@ -385,10 +385,9 @@ static void _close_sybase_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONNECTION *connection, CS_CLIENTMSG *errmsg)
{
- TSRMLS_FETCH();
if (CS_SEVERITY(errmsg->msgnumber) >= SybCtG(min_client_severity)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Client message: %s (severity %ld)", errmsg->msgstring, (long)CS_SEVERITY(errmsg->msgnumber));
+ php_error_docref(NULL, E_WARNING, "Sybase: Client message: %s (severity %ld)", errmsg->msgstring, (long)CS_SEVERITY(errmsg->msgnumber));
}
zend_string_free(SybCtG(server_message));
SybCtG(server_message) = estrdup(errmsg->msgstring);
@@ -408,7 +407,7 @@ static CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context, CS_CONN
return CS_SUCCEED;
}
-static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRMLS_DC)
+static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg)
{
int handled = 0;
zval *msgnumber, *severity, *state, *line, *text, *retval = NULL;
@@ -438,12 +437,12 @@ static int _call_message_handler(zval *callback_name, CS_SERVERMSG *srvmsg TSRML
ZVAL_STRING(text, srvmsg->text, 1);
args[4] = &text;
- if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL TSRMLS_CC) == FAILURE) {
+ if (call_user_function_ex(EG(function_table), NULL, callback_name, &retval, 5, args, 0, NULL) == FAILURE) {
zval expr_copy;
int use_copy;
- use_copy = zend_make_printable_zval(callback_name, &expr_copy TSRMLS_CC);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL(expr_copy));
+ use_copy = zend_make_printable_zval(callback_name, &expr_copy);
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot call the messagehandler %s", Z_STRVAL(expr_copy));
zval_dtor(&expr_copy);
}
@@ -467,7 +466,6 @@ static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONN
{
sybase_link *sybase;
int handled = 0;
- TSRMLS_FETCH();
/* Remember the last server message in any case */
zend_string_free(SybCtG(server_message));
@@ -492,16 +490,16 @@ static CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context, CS_CONN
}
/* Call global message handler */
- handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg TSRMLS_CC);
+ handled = handled | _call_message_handler(SybCtG(callback_name), srvmsg);
/* Call link specific message handler */
if (sybase) {
- handled = handled | _call_message_handler(sybase->callback_name, srvmsg TSRMLS_CC);
+ handled = handled | _call_message_handler(sybase->callback_name, srvmsg);
}
/* Spit out a warning if neither of them has handled this message */
if (!handled) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Server message: %s (severity %ld, procedure %s)",
+ php_error_docref(NULL, E_WARNING, "Sybase: Server message: %s (severity %ld, procedure %s)",
srvmsg->text, (long)srvmsg->severity, ((srvmsg->proclen>0) ? srvmsg->proc : "N/A"));
}
@@ -531,11 +529,11 @@ static PHP_GINIT_FUNCTION(sybase)
/* Initialize message handlers */
if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_SERVERMSG_CB, (CS_VOID *)_server_message_handler)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set server message handler");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set server message handler");
}
if (ct_callback(sybase_globals->context, NULL, CS_SET, CS_CLIENTMSG_CB, (CS_VOID *)_client_message_handler)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set client message handler");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set client message handler");
}
/* Set datetime conversion format to "Nov 3 1998 8:06PM".
@@ -547,7 +545,7 @@ static PHP_GINIT_FUNCTION(sybase)
{
CS_INT dt_convfmt = CS_DATES_SHORT;
if (cs_dt_info(sybase_globals->context, CS_SET, NULL, CS_DT_CONVFMT, CS_UNUSED, &dt_convfmt, sizeof(dt_convfmt), NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set datetime conversion format");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set datetime conversion format");
}
}
@@ -562,7 +560,7 @@ static PHP_GINIT_FUNCTION(sybase)
if (cfg_get_long("sybct.timeout", &opt)==SUCCESS) {
CS_INT cs_timeout = opt;
if (ct_config(sybase_globals->context, CS_SET, CS_TIMEOUT, &cs_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the timeout");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update the timeout");
}
}
@@ -626,20 +624,20 @@ PHP_RSHUTDOWN_FUNCTION(sybase)
}
-static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname TSRMLS_DC)
+static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char *user, char *passwd, char *charset, char *appname)
{
CS_LOCALE *tmp_locale;
long packetsize;
/* set a CS_CONNECTION record */
if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate connection record");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate connection record");
return 0;
}
/* Note - this saves a copy of sybase, not a pointer to it. */
if (ct_con_props(sybase->connection, CS_SET, CS_USERDATA, &sybase, CS_SIZEOF(sybase), NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to set userdata");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to set userdata");
ct_con_drop(sybase->connection);
return 0;
}
@@ -662,16 +660,16 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (charset) {
if (cs_loc_alloc(SybCtG(context), &tmp_locale)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate locale information");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate locale information");
} else {
if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_LC_ALL, NULL, CS_NULLTERM, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to load default locale data");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to load default locale data");
} else {
if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update character set");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update character set");
} else {
if (ct_con_props(sybase->connection, CS_SET, CS_LOC_PROP, tmp_locale, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection properties");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update connection properties");
}
}
}
@@ -680,7 +678,7 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) {
if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update connection packetsize");
}
}
@@ -699,7 +697,7 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
if (SybCtG(login_timeout) != -1) {
CS_INT cs_login_timeout = SybCtG(login_timeout);
if (ct_config(SybCtG(context), CS_SET, CS_LOGIN_TIMEOUT, &cs_login_timeout, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the login timeout");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to update the login timeout");
}
}
@@ -710,13 +708,13 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
/* create the link */
if (ct_connect(sybase->connection, host, CS_NULLTERM)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to connect");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to connect");
ct_con_drop(sybase->connection);
return 0;
}
if (ct_cmd_alloc(sybase->connection, &sybase->cmd)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to allocate command record");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to allocate command record");
ct_close(sybase->connection, CS_UNUSED);
ct_con_drop(sybase->connection);
return 0;
@@ -736,11 +734,11 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
host= user= passwd= charset= appname= NULL;
if (persistent) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!s!s!", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!s!s!", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!s!s!b", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len, &new) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!s!s!b", &host, &len, &user, &len, &passwd, &len, &charset, &len, &appname, &len, &new) == FAILURE) {
return;
}
}
@@ -766,12 +764,12 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
zend_rsrc_list_entry new_le;
if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (SybCtG(max_persistent)!=-1 && SybCtG(num_persistent)>=SybCtG(max_persistent)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open persistent links (%ld)", SybCtG(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
@@ -781,7 +779,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
efree(hashed_details);
RETURN_FALSE;
}
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
free(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -813,7 +811,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS,
&con_status, CS_UNUSED, NULL)!=CS_SUCCEED) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to get connection status");
+ php_error_docref(NULL, E_WARNING, "Sybase: Unable to get connection status");
efree(hashed_details);
RETURN_FALSE;
}
@@ -835,7 +833,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
* NULL before trying to use it elsewhere . . .)
*/
memcpy(&sybase, sybase_ptr, sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
memcpy(sybase_ptr, &sybase, sizeof(sybase_link));
efree(hashed_details);
RETURN_FALSE;
@@ -873,13 +871,13 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (SybCtG(max_links)!=-1 && SybCtG(num_links)>=SybCtG(max_links)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
+ php_error_docref(NULL, E_WARNING, "Sybase: Too many open links (%ld)", SybCtG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link));
- if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) {
+ if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname)) {
efree(sybase_ptr);
efree(hashed_details);
RETURN_FALSE;
@@ -934,7 +932,7 @@ PHP_FUNCTION(sybase_pconnect)
/* }}} */
-inline static int php_sybase_connection_id(zval *sybase_link_index, int *id TSRMLS_DC)
+inline static int php_sybase_connection_id(zval *sybase_link_index, int *id)
{
if (NULL == sybase_link_index) {
if (-1 == SybCtG(default_link)) {
@@ -955,12 +953,12 @@ PHP_FUNCTION(sybase_close)
sybase_link *sybase_ptr;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection to close");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection to close");
RETURN_FALSE;
}
@@ -1064,12 +1062,12 @@ PHP_FUNCTION(sybase_select_db)
int id, len;
sybase_link *sybase_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &len, &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &len, &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -1087,7 +1085,7 @@ PHP_FUNCTION(sybase_select_db)
/* }}} */
-static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
+static int php_sybase_finish_results(sybase_result *result)
{
int i, fail;
CS_RETCODE retcode;
@@ -1121,7 +1119,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
break;
case CS_CMD_FAIL:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Command failed, canceling rest");
+ php_error_docref(NULL, E_WARNING, "Sybase: Command failed, canceling rest");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
fail = 1;
break;
@@ -1131,7 +1129,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
/* Unexpected results, cancel them. */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling current");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Unexpected results, canceling current");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT);
break;
@@ -1141,7 +1139,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Unexpected results, canceling all");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Unexpected results, canceling all");
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
break;
}
@@ -1191,7 +1189,7 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
ZVAL_STRINGL(&result, buf, length- 1, 1); \
}
-static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS_DC)
+static int php_sybase_fetch_result_row(sybase_result *result, int numrows)
{
int i, j;
CS_INT retcode;
@@ -1270,13 +1268,13 @@ static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS
}
if (retcode==CS_ROW_FAIL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Error reading row %d", result->num_rows);
+ php_error_docref(NULL, E_WARNING, "Sybase: Error reading row %d", result->num_rows);
return retcode;
}
result->last_retcode= retcode;
switch (retcode) {
case CS_END_DATA:
- retcode = php_sybase_finish_results(result TSRMLS_CC);
+ retcode = php_sybase_finish_results(result);
break;
case CS_ROW_FAIL:
@@ -1293,7 +1291,7 @@ static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS
return retcode;
}
-static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store TSRMLS_DC)
+static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store)
{
int num_fields;
sybase_result *result;
@@ -1412,7 +1410,7 @@ static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int
if (buffered) {
retcode = CS_SUCCEED;
} else {
- if ((retcode = php_sybase_fetch_result_row(result, -1 TSRMLS_CC)) == CS_FAIL) {
+ if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) {
return NULL;
}
}
@@ -1437,17 +1435,17 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
Q_FAILURE, /* Failure, no results. */
} status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|rb", &query, &len, &sybase_link_index, &store) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|rb", &query, &len, &sybase_link_index, &store) == FAILURE) {
return;
}
if (!store && !buffered) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Cannot use non-storing mode with buffered queries");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Cannot use non-storing mode with buffered queries");
store = 1;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -1462,7 +1460,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
if (sybase_ptr->active_result_index) {
zval *tmp = NULL;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Called without first fetching all rows from a previous unbuffered query");
+ php_error_docref(NULL, E_NOTICE, "Sybase: Called without first fetching all rows from a previous unbuffered query");
if (sybase_ptr->cmd) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
}
@@ -1475,7 +1473,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
ZEND_FETCH_RESOURCE(result, sybase_result *, &tmp, -1, "Sybase result", le_result);
if (result) {
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
zval_ptr_dtor(&tmp);
@@ -1501,14 +1499,14 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
* CS_BUSY for some reason.
*/
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Connection is dead");
+ php_error_docref(NULL, E_WARNING, "Sybase: Connection is dead");
RETURN_FALSE;
}
if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot send command");
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot send command");
RETURN_FALSE;
}
@@ -1521,7 +1519,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
if (ct_results(sybase_ptr->cmd, &restype)!=CS_SUCCEED) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Cannot read results");
+ php_error_docref(NULL, E_WARNING, "Sybase: Cannot read results");
RETURN_FALSE;
}
switch ((int) restype) {
@@ -1549,7 +1547,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
case CS_STATUS_RESULT:
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
RETURN_FALSE;
@@ -1575,7 +1573,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
if (status != Q_RESULT) {
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
@@ -1630,7 +1628,7 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
/* Retry deadlocks up until deadlock_retry_count times */
if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlock_retry_count)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count));
+ php_error_docref(NULL, E_WARNING, "Sybase: Retried deadlock %d times [max: %ld], giving up", deadlock_count- 1, SybCtG(deadlock_retry_count));
FREE_SYBASE_RESULT(result);
break;
}
@@ -1689,16 +1687,16 @@ PHP_FUNCTION(sybase_free_result)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Did we fetch up until the end? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- /* php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: canceling the rest of the results"); */
+ /* php_error_docref(NULL, E_WARNING, "Sybase: canceling the rest of the results"); */
ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL);
- php_sybase_finish_results(result TSRMLS_CC);
+ php_sybase_finish_results(result);
}
zend_list_delete(Z_LVAL_P(sybase_result_index));
@@ -1722,7 +1720,7 @@ PHP_FUNCTION(sybase_num_rows)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1740,7 +1738,7 @@ PHP_FUNCTION(sybase_num_fields)
zval *sybase_result_index = NULL;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1760,14 +1758,14 @@ PHP_FUNCTION(sybase_fetch_row)
sybase_result *result;
zval *field_content;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, 1);
}
/* At the end? */
@@ -1796,14 +1794,14 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics)
zval *tmp;
char name[32];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &sybase_result_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &sybase_result_index) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? Fetch next row */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, 1);
}
/* At the end? */
@@ -1845,7 +1843,7 @@ PHP_FUNCTION(sybase_fetch_object)
sybase_result *result;
/* Was a second parameter given? */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z", &sybase_result_index, &object) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z", &sybase_result_index, &object) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1867,8 +1865,8 @@ PHP_FUNCTION(sybase_fetch_object)
zend_class_entry **pce = NULL;
convert_to_string(object);
- if (zend_lookup_class(Z_STRVAL_P(object), Z_STRLEN_P(object), &pce TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_P(object));
+ if (zend_lookup_class(Z_STRVAL_P(object), Z_STRLEN_P(object), &pce) == FAILURE) {
+ php_error_docref(NULL, E_NOTICE, "Sybase: Class %s has not been declared", Z_STRVAL_P(object));
/* Use default (ZEND_STANDARD_CLASS_DEF_PTR) */
} else {
ce = *pce;
@@ -1910,18 +1908,18 @@ PHP_FUNCTION(sybase_data_seek)
long offset;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &sybase_result_index, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &sybase_result_index, &offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && offset >= result->num_rows) {
- php_sybase_fetch_result_row(result, offset+ 1 TSRMLS_CC);
+ php_sybase_fetch_result_row(result, offset+ 1);
}
if (offset < 0 || offset >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", offset, result->num_rows - 1);
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad row offset %ld, must be betweem 0 and %d", offset, result->num_rows - 1);
RETURN_FALSE;
}
@@ -1982,7 +1980,7 @@ PHP_FUNCTION(sybase_fetch_field)
long field_offset = -1;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &sybase_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &sybase_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
@@ -1994,7 +1992,7 @@ PHP_FUNCTION(sybase_fetch_field)
if (field_offset < 0 || field_offset >= result->num_fields) {
if (ZEND_NUM_ARGS() == 2) { /* field specified explicitly */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset");
}
RETURN_FALSE;
}
@@ -2018,13 +2016,13 @@ PHP_FUNCTION(sybase_field_seek)
long field_offset;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &sybase_result_index, &field_offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &sybase_result_index, &field_offset) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
if (field_offset < 0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset");
RETURN_FALSE;
}
@@ -2044,18 +2042,18 @@ PHP_FUNCTION(sybase_result)
int field_offset = 0;
sybase_result *result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &sybase_result_index, &row, &field) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &sybase_result_index, &row, &field) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result);
/* Unbuffered ? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && row >= result->num_rows) {
- php_sybase_fetch_result_row(result, row TSRMLS_CC);
+ php_sybase_fetch_result_row(result, row);
}
if (row < 0 || row >= result->num_rows) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%ld)", row);
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad row offset (%ld)", row);
RETURN_FALSE;
}
@@ -2070,7 +2068,7 @@ PHP_FUNCTION(sybase_result)
}
}
if (i >= result->num_fields) { /* no match found */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_P(field));
+ php_error_docref(NULL, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_P(field));
RETURN_FALSE;
}
break;
@@ -2079,7 +2077,7 @@ PHP_FUNCTION(sybase_result)
convert_to_long(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= result->num_fields) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset specified");
+ php_error_docref(NULL, E_WARNING, "Sybase: Bad column offset specified");
RETURN_FALSE;
}
break;
@@ -2099,12 +2097,12 @@ PHP_FUNCTION(sybase_affected_rows)
sybase_link *sybase_ptr;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: No connection");
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
+ php_error_docref(NULL, E_WARNING, "Sybase: No connection");
RETURN_FALSE;
}
@@ -2145,7 +2143,7 @@ PHP_FUNCTION(sybase_min_client_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -2160,7 +2158,7 @@ PHP_FUNCTION(sybase_min_server_severity)
{
long severity;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) {
return;
}
@@ -2174,7 +2172,7 @@ PHP_FUNCTION(sybase_deadlock_retry_count)
{
long retry_count;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &retry_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &retry_count) == FAILURE) {
return;
}
@@ -2195,11 +2193,11 @@ PHP_FUNCTION(sybase_set_message_handler)
zval **callback;
int id;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!|r", &fci, &cache, &sybase_link_index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!|r", &fci, &cache, &sybase_link_index) == FAILURE) {
return;
}
- if (php_sybase_connection_id(sybase_link_index, &id TSRMLS_CC) == FAILURE) {
+ if (php_sybase_connection_id(sybase_link_index, &id) == FAILURE) {
/* Doesn't matter if we're not connected yet, use default */
callback= &SybCtG(callback_name);
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index d158366ea5..3727d234c1 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -119,7 +119,7 @@ zend_module_entry sysvmsg_module_entry = {
ZEND_GET_MODULE(sysvmsg)
#endif
-static void sysvmsg_release(zend_resource *rsrc TSRMLS_DC)
+static void sysvmsg_release(zend_resource *rsrc)
{
sysvmsg_queue_t *mq = (sysvmsg_queue_t *) rsrc->ptr;
efree(mq);
@@ -160,7 +160,7 @@ PHP_FUNCTION(msg_set_queue)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &queue, &data) == FAILURE) {
return;
}
@@ -203,7 +203,7 @@ PHP_FUNCTION(msg_stat_queue)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &queue) == FAILURE) {
return;
}
@@ -232,7 +232,7 @@ PHP_FUNCTION(msg_queue_exists)
{
zend_long key;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &key) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &key) == FAILURE) {
return;
}
@@ -252,7 +252,7 @@ PHP_FUNCTION(msg_get_queue)
zend_long perms = 0666;
sysvmsg_queue_t *mq;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &key, &perms) == FAILURE) {
return;
}
@@ -264,12 +264,12 @@ PHP_FUNCTION(msg_get_queue)
/* doesn't already exist; create it */
mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms);
if (mq->id < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
efree(mq);
RETURN_FALSE;
}
}
- RETVAL_ZVAL(zend_list_insert(mq, le_sysvmsg TSRMLS_CC), 0, 0);
+ RETVAL_ZVAL(zend_list_insert(mq, le_sysvmsg), 0, 0);
}
/* }}} */
@@ -280,7 +280,7 @@ PHP_FUNCTION(msg_remove_queue)
zval *queue;
sysvmsg_queue_t *mq = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &queue) == FAILURE) {
return;
}
@@ -308,21 +308,21 @@ PHP_FUNCTION(msg_receive)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz/lz/|blz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz/lz/|blz/",
&queue, &desiredmsgtype, &out_msgtype, &maxsize,
&out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) {
return;
}
if (maxsize <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "maximum size of the message has to be greater than zero");
+ php_error_docref(NULL, E_WARNING, "maximum size of the message has to be greater than zero");
return;
}
if (flags != 0) {
if (flags & PHP_MSG_EXCEPT) {
#ifndef MSG_EXCEPT
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system");
+ php_error_docref(NULL, E_WARNING, "MSG_EXCEPT is not supported on your system");
RETURN_FALSE;
#else
realflags |= MSG_EXCEPT;
@@ -364,8 +364,8 @@ PHP_FUNCTION(msg_receive)
const unsigned char *p = (const unsigned char *) messagebuffer->mtext;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted");
+ if (!php_var_unserialize(&tmp, &p, p + result, &var_hash)) {
+ php_error_docref(NULL, E_WARNING, "message corrupted");
RETVAL_FALSE;
} else {
ZVAL_COPY_VALUE(out_message, &tmp);
@@ -395,7 +395,7 @@ PHP_FUNCTION(msg_send)
RETVAL_FALSE;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz/",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz|bbz/",
&queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) {
return;
}
@@ -407,7 +407,7 @@ PHP_FUNCTION(msg_send)
php_serialize_data_t var_hash;
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&msg_var, message, &var_hash TSRMLS_CC);
+ php_var_serialize(&msg_var, message, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
/* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
@@ -437,7 +437,7 @@ PHP_FUNCTION(msg_send)
message_len = spprintf(&p, 0, "%F", Z_DVAL_P(message));
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number.");
+ php_error_docref(NULL, E_WARNING, "Message parameter must be either a string or a number.");
RETURN_FALSE;
}
@@ -457,7 +457,7 @@ PHP_FUNCTION(msg_send)
efree(messagebuffer);
if (result == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno));
+ php_error_docref(NULL, E_WARNING, "msgsnd failed: %s", strerror(errno));
if (zerror) {
ZVAL_LONG(zerror, errno);
}
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 299c725c6b..3319bdb4fb 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -133,7 +133,7 @@ THREAD_LS sysvsem_module php_sysvsem_module;
/* {{{ release_sysvsem_sem
*/
-static void release_sysvsem_sem(zend_resource *rsrc TSRMLS_DC)
+static void release_sysvsem_sem(zend_resource *rsrc)
{
sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc->ptr;
struct sembuf sop[2];
@@ -194,7 +194,7 @@ PHP_FUNCTION(sem_get)
int count;
sysvsem_sem *sem_ptr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|lll", &key, &max_acquire, &perm, &auto_release)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|lll", &key, &max_acquire, &perm, &auto_release)) {
RETURN_FALSE;
}
@@ -206,7 +206,7 @@ PHP_FUNCTION(sem_get)
semid = semget(key, 3, perm|IPC_CREAT);
if (semid == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
RETURN_FALSE;
}
@@ -238,7 +238,7 @@ PHP_FUNCTION(sem_get)
sop[2].sem_flg = SEM_UNDO;
while (semop(semid, sop, 3) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
break;
}
}
@@ -246,7 +246,7 @@ PHP_FUNCTION(sem_get)
/* Get the usage count. */
count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
if (count == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
/* If we are the only user, then take this opportunity to set the max. */
@@ -257,17 +257,17 @@ PHP_FUNCTION(sem_get)
union semun semarg;
semarg.val = max_acquire;
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#elif defined(SETVAL_WANTS_PTR)
/* This is correct for Solaris 2.6 which does not have union semun. */
if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#else
/* This works for i.e. AIX */
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
}
#endif
}
@@ -279,7 +279,7 @@ PHP_FUNCTION(sem_get)
sop[0].sem_flg = SEM_UNDO;
while (semop(semid, sop, 1) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%lx: %s", key, strerror(errno));
break;
}
}
@@ -305,11 +305,11 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
struct sembuf sop;
if (acquire) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &arg_id, &nowait) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &arg_id, &nowait) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg_id) == FAILURE) {
return;
}
}
@@ -317,7 +317,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem);
if (!acquire && sem_ptr->count == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
+ php_error_docref(NULL, E_WARNING, "SysV semaphore %ld (key 0x%x) is not currently acquired", Z_LVAL_P(arg_id), sem_ptr->key);
RETURN_FALSE;
}
@@ -328,7 +328,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
while (semop(sem_ptr->semid, &sop, 1) == -1) {
if (errno != EINTR) {
if (errno != EAGAIN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
}
RETURN_FALSE;
}
@@ -372,7 +372,7 @@ PHP_FUNCTION(sem_remove)
struct semid_ds buf;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg_id) == FAILURE) {
return;
}
@@ -384,7 +384,7 @@ PHP_FUNCTION(sem_remove)
#else
if (semctl(sem_ptr->semid, 0, IPC_STAT, NULL) < 0) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id));
+ php_error_docref(NULL, E_WARNING, "SysV semaphore %ld does not (any longer) exist", Z_LVAL_P(arg_id));
RETURN_FALSE;
}
@@ -393,7 +393,7 @@ PHP_FUNCTION(sem_remove)
#else
if (semctl(sem_ptr->semid, 0, IPC_RMID, NULL) < 0) {
#endif
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for SysV sempphore %ld: %s", Z_LVAL_P(arg_id), strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c
index c87be09e4f..a8cfb02f1d 100644
--- a/ext/sysvshm/sysvshm.c
+++ b/ext/sysvshm/sysvshm.c
@@ -122,7 +122,7 @@ static int php_remove_shm_data(sysvshm_chunk_head *ptr, zend_long shm_varpos);
/* {{{ php_release_sysvshm
*/
-static void php_release_sysvshm(zend_resource *rsrc TSRMLS_DC)
+static void php_release_sysvshm(zend_resource *rsrc)
{
sysvshm_shm *shm_ptr = (sysvshm_shm *) rsrc->ptr;
shmdt((void *) shm_ptr->ptr);
@@ -152,12 +152,12 @@ PHP_FUNCTION(shm_attach)
sysvshm_chunk_head *chunk_ptr;
zend_long shm_key, shm_id, shm_size = php_sysvshm.init_mem, shm_flag = 0666;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &shm_key, &shm_size, &shm_flag)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &shm_key, &shm_size, &shm_flag)) {
return;
}
if (shm_size < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Segment size must be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Segment size must be greater than zero");
RETURN_FALSE;
}
@@ -166,19 +166,19 @@ PHP_FUNCTION(shm_attach)
/* get the id from a specified key or create new shared memory */
if ((shm_id = shmget(shm_key, 0, 0)) < 0) {
if (shm_size < sizeof(sysvshm_chunk_head)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: memorysize too small", shm_key);
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: memorysize too small", shm_key);
efree(shm_list_ptr);
RETURN_FALSE;
}
if ((shm_id = shmget(shm_key, shm_size, shm_flag | IPC_CREAT | IPC_EXCL)) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
efree(shm_list_ptr);
RETURN_FALSE;
}
}
if ((shm_ptr = shmat(shm_id, NULL, 0)) == (void *) -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%px: %s", shm_key, strerror(errno));
efree(shm_list_ptr);
RETURN_FALSE;
}
@@ -208,7 +208,7 @@ PHP_FUNCTION(shm_detach)
zval *shm_id;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &shm_id)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &shm_id)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -223,13 +223,13 @@ PHP_FUNCTION(shm_remove)
zval *shm_id;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &shm_id)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "r", &shm_id)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
if (shmctl(shm_list_ptr->id, IPC_RMID, NULL) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
+ php_error_docref(NULL, E_WARNING, "failed for key 0x%x, id %ld: %s", shm_list_ptr->key, Z_LVAL_P(shm_id), strerror(errno));
RETURN_FALSE;
}
@@ -248,16 +248,16 @@ PHP_FUNCTION(shm_put_var)
smart_str shm_var = {0};
php_serialize_data_t var_hash;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &shm_id, &shm_key, &arg_var)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &shm_id, &shm_key, &arg_var)) {
return;
}
/* setup string-variable and serialize */
PHP_VAR_SERIALIZE_INIT(var_hash);
- php_var_serialize(&shm_var, arg_var, &var_hash TSRMLS_CC);
+ php_var_serialize(&shm_var, arg_var, &var_hash);
PHP_VAR_SERIALIZE_DESTROY(var_hash);
- shm_list_ptr = zend_fetch_resource(shm_id TSRMLS_CC, -1, PHP_SHM_RSRC_NAME, NULL, 1, php_sysvshm.le_shm);
+ shm_list_ptr = zend_fetch_resource(shm_id, -1, PHP_SHM_RSRC_NAME, NULL, 1, php_sysvshm.le_shm);
if (!shm_list_ptr) {
smart_str_free(&shm_var);
RETURN_FALSE;
@@ -270,7 +270,7 @@ PHP_FUNCTION(shm_put_var)
smart_str_free(&shm_var);
if (ret == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "not enough shared memory left");
+ php_error_docref(NULL, E_WARNING, "not enough shared memory left");
RETURN_FALSE;
}
RETURN_TRUE;
@@ -289,7 +289,7 @@ PHP_FUNCTION(shm_get_var)
sysvshm_chunk *shm_var;
php_unserialize_data_t var_hash;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -299,15 +299,15 @@ PHP_FUNCTION(shm_get_var)
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
if (shm_varpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %pd doesn't exist", shm_key);
+ php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
RETURN_FALSE;
}
shm_var = (sysvshm_chunk*) ((char *)shm_list_ptr->ptr + shm_varpos);
shm_data = &shm_var->mem;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (php_var_unserialize(return_value, (const unsigned char **) &shm_data, (unsigned char *) shm_data + shm_var->length, &var_hash TSRMLS_CC) != 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corrupted");
+ if (php_var_unserialize(return_value, (const unsigned char **) &shm_data, (unsigned char *) shm_data + shm_var->length, &var_hash) != 1) {
+ php_error_docref(NULL, E_WARNING, "variable data in shared memory is corrupted");
RETVAL_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
@@ -322,7 +322,7 @@ PHP_FUNCTION(shm_has_var)
zend_long shm_key;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -338,7 +338,7 @@ PHP_FUNCTION(shm_remove_var)
zend_long shm_key, shm_varpos;
sysvshm_shm *shm_list_ptr;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &shm_id, &shm_key)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &shm_id, &shm_key)) {
return;
}
SHM_FETCH_RESOURCE(shm_list_ptr, shm_id);
@@ -346,7 +346,7 @@ PHP_FUNCTION(shm_remove_var)
shm_varpos = php_check_shm_data((shm_list_ptr->ptr), shm_key);
if (shm_varpos < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %pd doesn't exist", shm_key);
+ php_error_docref(NULL, E_WARNING, "variable key %pd doesn't exist", shm_key);
RETURN_FALSE;
}
php_remove_shm_data((shm_list_ptr->ptr), shm_varpos);
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c
index b809fff6e0..ba3486478e 100644
--- a/ext/tidy/tidy.c
+++ b/ext/tidy/tidy.c
@@ -55,7 +55,7 @@
return; \
} \
} else { \
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, tidy_ce_doc) == FAILURE) { \
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "O", &object, tidy_ce_doc) == FAILURE) { \
RETURN_FALSE; \
} \
} \
@@ -72,16 +72,16 @@
#define TIDY_APPLY_CONFIG_ZVAL(_doc, _val) \
if(_val) { \
if(Z_TYPE_P(_val) == IS_ARRAY) { \
- _php_tidy_apply_config_array(_doc, HASH_OF(_val) TSRMLS_CC); \
+ _php_tidy_apply_config_array(_doc, HASH_OF(_val)); \
} else { \
convert_to_string_ex(_val); \
TIDY_OPEN_BASE_DIR_CHECK(Z_STRVAL_P(_val)); \
switch (tidyLoadConfig(_doc, Z_STRVAL_P(_val))) { \
case -1: \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \
+ php_error_docref(NULL, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \
break; \
case 1: \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(_val)); \
+ php_error_docref(NULL, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(_val)); \
break; \
} \
} \
@@ -92,7 +92,7 @@
zend_class_entry ce; \
INIT_CLASS_ENTRY(ce, # classname, tidy_funcs_ ## name); \
ce.create_object = tidy_object_new_ ## name; \
- tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent TSRMLS_CC); \
+ tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent); \
tidy_ce_ ## name->ce_flags |= __flags; \
memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); \
tidy_object_handlers_ ## name.clone_obj = NULL; \
@@ -153,14 +153,14 @@
}
#define TIDY_OPEN_BASE_DIR_CHECK(filename) \
-if (php_check_open_basedir(filename TSRMLS_CC)) { \
+if (php_check_open_basedir(filename)) { \
RETURN_FALSE; \
} \
#define TIDY_SET_DEFAULT_CONFIG(_doc) \
if (TG(default_config) && TG(default_config)[0]) { \
if (tidyLoadConfig(_doc, TG(default_config)) < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \
+ php_error_docref(NULL, E_WARNING, "Unable to load Tidy configuration file at '%s'.", TG(default_config)); \
} \
}
/* }}} */
@@ -205,24 +205,24 @@ static inline PHPTidyObj *php_tidy_fetch_object(zend_object *obj) {
/* {{{ ext/tidy prototypes
*/
-static zend_string *php_tidy_file_to_mem(char *, zend_bool TSRMLS_DC);
-static void tidy_object_free_storage(zend_object * TSRMLS_DC);
-static zend_object *tidy_object_new_node(zend_class_entry * TSRMLS_DC);
-static zend_object *tidy_object_new_doc(zend_class_entry * TSRMLS_DC);
-static zval * tidy_instanciate(zend_class_entry *, zval * TSRMLS_DC);
-static int tidy_doc_cast_handler(zval *, zval *, int TSRMLS_DC);
-static int tidy_node_cast_handler(zval *, zval *, int TSRMLS_DC);
-static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC);
-static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC);
-static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType * TSRMLS_DC);
+static zend_string *php_tidy_file_to_mem(char *, zend_bool);
+static void tidy_object_free_storage(zend_object *);
+static zend_object *tidy_object_new_node(zend_class_entry *);
+static zend_object *tidy_object_new_doc(zend_class_entry *);
+static zval * tidy_instanciate(zend_class_entry *, zval *);
+static int tidy_doc_cast_handler(zval *, zval *, int);
+static int tidy_node_cast_handler(zval *, zval *, int);
+static void tidy_doc_update_properties(PHPTidyObj *);
+static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type);
+static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType *);
static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes);
-static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval * TSRMLS_DC);
-static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC);
+static int _php_tidy_set_tidy_opt(TidyDoc, char *, zval *);
+static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options);
static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS);
static void _php_tidy_register_tags(INIT_FUNC_ARGS);
static PHP_INI_MH(php_tidy_set_clean_output);
-static void php_tidy_clean_output_start(const char *name, size_t name_len TSRMLS_DC);
-static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC);
+static void php_tidy_clean_output_start(const char *name, size_t name_len);
+static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags);
static int php_tidy_output_handler(void **nothing, php_output_context *output_context);
static PHP_MINIT_FUNCTION(tidy);
@@ -490,11 +490,10 @@ static void TIDY_CALL php_tidy_free(void *buf)
static void TIDY_CALL php_tidy_panic(ctmbstr msg)
{
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
+ php_error_docref(NULL, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg);
}
-static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS_DC)
+static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value)
{
TidyOption opt = tidyGetOptionByName(doc, optname);
zval conv;
@@ -502,12 +501,12 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
ZVAL_COPY_VALUE(&conv, value);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname);
return FAILURE;
}
if (tidyOptIsReadOnly(opt)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Attempting to set read-only option '%s'", optname);
+ php_error_docref(NULL, E_NOTICE, "Attempting to set read-only option '%s'", optname);
return FAILURE;
}
@@ -549,7 +548,7 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option");
+ php_error_docref(NULL, E_WARNING, "Unable to determine type of configuration option");
break;
}
@@ -567,14 +566,14 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
zval *config = NULL;
if (is_file) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- if (!(data = php_tidy_file_to_mem(arg1->val, use_include_path TSRMLS_CC))) {
+ if (!(data = php_tidy_file_to_mem(arg1->val, use_include_path))) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zsb", &arg1, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
data = arg1;
@@ -588,7 +587,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyBufFree(errbuf);
efree(errbuf);
tidyRelease(doc);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer");
+ php_error_docref(NULL, E_ERROR, "Could not set Tidy error buffer");
}
tidyOptSetBool(doc, TidyForceOutput, yes);
@@ -602,7 +601,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
if(enc_len) {
if (tidySetCharEncoding(doc, enc) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc);
+ php_error_docref(NULL, E_WARNING, "Could not set encoding '%s'", enc);
RETVAL_FALSE;
}
}
@@ -614,7 +613,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyBufAttach(&buf, (byte *) data->val, data->len);
if (tidyParseBuffer(doc, &buf) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", errbuf->bp);
+ php_error_docref(NULL, E_WARNING, "%s", errbuf->bp);
RETVAL_FALSE;
} else {
if (tidyCleanAndRepair(doc) >= 0) {
@@ -640,7 +639,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
tidyRelease(doc);
}
-static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_path TSRMLS_DC)
+static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_path)
{
php_stream *stream;
zend_string *data = NULL;
@@ -656,11 +655,11 @@ static zend_string *php_tidy_file_to_mem(char *filename, zend_bool use_include_p
return data;
}
-static void tidy_object_free_storage(zend_object *object TSRMLS_DC)
+static void tidy_object_free_storage(zend_object *object)
{
PHPTidyObj *intern = php_tidy_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
if (intern->ptdoc) {
intern->ptdoc->ref_count--;
@@ -674,12 +673,12 @@ static void tidy_object_free_storage(zend_object *object TSRMLS_DC)
}
}
-static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, tidy_obj_type objtype TSRMLS_DC)
+static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_handlers *handlers, tidy_obj_type objtype)
{
PHPTidyObj *intern;
intern = ecalloc(1, sizeof(PHPTidyObj) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
switch(objtype) {
@@ -700,7 +699,7 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
tidyRelease(intern->ptdoc->doc);
efree(intern->ptdoc);
efree(intern);
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer");
+ php_error_docref(NULL, E_ERROR, "Could not set Tidy error buffer");
}
tidyOptSetBool(intern->ptdoc->doc, TidyForceOutput, yes);
@@ -708,7 +707,7 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
TIDY_SET_DEFAULT_CONFIG(intern->ptdoc->doc);
- tidy_add_default_properties(intern, is_doc TSRMLS_CC);
+ tidy_add_default_properties(intern, is_doc);
break;
}
@@ -717,23 +716,23 @@ static zend_object *tidy_object_new(zend_class_entry *class_type, zend_object_ha
return &intern->std;
}
-static zend_object *tidy_object_new_node(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *tidy_object_new_node(zend_class_entry *class_type)
{
- return tidy_object_new(class_type, &tidy_object_handlers_node, is_node TSRMLS_CC);
+ return tidy_object_new(class_type, &tidy_object_handlers_node, is_node);
}
-static zend_object *tidy_object_new_doc(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *tidy_object_new_doc(zend_class_entry *class_type)
{
- return tidy_object_new(class_type, &tidy_object_handlers_doc, is_doc TSRMLS_CC);
+ return tidy_object_new(class_type, &tidy_object_handlers_doc, is_doc);
}
-static zval * tidy_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC)
+static zval * tidy_instanciate(zend_class_entry *pce, zval *object)
{
object_init_ex(object, pce);
return object;
}
-static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
+static int tidy_doc_cast_handler(zval *in, zval *out, int type)
{
TidyBuffer output;
PHPTidyObj *obj;
@@ -766,7 +765,7 @@ static int tidy_doc_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
return SUCCESS;
}
-static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
+static int tidy_node_cast_handler(zval *in, zval *out, int type)
{
TidyBuffer buf;
PHPTidyObj *obj;
@@ -803,7 +802,7 @@ static int tidy_node_cast_handler(zval *in, zval *out, int type TSRMLS_DC)
return SUCCESS;
}
-static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
+static void tidy_doc_update_properties(PHPTidyObj *obj)
{
TidyBuffer output;
@@ -831,7 +830,7 @@ static void tidy_doc_update_properties(PHPTidyObj *obj TSRMLS_DC)
}
}
-static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRMLS_DC)
+static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type)
{
TidyBuffer buf;
@@ -891,14 +890,14 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
if (tempnode) {
array_init(&children);
do {
- tidy_instanciate(tidy_ce_node, &temp TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, &temp);
newobj = Z_TIDY_P(&temp);
newobj->node = tempnode;
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
add_next_index_zval(&children, &temp);
} while((tempnode = tidyGetNext(tempnode)));
@@ -921,7 +920,7 @@ static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRM
}
}
-static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type TSRMLS_DC)
+static void *php_tidy_get_opt_val(PHPTidyDoc *ptdoc, TidyOption opt, TidyOptionType *type)
{
*type = tidyOptGetType(opt);
@@ -981,17 +980,17 @@ static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetyp
RETURN_NULL();
}
- tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, return_value);
newobj = Z_TIDY_P(return_value);
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->node = node;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
}
-static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRMLS_DC)
+static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options)
{
zval *opt_val;
ulong opt_indx;
@@ -1001,19 +1000,19 @@ static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options TSRML
if (opt_name == NULL) {
continue;
}
- _php_tidy_set_tidy_opt(doc, opt_name->val, opt_val TSRMLS_CC);
+ _php_tidy_set_tidy_opt(doc, opt_name->val, opt_val);
} ZEND_HASH_FOREACH_END();
return SUCCESS;
}
-static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc TSRMLS_DC)
+static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *enc)
{
TidyBuffer buf;
if(enc) {
if (tidySetCharEncoding(obj->ptdoc->doc, enc) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not set encoding '%s'", enc);
+ php_error_docref(NULL, E_WARNING, "Could not set encoding '%s'", enc);
return FAILURE;
}
}
@@ -1023,10 +1022,10 @@ static int php_tidy_parse_string(PHPTidyObj *obj, char *string, int len, char *e
tidyBufInit(&buf);
tidyBufAttach(&buf, (byte *) string, len);
if (tidyParseBuffer(obj->ptdoc->doc, &buf) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", obj->ptdoc->errbuf->bp);
+ php_error_docref(NULL, E_WARNING, "%s", obj->ptdoc->errbuf->bp);
return FAILURE;
}
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
return SUCCESS;
}
@@ -1051,7 +1050,7 @@ static PHP_MINIT_FUNCTION(tidy)
_php_tidy_register_tags(INIT_FUNC_ARGS_PASSTHRU);
_php_tidy_register_nodetypes(INIT_FUNC_ARGS_PASSTHRU);
- php_output_handler_alias_register(ZEND_STRL("ob_tidyhandler"), php_tidy_output_handler_init TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_tidyhandler"), php_tidy_output_handler_init);
return SUCCESS;
}
@@ -1062,7 +1061,7 @@ static PHP_RINIT_FUNCTION(tidy)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
- php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler") TSRMLS_CC);
+ php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler"));
return SUCCESS;
}
@@ -1100,23 +1099,23 @@ static PHP_INI_MH(php_tidy_set_clean_output)
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- status = php_output_get_status(TSRMLS_C);
+ status = php_output_get_status();
if (value && (status & PHP_OUTPUT_WRITTEN)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot enable tidy.clean_output - there has already been output");
+ php_error_docref(NULL, E_WARNING, "Cannot enable tidy.clean_output - there has already been output");
return FAILURE;
}
if (status & PHP_OUTPUT_SENT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot change tidy.clean_output - headers already sent");
+ php_error_docref(NULL, E_WARNING, "Cannot change tidy.clean_output - headers already sent");
return FAILURE;
}
}
- status = OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ status = OnUpdateBool(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
if (stage == PHP_INI_STAGE_RUNTIME && value) {
- if (!php_output_handler_started(ZEND_STRL("ob_tidyhandler") TSRMLS_CC)) {
- php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler") TSRMLS_CC);
+ if (!php_output_handler_started(ZEND_STRL("ob_tidyhandler"))) {
+ php_tidy_clean_output_start(ZEND_STRL("ob_tidyhandler"));
}
}
@@ -1127,25 +1126,25 @@ static PHP_INI_MH(php_tidy_set_clean_output)
* NOTE: tidy does not support iterative/cumulative parsing, so chunk-sized output handler is not possible
*/
-static void php_tidy_clean_output_start(const char *name, size_t name_len TSRMLS_DC)
+static void php_tidy_clean_output_start(const char *name, size_t name_len)
{
php_output_handler *h;
- if (TG(clean_output) && (h = php_tidy_output_handler_init(name, name_len, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC))) {
- php_output_handler_start(h TSRMLS_CC);
+ if (TG(clean_output) && (h = php_tidy_output_handler_init(name, name_len, 0, PHP_OUTPUT_HANDLER_STDFLAGS))) {
+ php_output_handler_start(h);
}
}
-static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_tidy_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
if (chunk_size) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot use a chunk size for ob_tidyhandler");
+ php_error_docref(NULL, E_WARNING, "Cannot use a chunk size for ob_tidyhandler");
return NULL;
}
if (!TG(clean_output)) {
TG(clean_output) = 1;
}
- return php_output_handler_create_internal(handler_name, handler_name_len, php_tidy_output_handler, chunk_size, flags TSRMLS_CC);
+ return php_output_handler_create_internal(handler_name, handler_name_len, php_tidy_output_handler, chunk_size, flags);
}
static int php_tidy_output_handler(void **nothing, php_output_context *output_context)
@@ -1196,16 +1195,16 @@ static PHP_FUNCTION(tidy_parse_string)
zval *options = NULL;
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
- tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, input->val, input->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, input->val, input->len, enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETURN_FALSE;
}
@@ -1253,22 +1252,22 @@ static PHP_FUNCTION(tidy_parse_file)
PHPTidyObj *obj;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- tidy_instanciate(tidy_ce_doc, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_doc, return_value);
obj = Z_TIDY_P(return_value);
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
zval_ptr_dtor(return_value);
RETVAL_FALSE;
}
@@ -1284,7 +1283,7 @@ static PHP_FUNCTION(tidy_clean_repair)
TIDY_FETCH_OBJECT;
if (tidyCleanAndRepair(obj->ptdoc->doc) >= 0) {
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
RETURN_TRUE;
}
@@ -1315,7 +1314,7 @@ static PHP_FUNCTION(tidy_diagnose)
TIDY_FETCH_OBJECT;
if (obj->ptdoc->initialized && tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
- tidy_doc_update_properties(obj TSRMLS_CC);
+ tidy_doc_update_properties(obj);
RETURN_TRUE;
}
@@ -1349,11 +1348,11 @@ static PHP_FUNCTION(tidy_get_opt_doc)
TIDY_SET_CONTEXT;
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1363,7 +1362,7 @@ static PHP_FUNCTION(tidy_get_opt_doc)
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
RETURN_FALSE;
}
@@ -1396,7 +1395,7 @@ static PHP_FUNCTION(tidy_get_config)
TidyOption opt = tidyGetNextOption(obj->ptdoc->doc, &itOpt);
opt_name = (char *)tidyOptGetName(opt);
- opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
+ opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt);
switch (optt) {
case TidyString:
// TODO: avoid reallocation ???
@@ -1512,11 +1511,11 @@ static PHP_FUNCTION(tidy_getopt)
TIDY_SET_CONTEXT;
if (object) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &optname, &optname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "Os", &object, tidy_ce_doc, &optname, &optname_len) == FAILURE) {
RETURN_FALSE;
}
}
@@ -1526,11 +1525,11 @@ static PHP_FUNCTION(tidy_getopt)
opt = tidyGetOptionByName(obj->ptdoc->doc, optname);
if (!opt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
+ php_error_docref(NULL, E_WARNING, "Unknown Tidy Configuration Option '%s'", optname);
RETURN_FALSE;
}
- optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
+ optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt);
switch (optt) {
case TidyString:
RETVAL_STRING((char *)optval);
@@ -1550,7 +1549,7 @@ static PHP_FUNCTION(tidy_getopt)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to determine type of configuration option");
+ php_error_docref(NULL, E_WARNING, "Unable to determine type of configuration option");
break;
}
@@ -1569,7 +1568,7 @@ static TIDY_DOC_METHOD(__construct)
PHPTidyObj *obj;
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Pzsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|Pzsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
@@ -1577,14 +1576,14 @@ static TIDY_DOC_METHOD(__construct)
obj = Z_TIDY_P(object);
if (inputfile) {
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
return;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC);
+ php_tidy_parse_string(obj, contents->val, contents->len, enc);
zend_string_release(contents);
}
@@ -1603,19 +1602,19 @@ static TIDY_DOC_METHOD(parseFile)
obj = Z_TIDY_P(object);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|zsb", &inputfile,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|zsb", &inputfile,
&options, &enc, &enc_len, &use_include_path) == FAILURE) {
RETURN_FALSE;
}
- if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path TSRMLS_CC))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
+ if (!(contents = php_tidy_file_to_mem(inputfile->val, use_include_path))) {
+ php_error_docref(NULL, E_WARNING, "Cannot Load '%s' into memory%s", inputfile->val, (use_include_path) ? " (Using include path)" : "");
RETURN_FALSE;
}
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if (php_tidy_parse_string(obj, contents->val, contents->len, enc TSRMLS_CC) == FAILURE) {
+ if (php_tidy_parse_string(obj, contents->val, contents->len, enc) == FAILURE) {
RETVAL_FALSE;
} else {
RETVAL_TRUE;
@@ -1634,7 +1633,7 @@ static TIDY_DOC_METHOD(parseString)
TIDY_SET_CONTEXT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|zs", &input, &options, &enc, &enc_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1642,7 +1641,7 @@ static TIDY_DOC_METHOD(parseString)
TIDY_APPLY_CONFIG_ZVAL(obj->ptdoc->doc, options);
- if(php_tidy_parse_string(obj, input->val, input->len, enc TSRMLS_CC) == SUCCESS) {
+ if(php_tidy_parse_string(obj, input->val, input->len, enc) == SUCCESS) {
RETURN_TRUE;
}
@@ -1804,13 +1803,13 @@ static TIDY_NODE_METHOD(getParent)
parent_node = tidyGetParent(obj->node);
if(parent_node) {
- tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+ tidy_instanciate(tidy_ce_node, return_value);
newobj = Z_TIDY_P(return_value);
newobj->node = parent_node;
newobj->type = is_node;
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
- tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+ tidy_add_default_properties(newobj, is_node);
} else {
ZVAL_NULL(return_value);
}
@@ -1822,7 +1821,7 @@ static TIDY_NODE_METHOD(getParent)
__constructor for tidyNode. */
static TIDY_NODE_METHOD(__construct)
{
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "You should not create a tidyNode manually");
+ php_error_docref(NULL, E_ERROR, "You should not create a tidyNode manually");
}
/* }}} */
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c
index 26e05c2be3..379fe5db7e 100644
--- a/ext/tokenizer/tokenizer.c
+++ b/ext/tokenizer/tokenizer.c
@@ -101,7 +101,7 @@ PHP_MINFO_FUNCTION(tokenizer)
}
/* }}} */
-static void tokenize(zval *return_value TSRMLS_DC)
+static void tokenize(zval *return_value)
{
zval token;
zval keyword;
@@ -113,7 +113,7 @@ static void tokenize(zval *return_value TSRMLS_DC)
array_init(return_value);
ZVAL_NULL(&token);
- while ((token_type = lex_scan(&token TSRMLS_CC))) {
+ while ((token_type = lex_scan(&token))) {
destroy = 1;
switch (token_type) {
case T_CLOSE_TAG:
@@ -181,23 +181,23 @@ PHP_FUNCTION(token_get_all)
zval source_zval;
zend_lex_state original_lex_state;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &source) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &source) == FAILURE) {
return;
}
ZVAL_STR_COPY(&source_zval, source);
- zend_save_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_save_lexical_state(&original_lex_state);
- if (zend_prepare_string_for_scanning(&source_zval, "" TSRMLS_CC) == FAILURE) {
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ if (zend_prepare_string_for_scanning(&source_zval, "") == FAILURE) {
+ zend_restore_lexical_state(&original_lex_state);
RETURN_FALSE;
}
LANG_SCNG(yy_state) = yycINITIAL;
- tokenize(return_value TSRMLS_CC);
+ tokenize(return_value);
- zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
+ zend_restore_lexical_state(&original_lex_state);
zval_dtor(&source_zval);
}
/* }}} */
@@ -208,7 +208,7 @@ PHP_FUNCTION(token_name)
{
zend_long type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &type) == FAILURE) {
return;
}
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index edbd013342..84f6279a76 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -60,7 +60,7 @@ void php_wddx_destructor(wddx_packet *packet);
void php_wddx_packet_start(wddx_packet *packet, char *comment, size_t comment_len);
void php_wddx_packet_end(wddx_packet *packet);
-void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC);
+void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name);
int php_wddx_deserialize_ex(const char *, size_t, zval *return_value);
#define php_wddx_gather(packet) estrndup(packet->c, packet->len)
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 43deb15afd..89329f9677 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -244,7 +244,7 @@ static int wddx_stack_destroy(wddx_stack *stack)
/* {{{ release_wddx_packet_rsrc
*/
-static void release_wddx_packet_rsrc(zend_resource *rsrc TSRMLS_DC)
+static void release_wddx_packet_rsrc(zend_resource *rsrc)
{
smart_str *str = (smart_str *)rsrc->ptr;
smart_str_free(str);
@@ -269,7 +269,7 @@ PS_SERIALIZER_ENCODE_FUNC(wddx)
php_wddx_add_chunk_static(packet, WDDX_STRUCT_S);
PS_ENCODE_LOOP(
- php_wddx_serialize_var(packet, struc, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, struc, key);
);
php_wddx_add_chunk_static(packet, WDDX_STRUCT_E);
@@ -304,7 +304,7 @@ PS_SERIALIZER_DECODE_FUNC(wddx)
} else {
zend_string_addref(key);
}
- if (php_set_session_var(key, ent, NULL TSRMLS_CC)) {
+ if (php_set_session_var(key, ent, NULL)) {
if (Z_REFCOUNTED_P(ent)) Z_ADDREF_P(ent);
}
PS_ADD_VAR(key);
@@ -385,14 +385,14 @@ void php_wddx_packet_end(wddx_packet *packet)
/* {{{ php_wddx_serialize_string
*/
-static void php_wddx_serialize_string(wddx_packet *packet, zval *var TSRMLS_DC)
+static void php_wddx_serialize_string(wddx_packet *packet, zval *var)
{
php_wddx_add_chunk_static(packet, WDDX_STRING_S);
if (Z_STRLEN_P(var) > 0) {
zend_string *buf;
- buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), 0, ENT_QUOTES, NULL TSRMLS_CC);
+ buf = php_escape_html_entities(Z_STRVAL_P(var), Z_STRLEN_P(var), 0, ENT_QUOTES, NULL);
php_wddx_add_chunk_ex(packet, buf->val, buf->len);
@@ -445,14 +445,13 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
zend_ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
- TSRMLS_FETCH();
ZVAL_STRING(&fname, "__sleep");
/*
* We try to call __sleep() method on object. It's supposed to return an
* array of property names to be serialized.
*/
- if (call_user_function_ex(CG(function_table), obj, &fname, &retval, 0, 0, 1, NULL TSRMLS_CC) == SUCCESS) {
+ if (call_user_function_ex(CG(function_table), obj, &fname, &retval, 0, 0, 1, NULL) == SUCCESS) {
if (!Z_ISUNDEF(retval) && (sleephash = HASH_OF(&retval))) {
PHP_CLASS_ATTRIBUTES;
@@ -472,12 +471,12 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
ZEND_HASH_FOREACH_VAL(sleephash, varname) {
if (Z_TYPE_P(varname) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
+ php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize.");
continue;
}
if ((ent = zend_hash_find(objhash, Z_STR_P(varname))) != NULL) {
- php_wddx_serialize_var(packet, ent, Z_STR_P(varname) TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, Z_STR_P(varname));
}
} ZEND_HASH_FOREACH_END();
@@ -510,11 +509,11 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len);
tmp = zend_string_init(prop_name, prop_name_len, 0);
- php_wddx_serialize_var(packet, ent, tmp TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, tmp);
zend_string_release(tmp);
} else {
key = zend_long_to_str(idx);
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
zend_string_release(key);
}
} ZEND_HASH_FOREACH_END();
@@ -537,7 +536,6 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
HashTable *target_hash;
char tmp_buf[WDDX_BUF_LEN];
zend_ulong ind = 0;
- TSRMLS_FETCH();
target_hash = HASH_OF(arr);
ZEND_HASH_FOREACH_KEY(target_hash, idx, key) {
@@ -567,14 +565,14 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
if (is_struct) {
if (key) {
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
} else {
key = zend_long_to_str(idx);
- php_wddx_serialize_var(packet, ent, key TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, key);
zend_string_release(key);
}
} else {
- php_wddx_serialize_var(packet, ent, NULL TSRMLS_CC);
+ php_wddx_serialize_var(packet, ent, NULL);
}
} ZEND_HASH_FOREACH_END();
@@ -588,7 +586,7 @@ static void php_wddx_serialize_array(wddx_packet *packet, zval *arr)
/* {{{ php_wddx_serialize_var
*/
-void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC)
+void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name)
{
HashTable *ht;
@@ -596,7 +594,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
char *tmp_buf;
zend_string *name_esc;
- name_esc = php_escape_html_entities(name->val, name->len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+ name_esc = php_escape_html_entities(name->val, name->len, 0, ENT_QUOTES, NULL);
tmp_buf = emalloc(name_esc->len + sizeof(WDDX_VAR_S));
snprintf(tmp_buf, name_esc->len + sizeof(WDDX_VAR_S), WDDX_VAR_S, name_esc->val);
php_wddx_add_chunk(packet, tmp_buf);
@@ -610,7 +608,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
ZVAL_DEREF(var);
switch (Z_TYPE_P(var)) {
case IS_STRING:
- php_wddx_serialize_string(packet, var TSRMLS_CC);
+ php_wddx_serialize_string(packet, var);
break;
case IS_LONG:
@@ -630,7 +628,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
case IS_ARRAY:
ht = Z_ARRVAL_P(var);
if (ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
if (ZEND_HASH_APPLY_PROTECTION(ht)) {
@@ -645,7 +643,7 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TS
case IS_OBJECT:
ht = Z_OBJPROP_P(var);
if (ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
+ php_error_docref(NULL, E_RECOVERABLE_ERROR, "WDDX doesn't support circular references");
return;
}
ht->u.v.nApplyCount++;
@@ -666,15 +664,14 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
{
zval *val;
HashTable *target_hash;
- TSRMLS_FETCH();
if (Z_TYPE_P(name_var) == IS_STRING) {
- zend_array *symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
+ zend_array *symbol_table = zend_rebuild_symbol_table();
if ((val = zend_hash_find(&symbol_table->ht, Z_STR_P(name_var))) != NULL) {
if (Z_TYPE_P(val) == IS_INDIRECT) {
val = Z_INDIRECT_P(val);
}
- php_wddx_serialize_var(packet, val, Z_STR_P(name_var) TSRMLS_CC);
+ php_wddx_serialize_var(packet, val, Z_STR_P(name_var));
}
} else if (Z_TYPE_P(name_var) == IS_ARRAY || Z_TYPE_P(name_var) == IS_OBJECT) {
int is_array = Z_TYPE_P(name_var) == IS_ARRAY;
@@ -682,7 +679,7 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
target_hash = HASH_OF(name_var);
if (is_array && target_hash->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+ php_error_docref(NULL, E_WARNING, "recursion detected");
return;
}
@@ -714,7 +711,6 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
- TSRMLS_FETCH();
if (!strcmp((char *)name, EL_PACKET)) {
int i;
@@ -870,7 +866,6 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
HashTable *target_hash;
zend_class_entry *pce;
zval obj;
- TSRMLS_FETCH();
/* OBJECTS_FIXME */
if (stack->top == 0) {
@@ -898,7 +893,7 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
ZVAL_STRING(&fname, "__wakeup");
- call_user_function_ex(NULL, &ent1->data, &fname, &retval, 0, 0, 0, NULL TSRMLS_CC);
+ call_user_function_ex(NULL, &ent1->data, &fname, &retval, 0, 0, 0, NULL);
zval_ptr_dtor(&fname);
zval_ptr_dtor(&retval);
@@ -986,7 +981,6 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
{
st_entry *ent;
wddx_stack *stack = (wddx_stack *)user_data;
- TSRMLS_FETCH();
if (!wddx_stack_is_empty(stack) && !stack->done) {
wddx_stack_top(stack, (void**)&ent);
@@ -1004,7 +998,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
break;
case ST_NUMBER:
ZVAL_STRINGL(&ent->data, (char *)s, len);
- convert_scalar_to_number(&ent->data TSRMLS_CC);
+ convert_scalar_to_number(&ent->data);
break;
case ST_BOOLEAN:
@@ -1088,14 +1082,14 @@ PHP_FUNCTION(wddx_serialize_value)
size_t comment_len = 0;
wddx_packet *packet;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &var, &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|s", &var, &comment, &comment_len) == FAILURE) {
return;
}
packet = php_wddx_constructor();
php_wddx_packet_start(packet, comment, comment_len);
- php_wddx_serialize_var(packet, var, NULL TSRMLS_CC);
+ php_wddx_serialize_var(packet, var, NULL);
php_wddx_packet_end(packet);
smart_str_0(packet);
@@ -1112,7 +1106,7 @@ PHP_FUNCTION(wddx_serialize_vars)
wddx_packet *packet;
zval *args = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &num_args) == FAILURE) {
return;
}
@@ -1174,7 +1168,7 @@ PHP_FUNCTION(wddx_packet_start)
comment = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &comment, &comment_len) == FAILURE) {
return;
}
@@ -1194,7 +1188,7 @@ PHP_FUNCTION(wddx_packet_end)
zval *packet_id;
wddx_packet *packet = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &packet_id) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &packet_id) == FAILURE) {
return;
}
@@ -1220,7 +1214,7 @@ PHP_FUNCTION(wddx_add_vars)
zval *packet_id;
wddx_packet *packet = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r+", &packet_id, &args, &num_args) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r+", &packet_id, &args, &num_args) == FAILURE) {
return;
}
@@ -1257,7 +1251,7 @@ PHP_FUNCTION(wddx_deserialize)
php_stream *stream = NULL;
zend_string *payload = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &packet) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &packet) == FAILURE) {
return;
}
@@ -1269,7 +1263,7 @@ PHP_FUNCTION(wddx_deserialize)
payload = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expecting parameter 1 to be a string or a stream");
+ php_error_docref(NULL, E_WARNING, "Expecting parameter 1 to be a string or a stream");
return;
}
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 6959424376..026c4555bb 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -74,7 +74,7 @@ PHP_MINIT_FUNCTION(xml);
PHP_MINFO_FUNCTION(xml);
static PHP_GINIT_FUNCTION(xml);
-static void xml_parser_dtor(zend_resource *rsrc TSRMLS_DC);
+static void xml_parser_dtor(zend_resource *rsrc);
static void xml_set_handler(zval *, zval *);
inline static unsigned short xml_encode_iso_8859_1(unsigned char);
inline static char xml_decode_iso_8859_1(unsigned short);
@@ -394,7 +394,7 @@ static void _xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encodi
/* }}} */
/* {{{ xml_parser_dtor() */
-static void xml_parser_dtor(zend_resource *rsrc TSRMLS_DC)
+static void xml_parser_dtor(zend_resource *rsrc)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
@@ -476,7 +476,6 @@ static void xml_set_handler(zval *handler, zval *data)
static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *function_ptr, int argc, zval *argv, zval *retval)
{
int i;
- TSRMLS_FETCH();
ZVAL_UNDEF(retval);
if (parser && handler && !EG(exception)) {
@@ -494,20 +493,20 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f
fci.no_separation = 0;
/*fci.function_handler_cache = &function_ptr;*/
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == FAILURE) {
zval *method;
zval *obj;
if (Z_TYPE_P(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler));
} else if ((obj = zend_hash_index_find(Z_ARRVAL_P(handler), 0)) != NULL &&
(method = zend_hash_index_find(Z_ARRVAL_P(handler), 1)) != NULL &&
Z_TYPE_P(obj) == IS_OBJECT &&
Z_TYPE_P(method) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s::%s()", Z_OBJCE_P(obj)->name->val, Z_STRVAL_P(method));
} else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler");
+ php_error_docref(NULL, E_WARNING, "Unable to call handler");
}
}
for (i = 0; i < argc; i++) {
@@ -792,8 +791,7 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch
parser->ctag = zend_hash_next_index_insert(Z_ARRVAL(parser->data), &tag);
} else if (parser->level == (XML_MAXLEVEL + 1)) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated");
+ php_error_docref(NULL, E_WARNING, "Maximum depth exceeded - Results truncated");
}
}
@@ -934,8 +932,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
zend_hash_next_index_insert(Z_ARRVAL(parser->data), &tag);
} else if (parser->level == (XML_MAXLEVEL + 1)) {
- TSRMLS_FETCH();
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Maximum depth exceeded - Results truncated");
+ php_error_docref(NULL, E_WARNING, "Maximum depth exceeded - Results truncated");
}
}
} else {
@@ -1105,7 +1102,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
XML_Char *encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), (ns_support ? "|ss": "|s"), &encoding_param, &encoding_param_len, &ns_param, &ns_param_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1123,7 +1120,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
} else if (strcasecmp(encoding_param, "US-ASCII") == 0) {
encoding = (XML_Char*)"US-ASCII";
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported source encoding \"%s\"", encoding_param);
+ php_error_docref(NULL, E_WARNING, "unsupported source encoding \"%s\"", encoding_param);
RETURN_FALSE;
}
} else {
@@ -1172,7 +1169,7 @@ PHP_FUNCTION(xml_set_object)
xml_parser *parser;
zval *pind, *mythis;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ro/", &pind, &mythis) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ro/", &pind, &mythis) == FAILURE) {
return;
}
@@ -1201,7 +1198,7 @@ PHP_FUNCTION(xml_set_element_handler)
xml_parser *parser;
zval *pind, *shdl, *ehdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzz", &pind, &shdl, &ehdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rzz", &pind, &shdl, &ehdl) == FAILURE) {
return;
}
@@ -1221,7 +1218,7 @@ PHP_FUNCTION(xml_set_character_data_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1240,7 +1237,7 @@ PHP_FUNCTION(xml_set_processing_instruction_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1259,7 +1256,7 @@ PHP_FUNCTION(xml_set_default_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1278,7 +1275,7 @@ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1297,7 +1294,7 @@ PHP_FUNCTION(xml_set_notation_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1315,7 +1312,7 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1333,7 +1330,7 @@ PHP_FUNCTION(xml_set_start_namespace_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1352,7 +1349,7 @@ PHP_FUNCTION(xml_set_end_namespace_decl_handler)
xml_parser *parser;
zval *pind, *hdl;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &pind, &hdl) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &pind, &hdl) == FAILURE) {
return;
}
@@ -1375,7 +1372,7 @@ PHP_FUNCTION(xml_parse)
int ret;
zend_long isFinal = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &pind, &data, &data_len, &isFinal) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1399,7 +1396,7 @@ PHP_FUNCTION(xml_parse_into_struct)
size_t data_len;
int ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|z/", &pind, &data, &data_len, &xdata, &info) == FAILURE) {
return;
}
@@ -1441,7 +1438,7 @@ PHP_FUNCTION(xml_get_error_code)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1458,7 +1455,7 @@ PHP_FUNCTION(xml_error_string)
zend_long code;
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &code) == FAILURE) {
return;
}
@@ -1476,7 +1473,7 @@ PHP_FUNCTION(xml_get_current_line_number)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1493,7 +1490,7 @@ PHP_FUNCTION(xml_get_current_column_number)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1510,7 +1507,7 @@ PHP_FUNCTION(xml_get_current_byte_index)
xml_parser *parser;
zval *pind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
@@ -1528,14 +1525,14 @@ PHP_FUNCTION(xml_parser_free)
xml_parser *parser;
zend_resource *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
if (parser->isparsing == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parser cannot be freed while it is parsing.");
+ php_error_docref(NULL, E_WARNING, "Parser cannot be freed while it is parsing.");
RETURN_FALSE;
}
@@ -1554,7 +1551,7 @@ PHP_FUNCTION(xml_parser_set_option)
zval *pind, *val;
zend_long opt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &pind, &opt, &val) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &pind, &opt, &val) == FAILURE) {
return;
}
@@ -1578,14 +1575,14 @@ PHP_FUNCTION(xml_parser_set_option)
convert_to_string_ex(val);
enc = xml_get_encoding((XML_Char*)Z_STRVAL_P(val));
if (enc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_P(val));
+ php_error_docref(NULL, E_WARNING, "Unsupported target encoding \"%s\"", Z_STRVAL_P(val));
RETURN_FALSE;
}
parser->target_encoding = enc->name;
break;
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option");
+ php_error_docref(NULL, E_WARNING, "Unknown option");
RETURN_FALSE;
break;
}
@@ -1601,7 +1598,7 @@ PHP_FUNCTION(xml_parser_get_option)
zval *pind;
zend_long opt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &pind, &opt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &pind, &opt) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(parser, xml_parser *, pind, -1, "XML Parser", le_xml_parser);
@@ -1614,7 +1611,7 @@ PHP_FUNCTION(xml_parser_get_option)
RETURN_STRING((char *)parser->target_encoding);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option");
+ php_error_docref(NULL, E_WARNING, "Unknown option");
RETURN_FALSE;
break;
}
@@ -1631,7 +1628,7 @@ PHP_FUNCTION(utf8_encode)
size_t arg_len;
zend_string *encoded;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@@ -1651,7 +1648,7 @@ PHP_FUNCTION(utf8_decode)
size_t arg_len;
zend_string *decoded;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 43e585dd33..a297e0de38 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -42,7 +42,7 @@ static HashTable xmlreader_prop_handlers;
typedef int (*xmlreader_read_int_t)(xmlTextReaderPtr reader);
typedef unsigned char *(*xmlreader_read_char_t)(xmlTextReaderPtr reader);
typedef const unsigned char *(*xmlreader_read_const_char_t)(xmlTextReaderPtr reader);
-typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval TSRMLS_DC);
+typedef int (*xmlreader_write_t)(xmlreader_object *obj, zval *newval);
typedef unsigned char *(*xmlreader_read_one_char_t)(xmlTextReaderPtr reader, const unsigned char *);
@@ -57,7 +57,7 @@ typedef struct _xmlreader_prop_handler {
#define XMLREADER_LOAD_FILE 1
/* {{{ xmlreader_register_prop_handler */
-static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype TSRMLS_DC)
+static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name, xmlreader_read_int_t read_int_func, xmlreader_read_const_char_t read_char_func, int rettype)
{
xmlreader_prop_handler hnd;
@@ -69,7 +69,7 @@ static void xmlreader_register_prop_handler(HashTable *prop_handler, char *name,
/* }}} */
/* {{{ xmlreader_property_reader */
-static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval *rv TSRMLS_DC)
+static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handler *hnd, zval *rv)
{
const xmlChar *retchar = NULL;
int retint = 0;
@@ -81,7 +81,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl
if (hnd->read_int_func) {
retint = hnd->read_int_func(obj->ptr);
if (retint == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal libxml error returned");
+ php_error_docref(NULL, E_WARNING, "Internal libxml error returned");
return FAILURE;
}
}
@@ -112,7 +112,7 @@ static int xmlreader_property_reader(xmlreader_object *obj, xmlreader_prop_handl
/* }}} */
/* {{{ xmlreader_get_property_ptr_ptr */
-zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC)
+zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
xmlreader_object *obj;
zval tmp_member;
@@ -135,7 +135,7 @@ zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void
if (hnd == NULL) {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -147,7 +147,7 @@ zval *xmlreader_get_property_ptr_ptr(zval *object, zval *member, int type, void
/* }}} */
/* {{{ xmlreader_read_property */
-zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC)
+zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
xmlreader_object *obj;
zval tmp_member;
@@ -169,14 +169,14 @@ zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache
}
if (hnd != NULL) {
- if (xmlreader_property_reader(obj, hnd, rv TSRMLS_CC) == FAILURE) {
+ if (xmlreader_property_reader(obj, hnd, rv) == FAILURE) {
retval = &EG(uninitialized_zval);
} else {
retval = rv;
}
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -187,7 +187,7 @@ zval *xmlreader_read_property(zval *object, zval *member, int type, void **cache
/* }}} */
/* {{{ xmlreader_write_property */
-void xmlreader_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC)
+void xmlreader_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
xmlreader_object *obj;
zval tmp_member;
@@ -207,10 +207,10 @@ void xmlreader_write_property(zval *object, zval *member, zval *value, void **ca
hnd = zend_hash_find_ptr(obj->prop_handler, Z_STR_P(member));
}
if (hnd != NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write to read-only property");
+ php_error_docref(NULL, E_WARNING, "Cannot write to read-only property");
} else {
std_hnd = zend_get_std_object_handlers();
- std_hnd->write_property(object, member, value, cache_slot TSRMLS_CC);
+ std_hnd->write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
@@ -222,7 +222,7 @@ void xmlreader_write_property(zval *object, zval *member, zval *value, void **ca
/* {{{ _xmlreader_get_valid_file_path */
/* _xmlreader_get_valid_file_path and _xmlreader_get_relaxNG should be made a
common function in libxml extension as code is common to a few xml extensions */
-char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
+char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) {
xmlURI *uri;
xmlChar *escsource;
char *file_dest;
@@ -255,7 +255,7 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
file_dest = source;
if ((uri->scheme == NULL || isFileUri)) {
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -272,7 +272,7 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
/* {{{ _xmlreader_get_relaxNG */
static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, size_t type,
xmlRelaxNGValidityErrorFunc error_func,
- xmlRelaxNGValidityWarningFunc warn_func TSRMLS_DC)
+ xmlRelaxNGValidityWarningFunc warn_func)
{
char *valid_file = NULL;
xmlRelaxNGParserCtxtPtr parser = NULL;
@@ -281,7 +281,7 @@ static xmlRelaxNGPtr _xmlreader_get_relaxNG(char *source, size_t source_len, siz
switch (type) {
case XMLREADER_LOAD_FILE:
- valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (!valid_file) {
return NULL;
}
@@ -341,7 +341,7 @@ ZEND_GET_MODULE(xmlreader)
#endif
/* {{{ xmlreader_objects_clone */
-void xmlreader_objects_clone(void *object, void **object_clone TSRMLS_DC)
+void xmlreader_objects_clone(void *object, void **object_clone)
{
/* TODO */
}
@@ -370,23 +370,23 @@ static void xmlreader_free_resources(xmlreader_object *intern) {
/* }}} */
/* {{{ xmlreader_objects_free_storage */
-void xmlreader_objects_free_storage(zend_object *object TSRMLS_DC)
+void xmlreader_objects_free_storage(zend_object *object)
{
xmlreader_object *intern = php_xmlreader_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
xmlreader_free_resources(intern);
}
/* }}} */
/* {{{ xmlreader_objects_new */
-zend_object *xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *xmlreader_objects_new(zend_class_entry *class_type)
{
xmlreader_object *intern;
intern = ecalloc(1, sizeof(xmlreader_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->prop_handler = &xmlreader_prop_handlers;
intern->std.handlers = &xmlreader_object_handlers;
@@ -403,12 +403,12 @@ static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_rea
xmlreader_object *intern;
char *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (!name_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument cannot be an empty string");
+ php_error_docref(NULL, E_WARNING, "Argument cannot be an empty string");
RETURN_FALSE;
}
@@ -486,12 +486,12 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
xmlRelaxNGPtr schema = NULL;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p!", &source, &source_len) == FAILURE) {
return;
}
if (source != NULL && !source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required");
+ php_error_docref(NULL, E_WARNING, "Schema data source is required");
RETURN_FALSE;
}
@@ -500,7 +500,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
if (source) {
- schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC);
+ schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL);
if (schema) {
retval = xmlTextReaderRelaxNGSetSchema(intern->ptr, schema);
}
@@ -520,11 +520,11 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
+ php_error_docref(NULL, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml.");
+ php_error_docref(NULL, E_WARNING, "No Schema support built into libxml.");
RETURN_FALSE;
#endif
@@ -566,7 +566,7 @@ PHP_METHOD(xmlreader, getAttributeNo)
char *retchar = NULL;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr_pos) == FAILURE) {
return;
}
@@ -592,12 +592,12 @@ PHP_METHOD(xmlreader, getAttributeNs)
xmlreader_object *intern;
char *name, *ns_uri, *retchar = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
if (name_len == 0 || ns_uri_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
RETURN_FALSE;
}
@@ -623,7 +623,7 @@ PHP_METHOD(xmlreader, getParserProperty)
int retval = -1;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &property) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &property) == FAILURE) {
return;
}
@@ -634,7 +634,7 @@ PHP_METHOD(xmlreader, getParserProperty)
retval = xmlTextReaderGetParserProp(intern->ptr,property);
}
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ php_error_docref(NULL, E_WARNING, "Invalid parser property");
RETURN_FALSE;
}
@@ -670,12 +670,12 @@ PHP_METHOD(xmlreader, moveToAttribute)
xmlreader_object *intern;
char *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (name_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name is required");
+ php_error_docref(NULL, E_WARNING, "Attribute Name is required");
RETURN_FALSE;
}
@@ -703,7 +703,7 @@ PHP_METHOD(xmlreader, moveToAttributeNo)
int retval;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &attr_pos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &attr_pos) == FAILURE) {
return;
}
@@ -732,12 +732,12 @@ PHP_METHOD(xmlreader, moveToAttributeNs)
xmlreader_object *intern;
char *name, *ns_uri;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
if (name_len == 0 || ns_uri_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
+ php_error_docref(NULL, E_WARNING, "Attribute Name and Namespace URI cannot be empty");
RETURN_FALSE;
}
@@ -798,7 +798,7 @@ PHP_METHOD(xmlreader, read)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to read");
RETURN_FALSE;
}
/* }}} */
@@ -813,7 +813,7 @@ PHP_METHOD(xmlreader, next)
xmlreader_object *intern;
char *name = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
@@ -840,7 +840,7 @@ PHP_METHOD(xmlreader, next)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to read");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to read");
RETURN_FALSE;
}
/* }}} */
@@ -858,13 +858,13 @@ PHP_METHOD(xmlreader, open)
char resolved_path[MAXPATHLEN + 1];
xmlTextReaderPtr reader = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
id = getThis();
if (id != NULL) {
- if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ if (! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry)) {
id = NULL;
} else {
intern = Z_XMLREADER_P(id);
@@ -873,18 +873,18 @@ PHP_METHOD(xmlreader, open)
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
- valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN );
if (valid_file) {
reader = xmlReaderForFile(valid_file, encoding, options);
}
if (reader == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open source data");
+ php_error_docref(NULL, E_WARNING, "Unable to open source data");
RETURN_FALSE;
}
@@ -945,12 +945,12 @@ PHP_METHOD(xmlreader, setSchema)
xmlreader_object *intern;
char *source;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p!", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p!", &source, &source_len) == FAILURE) {
return;
}
if (source != NULL && !source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Schema data source is required");
+ php_error_docref(NULL, E_WARNING, "Schema data source is required");
RETURN_FALSE;
}
@@ -965,11 +965,11 @@ PHP_METHOD(xmlreader, setSchema)
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
+ php_error_docref(NULL, E_WARNING, "Unable to set schema. This must be set prior to reading or schema contains errors.");
RETURN_FALSE;
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Schema support built into libxml.");
+ php_error_docref(NULL, E_WARNING, "No Schema support built into libxml.");
RETURN_FALSE;
#endif
@@ -988,7 +988,7 @@ PHP_METHOD(xmlreader, setParserProperty)
zend_bool value;
xmlreader_object *intern;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lb", &property, &value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lb", &property, &value) == FAILURE) {
return;
}
@@ -999,7 +999,7 @@ PHP_METHOD(xmlreader, setParserProperty)
retval = xmlTextReaderSetParserProp(intern->ptr,property, value);
}
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parser property");
+ php_error_docref(NULL, E_WARNING, "Invalid parser property");
RETURN_FALSE;
}
@@ -1043,12 +1043,12 @@ PHP_METHOD(xmlreader, XML)
xmlParserInputBufferPtr inputbfr;
xmlTextReaderPtr reader;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!l", &source, &source_len, &encoding, &encoding_len, &options) == FAILURE) {
return;
}
id = getThis();
- if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry TSRMLS_CC)) {
+ if (id != NULL && ! instanceof_function(Z_OBJCE_P(id), xmlreader_class_entry)) {
id = NULL;
}
if (id != NULL) {
@@ -1057,7 +1057,7 @@ PHP_METHOD(xmlreader, XML)
}
if (!source_len) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ php_error_docref(NULL, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
@@ -1110,7 +1110,7 @@ PHP_METHOD(xmlreader, XML)
if (inputbfr) {
xmlFreeParserInputBuffer(inputbfr);
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load source data");
+ php_error_docref(NULL, E_WARNING, "Unable to load source data");
RETURN_FALSE;
}
/* }}} */
@@ -1127,7 +1127,7 @@ PHP_METHOD(xmlreader, expand)
xmlDocPtr docp = NULL;
php_libxml_node_object *domobj = NULL;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O!", &id, xmlreader_class_entry, &basenode, dom_node_class_entry) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!", &id, xmlreader_class_entry, &basenode, dom_node_class_entry) == FAILURE) {
return;
}
@@ -1142,19 +1142,19 @@ PHP_METHOD(xmlreader, expand)
node = xmlTextReaderExpand(intern->ptr);
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while expanding ");
+ php_error_docref(NULL, E_WARNING, "An Error Occurred while expanding ");
RETURN_FALSE;
} else {
nodec = xmlDocCopyNode(node, docp, 1);
if (nodec == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot expand this node type");
+ php_error_docref(NULL, E_NOTICE, "Cannot expand this node type");
RETURN_FALSE;
} else {
DOM_RET_OBJ(nodec, &ret, (dom_object *)domobj);
}
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Load Data before trying to expand");
+ php_error_docref(NULL, E_WARNING, "Load Data before trying to expand");
RETURN_FALSE;
}
#else
@@ -1315,23 +1315,23 @@ PHP_MINIT_FUNCTION(xmlreader)
INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions);
ce.create_object = xmlreader_objects_new;
- xmlreader_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ xmlreader_class_entry = zend_register_internal_class(&ce);
zend_hash_init(&xmlreader_prop_handlers, 0, NULL, php_xmlreader_free_prop_handler, 1);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_FALSE TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING TSRMLS_CC);
- xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING TSRMLS_CC);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "depth", xmlTextReaderDepth, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasAttributes", xmlTextReaderHasAttributes, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "hasValue", xmlTextReaderHasValue, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isDefault", xmlTextReaderIsDefault, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "isEmptyElement", xmlTextReaderIsEmptyElement, NULL, IS_FALSE);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "localName", NULL, xmlTextReaderConstLocalName, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "name", NULL, xmlTextReaderConstName, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "namespaceURI", NULL, xmlTextReaderConstNamespaceUri, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "nodeType", xmlTextReaderNodeType, NULL, IS_LONG);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "prefix", NULL, xmlTextReaderConstPrefix, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "value", NULL, xmlTextReaderConstValue, IS_STRING);
+ xmlreader_register_prop_handler(&xmlreader_prop_handlers, "xmlLang", NULL, xmlTextReaderConstXmlLang, IS_STRING);
/* Constants for NodeType - cannot define common types to share with dom as there are differences in these types */
diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h
index 7a721dcc6f..f9e1a228e7 100644
--- a/ext/xmlreader/php_xmlreader.h
+++ b/ext/xmlreader/php_xmlreader.h
@@ -51,7 +51,7 @@ PHP_MSHUTDOWN_FUNCTION(xmlreader);
PHP_MINFO_FUNCTION(xmlreader);
#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
#ifdef ZTS
#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
diff --git a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
index 13976077be..eedf255dc8 100644
--- a/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.c
@@ -228,8 +228,7 @@ xml_element* XMLRPC_to_xml_element_worker(XMLRPC_VALUE current_vector, XMLRPC_VA
break;
case xmlrpc_double:
{
- TSRMLS_FETCH();
- elem_val->name = strdup(ELEM_DOUBLE);
+ elem_val->name = strdup(ELEM_DOUBLE);
ap_php_snprintf(buf, BUF_SIZE, "%.*G", (int) EG(precision), XMLRPC_GetValueDouble(node));
simplestring_add(&elem_val->text, buf);
}
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index d43a31be11..f3c562c829 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -264,7 +264,7 @@ int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE type);
* startup / shutdown *
*********************/
-static void destroy_server_data(xmlrpc_server_data *server TSRMLS_DC)
+static void destroy_server_data(xmlrpc_server_data *server)
{
if (server) {
XMLRPC_ServerDestroy(server->server_ptr);
@@ -278,11 +278,11 @@ static void destroy_server_data(xmlrpc_server_data *server TSRMLS_DC)
/* called when server is being destructed. either when xmlrpc_server_destroy
* is called, or when request ends. */
-static void xmlrpc_server_destructor(zend_resource *rsrc TSRMLS_DC)
+static void xmlrpc_server_destructor(zend_resource *rsrc)
{
if (rsrc && rsrc->ptr) {
rsrc->gc.refcount++;
- destroy_server_data((xmlrpc_server_data*) rsrc->ptr TSRMLS_CC);
+ destroy_server_data((xmlrpc_server_data*) rsrc->ptr);
rsrc->gc.refcount--;
}
}
@@ -498,7 +498,7 @@ static XMLRPC_VECTOR_TYPE determine_vector_type (HashTable *ht)
}
/* recursively convert php values into xmlrpc values */
-static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth TSRMLS_DC)
+static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int depth)
{
XMLRPC_VALUE xReturn = NULL;
@@ -550,7 +550,7 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
ht = HASH_OF(&val);
if (ht && ht->u.v.nApplyCount > 1) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "XML-RPC doesn't support circular references");
+ php_error_docref(NULL, E_ERROR, "XML-RPC doesn't support circular references");
return NULL;
}
@@ -572,12 +572,12 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
spprintf(&num_str, 0, "%ld", num_index);
}
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(num_str, pIter, depth++ TSRMLS_CC));
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(num_str, pIter, depth++));
if (num_str) {
efree(num_str);
}
} else {
- XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key->val, pIter, depth++ TSRMLS_CC));
+ XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(my_key->val, pIter, depth++));
}
if (ht) {
ht->u.v.nApplyCount--;
@@ -594,9 +594,9 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
return xReturn;
}
-static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val TSRMLS_DC)
+static XMLRPC_VALUE PHP_to_XMLRPC(zval* root_val)
{
- return PHP_to_XMLRPC_worker(NULL, root_val, 0 TSRMLS_CC);
+ return PHP_to_XMLRPC_worker(NULL, root_val, 0);
}
/* recursively convert xmlrpc values into php values */
@@ -669,7 +669,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
size_t method_len;
php_output_options out;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!z|a", &method, &method_len, &vals, &out_opts) == FAILURE) {
return;
}
@@ -687,7 +687,7 @@ PHP_FUNCTION(xmlrpc_encode_request)
XMLRPC_RequestSetRequestType(xRequest, xmlrpc_request_call);
}
if (Z_TYPE_P(vals) != IS_NULL) {
- XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals TSRMLS_CC));
+ XMLRPC_RequestSetData(xRequest, PHP_to_XMLRPC(vals));
}
outBuf = XMLRPC_REQUEST_ToXML(xRequest, 0);
@@ -713,13 +713,13 @@ PHP_FUNCTION(xmlrpc_encode)
zval *arg1;
char *outBuf;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg1) == FAILURE) {
return;
}
if (USED_RET()) {
/* convert native php type to xmlrpc type */
- xOut = PHP_to_XMLRPC(arg1 TSRMLS_CC);
+ xOut = PHP_to_XMLRPC(arg1);
/* generate raw xml from xmlrpc data */
outBuf = XMLRPC_VALUE_ToXML(xOut, 0);
@@ -777,7 +777,7 @@ PHP_FUNCTION(xmlrpc_decode_request)
zval *method;
size_t xml_len, encoding_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -794,7 +794,7 @@ PHP_FUNCTION(xmlrpc_decode)
char *arg1, *arg2 = NULL;
size_t arg1_len, arg2_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
return;
}
@@ -840,7 +840,7 @@ PHP_FUNCTION(xmlrpc_server_destroy)
int bSuccess = FAILURE;
xmlrpc_server_data *server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg1) == FAILURE) {
return;
}
@@ -865,7 +865,6 @@ static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRe
zval* php_function;
zval xmlrpc_params;
zval callback_params[3];
- TSRMLS_FETCH();
zval_ptr_dtor(&pData->xmlrpc_method);
zval_ptr_dtor(&pData->return_data);
@@ -887,13 +886,13 @@ static XMLRPC_VALUE php_xmlrpc_callback(XMLRPC_SERVER server, XMLRPC_REQUEST xRe
/* Use same C function for all methods */
/* php func prototype: function user_func($method_name, $xmlrpc_params, $user_params) */
- call_user_function(CG(function_table), NULL, &pData->php_function, &pData->return_data, 3, callback_params TSRMLS_CC);
+ call_user_function(CG(function_table), NULL, &pData->php_function, &pData->return_data, 3, callback_params);
pData->php_executed = 1;
zval_ptr_dtor(&xmlrpc_params);
- return PHP_to_XMLRPC(&pData->return_data TSRMLS_CC);
+ return PHP_to_XMLRPC(&pData->return_data);
}
/* }}} */
@@ -906,15 +905,14 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
zval callback_params[1];
zend_string *php_function_name;
xmlrpc_callback_data* pData = (xmlrpc_callback_data*)data;
- TSRMLS_FETCH();
/* setup data hoojum */
ZVAL_COPY_VALUE(&callback_params[0], &pData->caller_params);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL(pData->server->introspection_map), php_function) {
- if (zend_is_callable(php_function, 0, &php_function_name TSRMLS_CC)) {
+ if (zend_is_callable(php_function, 0, &php_function_name)) {
/* php func prototype: function string user_func($user_params) */
- if (call_user_function(CG(function_table), NULL, php_function, &retval, 1, callback_params TSRMLS_CC) == SUCCESS) {
+ if (call_user_function(CG(function_table), NULL, php_function, &retval, 1, callback_params) == SUCCESS) {
XMLRPC_VALUE xData;
STRUCT_XMLRPC_ERROR err = {0};
@@ -925,25 +923,25 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
if (xData) {
if (!XMLRPC_ServerAddIntrospectionData(server, xData)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Unable to add introspection data returned from %s(), improper element structure", php_function_name->val);
}
XMLRPC_CleanupValue(xData);
} else {
/* could not create description */
if (err.xml_elem_error.parser_code) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()",
+ php_error_docref(NULL, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to add introspection data returned from %s()",
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error, php_function_name->val);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add introspection data returned from %s()", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Unable to add introspection data returned from %s()", php_function_name->val);
}
}
zval_ptr_dtor(&retval);
} else {
/* user func failed */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error calling user introspection callback: %s()", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Error calling user introspection callback: %s()", php_function_name->val);
}
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid callback '%s' passed", php_function_name->val);
+ php_error_docref(NULL, E_WARNING, "Invalid callback '%s' passed", php_function_name->val);
}
zend_string_release(php_function_name);
} ZEND_HASH_FOREACH_END();
@@ -962,7 +960,7 @@ PHP_FUNCTION(xmlrpc_server_register_method)
zval *handle, *method_name;
xmlrpc_server_data* server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz", &handle, &method_key, &method_key_len, &method_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz", &handle, &method_key, &method_key_len, &method_name) == FAILURE) {
return;
}
@@ -992,7 +990,7 @@ PHP_FUNCTION(xmlrpc_server_register_introspection_callback)
zval *method_name, *handle;
xmlrpc_server_data* server;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &handle, &method_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &handle, &method_name) == FAILURE) {
return;
}
@@ -1024,7 +1022,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
php_output_options out;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsz|a", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|a", &handle, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) {
return;
}
/* user output options */
@@ -1063,7 +1061,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
if (xAnswer && out.b_php_out) {
XMLRPC_to_PHP(xAnswer, &data.return_data);
} else if (data.php_executed && !out.b_php_out && !xAnswer) {
- xAnswer = PHP_to_XMLRPC(&data.return_data TSRMLS_CC);
+ xAnswer = PHP_to_XMLRPC(&data.return_data);
}
/* should we return data as xml? */
@@ -1120,13 +1118,13 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data)
xmlrpc_server_data* server;
XMLRPC_VALUE xDesc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &handle, &desc) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &handle, &desc) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(server, xmlrpc_server_data*, handle, -1, "xmlrpc server", le_xmlrpc_server);
- xDesc = PHP_to_XMLRPC(desc TSRMLS_CC);
+ xDesc = PHP_to_XMLRPC(desc);
if (xDesc) {
int retval = XMLRPC_ServerAddIntrospectionData(server->server_ptr, xDesc);
XMLRPC_CleanupValue(xDesc);
@@ -1143,7 +1141,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
char *arg1;
size_t arg1_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1, &arg1_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg1, &arg1_len) == FAILURE) {
return;
}
@@ -1157,13 +1155,13 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
} else {
/* could not create description */
if (err.xml_elem_error.parser_code) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data",
+ php_error_docref(NULL, E_WARNING, "xml parse error: [line %ld, column %ld, message: %s] Unable to create introspection data",
err.xml_elem_error.column, err.xml_elem_error.line, err.xml_elem_error.parser_error);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid xml structure. Unable to create introspection data");
+ php_error_docref(NULL, E_WARNING, "Invalid xml structure. Unable to create introspection data");
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "xml parse error. no method description created");
+ php_error_docref(NULL, E_WARNING, "xml parse error. no method description created");
}
}
}
@@ -1257,7 +1255,6 @@ XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str) /* {{{ */
int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) /* {{{ */
{
int bSuccess = FAILURE;
- TSRMLS_FETCH();
/* we only really care about strings because they can represent
* base64 and datetime. all other types have corresponding php types
@@ -1304,7 +1301,6 @@ int set_zval_xmlrpc_type(zval* value, XMLRPC_VALUE_TYPE newtype) /* {{{ */
XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval* newvalue) /* {{{ */
{
XMLRPC_VALUE_TYPE type = xmlrpc_none;
- TSRMLS_FETCH();
if (value) {
switch (Z_TYPE_P(value)) {
@@ -1378,7 +1374,7 @@ PHP_FUNCTION(xmlrpc_set_type)
size_t type_len;
XMLRPC_VALUE_TYPE vtype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/s", &arg, &type, &type_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/s", &arg, &type, &type_len) == FAILURE) {
return;
}
@@ -1402,7 +1398,7 @@ PHP_FUNCTION(xmlrpc_get_type)
XMLRPC_VALUE_TYPE type;
XMLRPC_VECTOR_TYPE vtype = xmlrpc_vector_none;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
@@ -1421,7 +1417,7 @@ PHP_FUNCTION(xmlrpc_is_fault)
{
zval *arg;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &arg) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &arg) == FAILURE) {
return;
}
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 6e3475e8d0..455116ba22 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -83,14 +83,14 @@ static PHP_FUNCTION(xmlwriter_flush);
static zend_class_entry *xmlwriter_class_entry_ce;
-static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC);
-static void xmlwriter_dtor(zend_resource *rsrc TSRMLS_DC);
+static void xmlwriter_free_resource_ptr(xmlwriter_object *intern);
+static void xmlwriter_dtor(zend_resource *rsrc);
typedef int (*xmlwriter_read_one_char_t)(xmlTextWriterPtr writer, const xmlChar *content);
typedef int (*xmlwriter_read_int_t)(xmlTextWriterPtr writer);
/* {{{ xmlwriter_object_free_storage */
-static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
+static void xmlwriter_free_resource_ptr(xmlwriter_object *intern)
{
if (intern) {
if (intern->ptr) {
@@ -112,7 +112,7 @@ static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
ze_xmlwriter_object *obj = Z_XMLWRITER_P(object); \
intern = obj->xmlwriter_ptr; \
if (!intern) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or unitialized XMLWriter object"); \
+ php_error_docref(NULL, E_WARNING, "Invalid or unitialized XMLWriter object"); \
RETURN_FALSE; \
} \
}
@@ -121,28 +121,28 @@ static void xmlwriter_free_resource_ptr(xmlwriter_object *intern TSRMLS_DC)
static zend_object_handlers xmlwriter_object_handlers;
/* {{{ xmlwriter_object_free_storage */
-static void xmlwriter_object_free_storage(zend_object *object TSRMLS_DC)
+static void xmlwriter_object_free_storage(zend_object *object)
{
ze_xmlwriter_object *intern = php_xmlwriter_fetch_object(object);
if (!intern) {
return;
}
if (intern->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(intern->xmlwriter_ptr);
}
intern->xmlwriter_ptr = NULL;
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
}
/* }}} */
/* {{{ xmlwriter_object_new */
-static zend_object *xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC)
+static zend_object *xmlwriter_object_new(zend_class_entry *class_type)
{
ze_xmlwriter_object *intern;
intern = ecalloc(1, sizeof(ze_xmlwriter_object) + sizeof(zval) * (class_type->default_properties_count - 1));
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
intern->std.handlers = &xmlwriter_object_handlers;
@@ -152,7 +152,7 @@ static zend_object *xmlwriter_object_new(zend_class_entry *class_type TSRMLS_DC)
#define XMLW_NAME_CHK(__err) \
if (xmlValidateName((xmlChar *) name, 0) != 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", __err); \
+ php_error_docref(NULL, E_WARNING, "%s", __err); \
RETURN_FALSE; \
} \
@@ -583,7 +583,7 @@ static int le_xmlwriter;
/* _xmlwriter_get_valid_file_path should be made a
common function in libxml extension as code is common to a few xml extensions */
/* {{{ _xmlwriter_get_valid_file_path */
-static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
+static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len ) {
xmlURI *uri;
xmlChar *escsource;
char *file_dest;
@@ -626,7 +626,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
char file_dirname[MAXPATHLEN];
size_t dir_len;
- if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+ if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path)) {
xmlFreeURI(uri);
return NULL;
}
@@ -674,18 +674,18 @@ ZEND_GET_MODULE(xmlwriter)
#endif
/* {{{ xmlwriter_objects_clone
-static void xmlwriter_objects_clone(void *object, void **object_clone TSRMLS_DC)
+static void xmlwriter_objects_clone(void *object, void **object_clone)
{
TODO
}
}}} */
/* {{{ xmlwriter_dtor */
-static void xmlwriter_dtor(zend_resource *rsrc TSRMLS_DC) {
+static void xmlwriter_dtor(zend_resource *rsrc) {
xmlwriter_object *intern;
intern = (xmlwriter_object *) rsrc->ptr;
- xmlwriter_free_resource_ptr(intern TSRMLS_CC);
+ xmlwriter_free_resource_ptr(intern);
}
/* }}} */
@@ -700,12 +700,12 @@ static void php_xmlwriter_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_rea
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pind, &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pind, &name, &name_len) == FAILURE) {
return;
}
@@ -742,7 +742,7 @@ static void php_xmlwriter_end(INTERNAL_FUNCTION_PARAMETERS, xmlwriter_read_int_t
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -774,12 +774,12 @@ static PHP_FUNCTION(xmlwriter_set_indent)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &indent) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &pind, &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &pind, &indent) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -838,13 +838,13 @@ static PHP_FUNCTION(xmlwriter_start_attribute_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
@@ -880,13 +880,13 @@ static PHP_FUNCTION(xmlwriter_write_attribute)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -923,13 +923,13 @@ static PHP_FUNCTION(xmlwriter_write_attribute_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss!s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss!s",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsss!s", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss!s", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
@@ -973,13 +973,13 @@ static PHP_FUNCTION(xmlwriter_start_element_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len) == FAILURE) {
return;
}
@@ -1031,13 +1031,13 @@ static PHP_FUNCTION(xmlwriter_write_element)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1083,13 +1083,13 @@ static PHP_FUNCTION(xmlwriter_write_element_ns)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss!|s!",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss!|s!",
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs!ss!|s!", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs!ss!|s!", &pind,
&prefix, &prefix_len, &name, &name_len, &uri, &uri_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1152,13 +1152,13 @@ static PHP_FUNCTION(xmlwriter_write_pi)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1193,7 +1193,7 @@ static PHP_FUNCTION(xmlwriter_start_cdata)
if (self) {
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1258,7 +1258,7 @@ static PHP_FUNCTION(xmlwriter_start_comment)
if (self) {
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &pind) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1309,12 +1309,12 @@ static PHP_FUNCTION(xmlwriter_start_document)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!", &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!s!", &pind, &version, &version_len, &enc, &enc_len, &alone, &alone_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1354,13 +1354,13 @@ static PHP_FUNCTION(xmlwriter_start_dtd)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len) == FAILURE) {
return;
}
@@ -1400,13 +1400,13 @@ static PHP_FUNCTION(xmlwriter_write_dtd)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!s!s!", &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|s!s!s!", &pind, &name, &name_len, &pubid, &pubid_len, &sysid, &sysid_len, &subset, &subset_len) == FAILURE) {
return;
}
@@ -1455,12 +1455,12 @@ static PHP_FUNCTION(xmlwriter_write_dtd_element)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &content, &content_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1512,13 +1512,13 @@ static PHP_FUNCTION(xmlwriter_write_dtd_attlist)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss", &pind,
&name, &name_len, &content, &content_len) == FAILURE) {
return;
}
@@ -1553,12 +1553,12 @@ static PHP_FUNCTION(xmlwriter_start_dtd_entity)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sb", &name, &name_len, &isparm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sb", &name, &name_len, &isparm) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsb", &pind, &name, &name_len, &isparm) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsb", &pind, &name, &name_len, &isparm) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(intern, xmlwriter_object *, pind, -1, "XMLWriter", le_xmlwriter);
@@ -1604,14 +1604,14 @@ static PHP_FUNCTION(xmlwriter_write_dtd_entity)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bsss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bsss",
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss|bsss", &pind,
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|bsss", &pind,
&name, &name_len, &content, &content_len, &pe, &pubid, &pubid_len,
&sysid, &sysid_len, &ndataid, &ndataid_len) == FAILURE) {
return;
@@ -1648,7 +1648,7 @@ static PHP_FUNCTION(xmlwriter_open_uri)
zval *self = getThis();
ze_xmlwriter_object *ze_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &source, &source_len) == FAILURE) {
return;
}
@@ -1658,13 +1658,13 @@ static PHP_FUNCTION(xmlwriter_open_uri)
}
if (source_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
- valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
+ valid_file = _xmlwriter_get_valid_file_path(source, resolved_path, MAXPATHLEN);
if (!valid_file) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to resolve file path");
+ php_error_docref(NULL, E_WARNING, "Unable to resolve file path");
RETURN_FALSE;
}
@@ -1679,7 +1679,7 @@ static PHP_FUNCTION(xmlwriter_open_uri)
intern->output = NULL;
if (self) {
if (ze_obj->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr);
}
ze_obj->xmlwriter_ptr = intern;
RETURN_TRUE;
@@ -1707,7 +1707,7 @@ static PHP_FUNCTION(xmlwriter_open_memory)
buffer = xmlBufferCreate();
if (buffer == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create output buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to create output buffer");
RETURN_FALSE;
}
@@ -1722,7 +1722,7 @@ static PHP_FUNCTION(xmlwriter_open_memory)
intern->output = buffer;
if (self) {
if (ze_obj->xmlwriter_ptr) {
- xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr TSRMLS_CC);
+ xmlwriter_free_resource_ptr(ze_obj->xmlwriter_ptr);
}
ze_obj->xmlwriter_ptr = intern;
RETURN_TRUE;
@@ -1744,12 +1744,12 @@ static void php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string)
zval *self = getThis();
if (self) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &empty) == FAILURE) {
return;
}
XMLWRITER_FROM_OBJECT(intern, self);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &pind, &empty) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &pind, &empty) == FAILURE) {
return;
}
@@ -1807,7 +1807,7 @@ static PHP_MINIT_FUNCTION(xmlwriter)
xmlwriter_object_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "XMLWriter", xmlwriter_class_functions);
ce.create_object = xmlwriter_object_new;
- xmlwriter_class_entry_ce = zend_register_internal_class(&ce TSRMLS_CC);
+ xmlwriter_class_entry_ce = zend_register_internal_class(&ce);
return SUCCESS;
}
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 2763d83326..b96a07d1ea 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -72,11 +72,11 @@ ZEND_GET_MODULE(xsl)
#endif
/* {{{ xsl_objects_free_storage */
-void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
+void xsl_objects_free_storage(zend_object *object)
{
xsl_object *intern = php_xsl_fetch_object(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->std);
zend_hash_destroy(intern->parameter);
FREE_HASHTABLE(intern->parameter);
@@ -90,7 +90,7 @@ void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
}
if (intern->doc) {
- php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ php_libxml_decrement_doc_ref(intern->doc);
efree(intern->doc);
}
@@ -110,14 +110,14 @@ void xsl_objects_free_storage(zend_object *object TSRMLS_DC)
/* }}} */
/* {{{ xsl_objects_new */
-zend_object *xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
+zend_object *xsl_objects_new(zend_class_entry *class_type)
{
xsl_object *intern;
intern = ecalloc(1, sizeof(xsl_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->securityPrefs = XSL_SECPREF_DEFAULT;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
ALLOC_HASHTABLE(intern->parameter);
zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
@@ -197,25 +197,25 @@ zval *xsl_object_get_data(void *obj)
/* }}} */
/* {{{ xsl_object_set_data */
-static void xsl_object_set_data(void *obj, zval *wrapper TSRMLS_DC)
+static void xsl_object_set_data(void *obj, zval *wrapper)
{
((xsltStylesheetPtr) obj)->_private = wrapper;
}
/* }}} */
/* {{{ php_xsl_set_object */
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC)
+void php_xsl_set_object(zval *wrapper, void *obj)
{
xsl_object *object;
object = Z_XSL_P(wrapper);
object->ptr = obj;
- xsl_object_set_data(obj, wrapper TSRMLS_CC);
+ xsl_object_set_data(obj, wrapper);
}
/* }}} */
/* {{{ php_xsl_create_object */
-void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value TSRMLS_DC)
+void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value )
{
zval *wrapper;
zend_class_entry *ce;
@@ -243,7 +243,7 @@ void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return
if (!wrapper_in) {
object_init_ex(wrapper, ce);
}
- php_xsl_set_object(wrapper, (void *) obj TSRMLS_CC);
+ php_xsl_set_object(wrapper, (void *) obj);
return;
}
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index b6603321a3..c1fce674fd 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -75,9 +75,9 @@ static inline xsl_object *php_xsl_fetch_object(zend_object *obj) {
#define Z_XSL_P(zv) php_xsl_fetch_object(Z_OBJ_P((zv)))
-void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
-void xsl_objects_free_storage(zend_object *object TSRMLS_DC);
-void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value TSRMLS_DC);
+void php_xsl_set_object(zval *wrapper, void *obj);
+void xsl_objects_free_storage(zend_object *object);
+void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value );
void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
@@ -85,12 +85,12 @@ void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
#define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
ce.create_object = xsl_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce TSRMLS_CC);
+entry = zend_register_internal_class_ex(&ce, parent_ce);
#define XSL_DOMOBJ_NEW(zval, obj, ret) \
- zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC); \
+ zval = php_xsl_create_object(obj, ret, zval, return_value); \
if (ZVAL_IS_NULL(zval)) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
+ php_error_docref(NULL, E_WARNING, "Cannot create required DOM object"); \
RETURN_FALSE; \
}
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 20af855aa4..487585892e 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -105,7 +105,7 @@ const zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
/* {{{ php_xsl_xslt_string_to_xpathexpr()
Translates a string to a XPath Expression */
-static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
+static char *php_xsl_xslt_string_to_xpathexpr(const char *str)
{
const xmlChar *string = (const xmlChar *)str;
@@ -116,7 +116,7 @@ static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
if (xmlStrchr(string, '"')) {
if (xmlStrchr(string, '\'')) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
+ php_error_docref(NULL, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
return NULL;
}
value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
@@ -131,7 +131,7 @@ static char *php_xsl_xslt_string_to_xpathexpr(const char *str TSRMLS_DC)
/* {{{ php_xsl_xslt_make_params()
Translates a PHP array to a libxslt parameters array */
-static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS_DC)
+static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params)
{
int parsize;
@@ -148,7 +148,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
ZEND_HASH_FOREACH_KEY_VAL(parht, num_key, string_key, value) {
if (string_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array");
+ php_error_docref(NULL, E_WARNING, "Invalid argument or parameter array");
efree(params);
return NULL;
} else {
@@ -158,7 +158,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
}
if (!xpath_params) {
- xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value) TSRMLS_CC);
+ xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value));
} else {
xpath_expr = estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value));
}
@@ -189,9 +189,8 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
xsl_object *intern;
zend_string *callable = NULL;
- TSRMLS_FETCH();
- if (! zend_is_executing(TSRMLS_C)) {
+ if (! zend_is_executing()) {
xsltGenericError(xsltGenericErrorContext,
"xsltExtFunctionTest: Function called from outside of PHP\n");
error = 1;
@@ -276,7 +275,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
node = xmlDocCopyNodeList(domintern->document->ptr, node);
}
- php_dom_create_object(node, &child, domintern TSRMLS_CC);
+ php_dom_create_object(node, &child, domintern);
add_next_index_zval(&args[i], &child);
}
}
@@ -301,7 +300,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a string");
+ php_error_docref(NULL, E_WARNING, "Handler name must be a string");
xmlXPathFreeObject(obj);
valuePush(ctxt, xmlXPathNewString(""));
if (fci.param_count > 0) {
@@ -321,24 +320,24 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
fci.retval = &retval;
fci.no_separation = 0;
/*fci.function_handler_cache = &function_ptr;*/
- if (!zend_make_callable(&handler, &callable TSRMLS_CC)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable->val);
+ if (!zend_make_callable(&handler, &callable)) {
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", callable->val);
valuePush(ctxt, xmlXPathNewString(""));
} else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'", callable->val);
+ php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'", callable->val);
/* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString(""));
} else {
- result = zend_call_function(&fci, NULL TSRMLS_CC);
+ result = zend_call_function(&fci, NULL);
if (result == FAILURE) {
if (Z_TYPE(handler) == IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL(handler));
+ php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", Z_STRVAL(handler));
valuePush(ctxt, xmlXPathNewString(""));
}
/* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
} else if (Z_ISUNDEF(retval)) {
} else {
- if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry TSRMLS_CC)) {
+ if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry)) {
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
@@ -353,7 +352,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
} else if (Z_TYPE(retval) == IS_TRUE || Z_TYPE(retval) == IS_FALSE) {
valuePush(ctxt, xmlXPathNewBoolean(Z_LVAL(retval)));
} else if (Z_TYPE(retval) == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
+ php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString(""));
} else {
convert_to_string_ex(&retval);
@@ -400,11 +399,11 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
zend_object_handlers *std_hnd;
zval *cloneDocu, member, rv;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
RETURN_FALSE;
}
- nodep = php_libxml_import_node(docp TSRMLS_CC);
+ nodep = php_libxml_import_node(docp);
if (nodep) {
doc = nodep->doc;
@@ -435,7 +434,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
std_hnd = zend_get_std_object_handlers();
ZVAL_STRING(&member, "cloneDocument");
- cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
+ cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
convert_to_long(cloneDocu);
clone_docu = Z_LVAL_P(cloneDocu);
@@ -466,12 +465,12 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
intern->ptr = NULL;
}
- php_xsl_set_object(id, sheetp TSRMLS_CC);
+ php_xsl_set_object(id, sheetp);
RETVAL_TRUE;
}
/* }}} end xsl_xsltprocessor_import_stylesheet */
-static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */
+static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp) /* {{{ */
{
xmlDocPtr newdocp = NULL;
xmlDocPtr doc = NULL;
@@ -487,23 +486,23 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
int secPrefsValue, secPrefsIni;
xsltSecurityPrefsPtr secPrefs = NULL;
- node = php_libxml_import_node(docp TSRMLS_CC);
+ node = php_libxml_import_node(docp);
if (node) {
doc = node->doc;
}
if (doc == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Document");
+ php_error_docref(NULL, E_WARNING, "Invalid Document");
return NULL;
}
if (style == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stylesheet associated to this object");
+ php_error_docref(NULL, E_WARNING, "No stylesheet associated to this object");
return NULL;
}
if (intern->profiling) {
- if (php_check_open_basedir(intern->profiling TSRMLS_CC)) {
+ if (php_check_open_basedir(intern->profiling)) {
f = NULL;
} else {
f = VCWD_FOPEN(intern->profiling, "w");
@@ -513,7 +512,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
}
if (intern->parameter) {
- params = php_xsl_xslt_make_params(intern->parameter, 0 TSRMLS_CC);
+ params = php_xsl_xslt_make_params(intern->parameter, 0);
}
intern->doc = emalloc(sizeof(php_libxml_node_object));
@@ -526,7 +525,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
intern->doc->document = object->document;
}
- php_libxml_increment_doc_ref(intern->doc, doc TSRMLS_CC);
+ php_libxml_increment_doc_ref(intern->doc, doc);
ctxt = xsltNewTransformContext(style, doc);
ctxt->_private = (void *) intern;
@@ -534,7 +533,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
std_hnd = zend_get_std_object_handlers();
ZVAL_STRING(&member, "doXInclude");
- doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
+ doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
if (Z_TYPE_P(doXInclude) != IS_NULL) {
convert_to_long(doXInclude);
ctxt->xinclude = Z_LVAL_P(doXInclude);
@@ -549,13 +548,13 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
if (secPrefsIni != secPrefsValue) {
if (secPrefsIni != XSL_SECPREF_DEFAULT) {
/* if the ini value is not set to the default, throw an E_DEPRECATED warning */
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The xsl.security_prefs php.ini option is deprecated; use XsltProcessor->setSecurityPrefs() instead");
+ php_error_docref(NULL, E_DEPRECATED, "The xsl.security_prefs php.ini option is deprecated; use XsltProcessor->setSecurityPrefs() instead");
if (intern->securityPrefsSet == 0) {
/* if securityPrefs were not set through the setSecurityPrefs method, take the ini setting */
secPrefsValue = secPrefsIni;
} else {
/* else throw a notice, that the ini setting was not used */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The xsl.security_prefs php.ini was not used, since the XsltProcessor->setSecurityPrefs() method was used");
+ php_error_docref(NULL, E_NOTICE, "The xsl.security_prefs php.ini was not used, since the XsltProcessor->setSecurityPrefs() method was used");
}
}
}
@@ -595,7 +594,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
}
if (secPrefsError == 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't set libxslt security properties, not doing transformation for security reasons");
+ php_error_docref(NULL, E_WARNING, "Can't set libxslt security properties, not doing transformation for security reasons");
} else {
newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params, NULL, f, ctxt);
}
@@ -614,7 +613,7 @@ static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStyl
intern->node_list = NULL;
}
- php_libxml_decrement_doc_ref(intern->doc TSRMLS_CC);
+ php_libxml_decrement_doc_ref(intern->doc);
efree(intern->doc);
intern->doc = NULL;
@@ -647,11 +646,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|S!", &docp, &ret_class) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|S!", &docp, &ret_class) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
if (newdocp) {
if (ret_class) {
@@ -665,10 +664,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
curce = curce->parent;
}
- ce = zend_lookup_class(ret_class TSRMLS_CC);
- if (ce == NULL || !instanceof_function(ce, curce TSRMLS_CC)) {
+ ce = zend_lookup_class(ret_class);
+ if (ce == NULL || !instanceof_function(ce, curce)) {
xmlFreeDoc(newdocp);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"Expecting class compatible with %s, '%s' given", curclass_name->val, ret_class->val);
RETURN_FALSE;
}
@@ -676,10 +675,10 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
object_init_ex(return_value, ce);
interndoc = Z_LIBXML_NODE_P(return_value);
- php_libxml_increment_doc_ref(interndoc, newdocp TSRMLS_CC);
- php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc TSRMLS_CC);
+ php_libxml_increment_doc_ref(interndoc, newdocp);
+ php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc);
} else {
- php_dom_create_object((xmlNodePtr) newdocp, return_value, NULL TSRMLS_CC);
+ php_dom_create_object((xmlNodePtr) newdocp, return_value, NULL);
}
} else {
RETURN_FALSE;
@@ -704,11 +703,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "op", &docp, &uri, &uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "op", &docp, &uri, &uri_len) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
ret = -1;
if (newdocp) {
@@ -736,11 +735,11 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &docp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &docp) == FAILURE) {
RETURN_FALSE;
}
- newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp TSRMLS_CC);
+ newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
ret = -1;
if (newdocp) {
@@ -772,11 +771,11 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
zend_string *string_key, *name, *value;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
intern = Z_XSL_P(id);
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array_value), idx, string_key, entry) {
if (string_key == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter array");
+ php_error_docref(NULL, E_WARNING, "Invalid parameter array");
RETURN_FALSE;
}
SEPARATE_ZVAL(entry);
@@ -787,7 +786,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
zend_hash_update(intern->parameter, string_key, entry);
} ZEND_HASH_FOREACH_END();
RETURN_TRUE;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sSS", &namespace, &namespace_len, &name, &value) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sSS", &namespace, &namespace_len, &name, &value) == SUCCESS) {
intern = Z_XSL_P(id);
@@ -815,7 +814,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &namespace, &namespace_len, &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
RETURN_FALSE;
}
intern = Z_XSL_P(id);
@@ -840,7 +839,7 @@ PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &namespace, &namespace_len, &name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
RETURN_FALSE;
}
intern = Z_XSL_P(id);
@@ -863,7 +862,7 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "a", &array_value) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a", &array_value) == SUCCESS) {
intern = Z_XSL_P(id);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {
@@ -874,7 +873,7 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
} ZEND_HASH_FOREACH_END();
intern->registerPhpFunctions = 2;
- } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == SUCCESS) {
+ } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S", &name) == SUCCESS) {
intern = Z_XSL_P(id);
ZVAL_LONG(&new_string,1);
@@ -898,7 +897,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
size_t filename_len;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p!", &filename, &filename_len) == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p!", &filename, &filename_len) == SUCCESS) {
intern = Z_XSL_P(id);
if (intern->profiling) {
efree(intern->profiling);
@@ -923,7 +922,7 @@ PHP_FUNCTION(xsl_xsltprocessor_set_security_prefs)
zend_long securityPrefs, oldSecurityPrefs;
DOM_GET_THIS(id);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &securityPrefs) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &securityPrefs) == FAILURE) {
return;
}
intern = Z_XSL_P(id);
@@ -942,7 +941,7 @@ PHP_FUNCTION(xsl_xsltprocessor_get_security_prefs)
xsl_object *intern;
DOM_GET_THIS(id);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "") == SUCCESS) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "") == SUCCESS) {
intern = Z_XSL_P(id);
RETURN_LONG(intern->securityPrefs);
} else {
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index b50e240656..0b1fffbacd 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -68,7 +68,7 @@ static int le_zip_entry;
/* {{{ PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) */
#define PHP_ZIP_STAT_PATH(za, path, path_len, flags, sb) \
if (path_len < 1) { \
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name"); \
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name"); \
RETURN_FALSE; \
} \
if (zip_stat(za, path, flags, &sb) != 0) { \
@@ -133,7 +133,7 @@ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */
# define CWD_STATE_FREE(s) efree(s)
/* {{{ php_zip_extract_file */
-static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len TSRMLS_DC)
+static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len)
{
php_stream_statbuf ssb;
struct zip_file *zf;
@@ -158,7 +158,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
/* Clean/normlize the path and then transform any path (absolute or relative)
to a path relative to cwd (../../mydir/foo.txt > mydir/foo.txt)
*/
- virtual_file_ex(&new_state, file, NULL, CWD_EXPAND TSRMLS_CC);
+ virtual_file_ex(&new_state, file, NULL, CWD_EXPAND);
path_cleaned = php_zip_make_relative_path(new_state.cwd, new_state.cwd_length);
if(!path_cleaned) {
return 0;
@@ -183,7 +183,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname);
}
- file_basename = php_basename(path_cleaned, path_cleaned_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename(path_cleaned, path_cleaned_len, NULL, 0);
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) {
efree(file_dirname_fullpath);
@@ -220,7 +220,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
CWD_STATE_FREE(new_state.cwd);
return 0;
} else if (len > MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Full extraction path exceed MAXPATHLEN (%i)", MAXPATHLEN);
efree(file_dirname_fullpath);
zend_string_release(file_basename);
CWD_STATE_FREE(new_state.cwd);
@@ -277,7 +277,7 @@ done:
/* }}} */
static int php_zip_add_file(struct zip *za, const char *filename, size_t filename_len,
- char *entry_name, size_t entry_name_len, long offset_start, long offset_len TSRMLS_DC) /* {{{ */
+ char *entry_name, size_t entry_name_len, long offset_start, long offset_len) /* {{{ */
{
struct zip_source *zs;
char resolved_path[MAXPATHLEN];
@@ -288,11 +288,11 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
return -1;
}
- if (!expand_filepath(filename, resolved_path TSRMLS_CC)) {
+ if (!expand_filepath(filename, resolved_path)) {
return -1;
}
- php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag TSRMLS_CC);
+ php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag);
if (Z_TYPE(exists_flag) == IS_FALSE) {
return -1;
}
@@ -311,7 +311,7 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam
}
/* }}} */
-static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len TSRMLS_DC) /* {{{ */
+static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len) /* {{{ */
{
zval *option;
if ((option = zend_hash_str_find(HASH_OF(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
@@ -330,17 +330,17 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
/* If I add more options, it would make sense to create a nice static struct and loop over it. */
if ((option = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path option expected to be a string");
+ php_error_docref(NULL, E_WARNING, "remove_path option expected to be a string");
return -1;
}
if (Z_STRLEN_P(option) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as remove_path option");
+ php_error_docref(NULL, E_NOTICE, "Empty string given as remove_path option");
return -1;
}
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "remove_path string is too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "remove_path string is too long (max: %i, %i given)",
MAXPATHLEN - 1, Z_STRLEN_P(option));
return -1;
}
@@ -350,17 +350,17 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
if ((option = zend_hash_str_find(HASH_OF(options), "add_path", sizeof("add_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_STRING) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path option expected to be a string");
+ php_error_docref(NULL, E_WARNING, "add_path option expected to be a string");
return -1;
}
if (Z_STRLEN_P(option) < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string given as the add_path option");
+ php_error_docref(NULL, E_NOTICE, "Empty string given as the add_path option");
return -1;
}
if (Z_STRLEN_P(option) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path string too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "add_path string too long (max: %i, %i given)",
MAXPATHLEN - 1, Z_STRLEN_P(option));
return -1;
}
@@ -373,7 +373,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */
#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \
- zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
+ zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (zend_long)value);
/* }}} */
/* {{{ ZIP_FROM_OBJECT */
@@ -382,7 +382,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
ze_zip_object *obj = Z_ZIP_P(object); \
intern = obj->za; \
if (!intern) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid or uninitialized Zip object"); \
+ php_error_docref(NULL, E_WARNING, "Invalid or uninitialized Zip object"); \
RETURN_FALSE; \
} \
}
@@ -402,7 +402,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
}
/* }}} */
-static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_status(struct zip *za) /* {{{ */
{
int zep, syp;
@@ -411,7 +411,7 @@ static int php_zip_status(struct zip *za TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_status_sys(struct zip *za) /* {{{ */
{
int zep, syp;
@@ -420,13 +420,13 @@ static int php_zip_status_sys(struct zip *za TSRMLS_DC) /* {{{ */
}
/* }}} */
-static int php_zip_get_num_files(struct zip *za TSRMLS_DC) /* {{{ */
+static int php_zip_get_num_files(struct zip *za) /* {{{ */
{
return zip_get_num_files(za);
}
/* }}} */
-static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */
+static char * php_zipobj_get_filename(ze_zip_object *obj) /* {{{ */
{
if (!obj) {
@@ -440,7 +440,7 @@ static char * php_zipobj_get_filename(ze_zip_object *obj TSRMLS_DC) /* {{{ */
}
/* }}} */
-static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /* {{{ */
+static char * php_zipobj_get_zip_comment(struct zip *za, int *len) /* {{{ */
{
if (za) {
return (char *)zip_get_archive_comment(za, len, 0);
@@ -481,7 +481,7 @@ static char * php_zipobj_get_zip_comment(struct zip *za, int *len TSRMLS_DC) /*
#endif /* }}} */
-int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value TSRMLS_DC) /* {{{ */
+int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value) /* {{{ */
{
#ifdef HAVE_GLOB
char cwd[MAXPATHLEN];
@@ -495,12 +495,12 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
int ret;
if (pattern_len >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
return -1;
}
if ((GLOB_AVAILABLE_FLAGS & flags) != flags) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
+ php_error_docref(NULL, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform");
return -1;
}
@@ -581,13 +581,13 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
globfree(&globbuf);
return globbuf.gl_pathc;
#else
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available");
+ php_error_docref(NULL, E_ERROR, "Glob support is not available");
return 0;
#endif /* HAVE_GLOB */
}
/* }}} */
-int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_value TSRMLS_DC) /* {{{ */
+int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_value) /* {{{ */
{
#ifdef ZTS
char cwd[MAXPATHLEN];
@@ -627,9 +627,9 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
pcre_extra *pcre_extra = NULL;
int preg_options = 0, i;
- re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options TSRMLS_CC);
+ re = pcre_get_compiled_regex(regexp, &pcre_extra, &preg_options);
if (!re) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid expression");
+ php_error_docref(NULL, E_WARNING, "Invalid expression");
return -1;
}
@@ -650,7 +650,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
}
if ((path_len + namelist_len + 1) >= MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "add_path string too long (max: %i, %i given)",
+ php_error_docref(NULL, E_WARNING, "add_path string too long (max: %i, %i given)",
MAXPATHLEN - 1, (path_len + namelist_len + 1));
zend_string_release(namelist[i]);
break;
@@ -659,7 +659,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
snprintf(fullpath, MAXPATHLEN, "%s%c%s", path, DEFAULT_SLASH, namelist[i]->val);
if (0 != VCWD_STAT(fullpath, &s)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot read <%s>", fullpath);
+ php_error_docref(NULL, E_WARNING, "Cannot read <%s>", fullpath);
zend_string_release(namelist[i]);
continue;
}
@@ -756,9 +756,9 @@ static zend_object_handlers zip_object_handlers;
static HashTable zip_prop_handlers;
-typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC);
-typedef char *(*zip_read_const_char_t)(struct zip *za, int *len TSRMLS_DC);
-typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC);
+typedef int (*zip_read_int_t)(struct zip *za);
+typedef char *(*zip_read_const_char_t)(struct zip *za, int *len);
+typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj);
typedef struct _zip_prop_handler {
zip_read_int_t read_int_func;
@@ -769,7 +769,7 @@ typedef struct _zip_prop_handler {
} zip_prop_handler;
/* }}} */
-static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype TSRMLS_DC) /* {{{ */
+static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, zip_read_int_t read_int_func, zip_read_const_char_t read_char_func, zip_read_const_char_from_ze_t read_char_from_obj_func, int rettype) /* {{{ */
{
zip_prop_handler hnd;
@@ -781,7 +781,7 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z
}
/* }}} */
-static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval *rv TSRMLS_DC) /* {{{ */
+static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd, zval *rv) /* {{{ */
{
const char *retchar = NULL;
int retint = 0;
@@ -789,17 +789,17 @@ static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd,
if (obj && obj->za != NULL) {
if (hnd->read_const_char_func) {
- retchar = hnd->read_const_char_func(obj->za, &len TSRMLS_CC);
+ retchar = hnd->read_const_char_func(obj->za, &len);
} else {
if (hnd->read_int_func) {
- retint = hnd->read_int_func(obj->za TSRMLS_CC);
+ retint = hnd->read_int_func(obj->za);
if (retint == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal zip error returned");
+ php_error_docref(NULL, E_WARNING, "Internal zip error returned");
return NULL;
}
} else {
if (hnd->read_const_char_from_obj_func) {
- retchar = hnd->read_const_char_from_obj_func(obj TSRMLS_CC);
+ retchar = hnd->read_const_char_from_obj_func(obj);
len = strlen(retchar);
}
}
@@ -829,7 +829,7 @@ static zval *php_zip_property_reader(ze_zip_object *obj, zip_prop_handler *hnd,
}
/* }}} */
-static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -852,7 +852,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
if (hnd == NULL) {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -863,7 +863,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
}
/* }}} */
-static zval *php_zip_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */
+static zval *php_zip_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -885,13 +885,13 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
}
if (hnd != NULL) {
- retval = php_zip_property_reader(obj, hnd, rv TSRMLS_CC);
+ retval = php_zip_property_reader(obj, hnd, rv);
if (retval == NULL) {
retval = &EG(uninitialized_zval);
}
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv TSRMLS_CC);
+ retval = std_hnd->read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -902,7 +902,7 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
}
/* }}} */
-static int php_zip_has_property(zval *object, zval *member, int type, void **cache_slot TSRMLS_DC) /* {{{ */
+static int php_zip_has_property(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
ze_zip_object *obj;
zval tmp_member;
@@ -928,9 +928,9 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
if (type == 2) {
retval = 1;
- } else if ((prop = php_zip_property_reader(obj, hnd, &tmp TSRMLS_CC)) != NULL) {
+ } else if ((prop = php_zip_property_reader(obj, hnd, &tmp)) != NULL) {
if (type == 1) {
- retval = zend_is_true(&tmp TSRMLS_CC);
+ retval = zend_is_true(&tmp);
} else if (type == 0) {
retval = (Z_TYPE(tmp) != IS_NULL);
}
@@ -939,7 +939,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
zval_ptr_dtor(&tmp);
} else {
std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->has_property(object, member, type, cache_slot TSRMLS_CC);
+ retval = std_hnd->has_property(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -950,7 +950,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
}
/* }}} */
-static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
+static HashTable *php_zip_get_properties(zval *object)/* {{{ */
{
ze_zip_object *obj;
HashTable *props;
@@ -959,7 +959,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
zend_ulong num_key;
obj = Z_ZIP_P(object);
- props = zend_std_get_properties(object TSRMLS_CC);
+ props = zend_std_get_properties(object);
if (obj->prop_handler == NULL) {
return NULL;
@@ -967,7 +967,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
ZEND_HASH_FOREACH_KEY_PTR(obj->prop_handler, num_key, key, hnd) {
zval *ret, val;
- ret = php_zip_property_reader(obj, hnd, &val TSRMLS_CC);
+ ret = php_zip_property_reader(obj, hnd, &val);
if (ret == NULL) {
ret = &EG(uninitialized_zval);
}
@@ -978,7 +978,7 @@ static HashTable *php_zip_get_properties(zval *object TSRMLS_DC)/* {{{ */
}
/* }}} */
-static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
+static void php_zip_object_free_storage(zend_object *object) /* {{{ */
{
ze_zip_object * intern = php_zip_fetch_object(object);
int i;
@@ -988,7 +988,7 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
if (intern->za) {
if (zip_close(intern->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot destroy the zip context");
+ php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context");
return;
}
intern->za = NULL;
@@ -1002,7 +1002,7 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
intern->za = NULL;
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ zend_object_std_dtor(&intern->zo);
if (intern->filename) {
efree(intern->filename);
@@ -1010,13 +1010,13 @@ static void php_zip_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
}
/* }}} */
-static zend_object *php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
+static zend_object *php_zip_object_new(zend_class_entry *class_type) /* {{{ */
{
ze_zip_object *intern;
intern = ecalloc(1, sizeof(ze_zip_object) + sizeof(zval) * (class_type->default_properties_count - 1));
intern->prop_handler = &zip_prop_handlers;
- zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+ zend_object_std_init(&intern->zo, class_type);
object_properties_init(&intern->zo, class_type);
intern->zo.handlers = &zip_object_handlers;
@@ -1027,14 +1027,14 @@ static zend_object *php_zip_object_new(zend_class_entry *class_type TSRMLS_DC) /
/* {{{ Resource dtors */
/* {{{ php_zip_free_dir */
-static void php_zip_free_dir(zend_resource *rsrc TSRMLS_DC)
+static void php_zip_free_dir(zend_resource *rsrc)
{
zip_rsrc * zip_int = (zip_rsrc *) rsrc->ptr;
if (zip_int) {
if (zip_int->za) {
if (zip_close(zip_int->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot destroy the zip context");
+ php_error_docref(NULL, E_WARNING, "Cannot destroy the zip context");
}
zip_int->za = NULL;
}
@@ -1047,7 +1047,7 @@ static void php_zip_free_dir(zend_resource *rsrc TSRMLS_DC)
/* }}} */
/* {{{ php_zip_free_entry */
-static void php_zip_free_entry(zend_resource *rsrc TSRMLS_DC)
+static void php_zip_free_entry(zend_resource *rsrc)
{
zip_read_rsrc *zr_rsrc = (zip_read_rsrc *) rsrc->ptr;
@@ -1102,12 +1102,12 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
int err = 0;
zend_string *filename;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P", &filename) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &filename) == FAILURE) {
return;
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
@@ -1115,7 +1115,7 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
RETURN_FALSE;
}
- if(!expand_filepath(filename->val, resolved_path TSRMLS_CC)) {
+ if(!expand_filepath(filename->val, resolved_path)) {
RETURN_FALSE;
}
@@ -1141,7 +1141,7 @@ static PHP_NAMED_FUNCTION(zif_zip_close)
zval * zip;
zip_rsrc *z_rsrc = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(z_rsrc, zip_rsrc *, zip, -1, le_zip_dir_name, le_zip_dir);
@@ -1160,7 +1160,7 @@ static PHP_NAMED_FUNCTION(zif_zip_read)
int ret;
zip_rsrc *rsrc_int;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_dp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_dp) == FAILURE) {
return;
}
@@ -1207,7 +1207,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
zip_read_rsrc * zr_rsrc;
zip_rsrc *z_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr|s", &zip, &zip_entry, &mode, &mode_len) == FAILURE) {
return;
}
@@ -1229,7 +1229,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close)
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_entry) == FAILURE) {
return;
}
@@ -1249,7 +1249,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)
zend_string *buffer;
int n = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zip_entry, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &zip_entry, &len) == FAILURE) {
return;
}
@@ -1281,7 +1281,7 @@ static void php_zip_entry_get_info(INTERNAL_FUNCTION_PARAMETERS, int opt) /* {{{
zval * zip_entry;
zip_read_rsrc * zr_rsrc;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zip_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zip_entry) == FAILURE) {
return;
}
@@ -1384,7 +1384,7 @@ static ZIPARCHIVE_METHOD(open)
zval *self = getThis();
ze_zip_object *ze_obj = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &filename, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &filename, &flags) == FAILURE) {
return;
}
@@ -1394,7 +1394,7 @@ static ZIPARCHIVE_METHOD(open)
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
RETURN_FALSE;
}
@@ -1402,14 +1402,14 @@ static ZIPARCHIVE_METHOD(open)
RETURN_FALSE;
}
- if (!(resolved_path = expand_filepath(filename->val, NULL TSRMLS_CC))) {
+ if (!(resolved_path = expand_filepath(filename->val, NULL))) {
RETURN_FALSE;
}
if (ze_obj->za) {
/* we already have an opened zip, free it */
if (zip_close(ze_obj->za) != 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string as source");
+ php_error_docref(NULL, E_WARNING, "Empty string as source");
efree(resolved_path);
RETURN_FALSE;
}
@@ -1447,7 +1447,7 @@ static ZIPARCHIVE_METHOD(setPassword)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &password, &password_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &password, &password_len) == FAILURE) {
return;
}
@@ -1533,7 +1533,7 @@ static ZIPARCHIVE_METHOD(addEmptyDir)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s",
&dirname, &dirname_len) == FAILURE) {
return;
}
@@ -1589,23 +1589,23 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
ZIP_FROM_OBJECT(intern, self);
/* 1 == glob, 2 == pcre */
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|la",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|la",
&pattern, &flags, &options) == FAILURE) {
return;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|sa",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|sa",
&pattern, &path, &path_len, &options) == FAILURE) {
return;
}
}
if (pattern->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as pattern");
+ php_error_docref(NULL, E_NOTICE, "Empty string as pattern");
RETURN_FALSE;
}
if (options && (php_zip_parse_options(options, &remove_all_path, &remove_path, &remove_path_len,
- &add_path, &add_path_len TSRMLS_CC) < 0)) {
+ &add_path, &add_path_len) < 0)) {
RETURN_FALSE;
}
@@ -1617,9 +1617,9 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
}
if (type == 1) {
- found = php_zip_glob(pattern->val, pattern->len, flags, return_value TSRMLS_CC);
+ found = php_zip_glob(pattern->val, pattern->len, flags, return_value);
} else {
- found = php_zip_pcre(pattern, path, path_len, return_value TSRMLS_CC);
+ found = php_zip_pcre(pattern, path, path_len, return_value);
}
if (found > 0) {
@@ -1634,7 +1634,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
if ((zval_file = zend_hash_index_find(Z_ARRVAL_P(return_value), i)) != NULL) {
if (remove_all_path) {
- basename = php_basename(Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), NULL, 0 TSRMLS_CC);
+ basename = php_basename(Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), NULL, 0);
file_stripped = basename->val;
file_stripped_len = basename->len;
} else if (remove_path && strstr(Z_STRVAL_P(zval_file), remove_path) != NULL) {
@@ -1647,7 +1647,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
if (add_path) {
if ((add_path_len + file_stripped_len) > MAXPATHLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %d, %pd given)",
+ php_error_docref(NULL, E_WARNING, "Entry name too long (max: %d, %pd given)",
MAXPATHLEN - 1, (add_path_len + file_stripped_len));
zval_ptr_dtor(return_value);
RETURN_FALSE;
@@ -1665,7 +1665,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
basename = NULL;
}
if (php_zip_add_file(intern, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file),
- entry_name, entry_name_len, 0, 0 TSRMLS_CC) < 0) {
+ entry_name, entry_name_len, 0, 0) < 0) {
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1708,13 +1708,13 @@ static ZIPARCHIVE_METHOD(addFile)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|sll",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|sll",
&filename, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
return;
}
if (filename->len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as filename");
+ php_error_docref(NULL, E_NOTICE, "Empty string as filename");
RETURN_FALSE;
}
@@ -1723,7 +1723,7 @@ static ZIPARCHIVE_METHOD(addFile)
entry_name_len = filename->len;
}
- if (php_zip_add_file(intern, filename->val, filename->len, entry_name, entry_name_len, 0, 0 TSRMLS_CC) < 0) {
+ if (php_zip_add_file(intern, filename->val, filename->len, entry_name, entry_name_len, 0, 0) < 0) {
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -1751,7 +1751,7 @@ static ZIPARCHIVE_METHOD(addFromString)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS",
&name, &name_len, &buffer) == FAILURE) {
return;
}
@@ -1809,7 +1809,7 @@ static ZIPARCHIVE_METHOD(statName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &name, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &name, &flags) == FAILURE) {
return;
}
@@ -1835,7 +1835,7 @@ static ZIPARCHIVE_METHOD(statIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -1863,7 +1863,7 @@ static ZIPARCHIVE_METHOD(locateName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|l", &name, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &name, &flags) == FAILURE) {
return;
}
@@ -1896,7 +1896,7 @@ static ZIPARCHIVE_METHOD(getNameIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -1926,7 +1926,7 @@ static ZIPARCHIVE_METHOD(setArchiveComment)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &comment, &comment_len) == FAILURE) {
return;
}
if (zip_set_archive_comment(intern, (const char *)comment, (int)comment_len)) {
@@ -1953,7 +1953,7 @@ static ZIPARCHIVE_METHOD(getArchiveComment)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) {
return;
}
@@ -1981,13 +1981,13 @@ static ZIPARCHIVE_METHOD(setCommentName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss",
&name, &name_len, &comment, &comment_len) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2015,7 +2015,7 @@ static ZIPARCHIVE_METHOD(setCommentIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls",
&index, &comment, &comment_len) == FAILURE) {
return;
}
@@ -2045,13 +2045,13 @@ static ZIPARCHIVE_METHOD(setExternalAttributesName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sll|l",
&name, &name_len, &opsys, &attr, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2081,7 +2081,7 @@ static ZIPARCHIVE_METHOD(setExternalAttributesIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll|l",
&index, &opsys, &attr, &flags) == FAILURE) {
return;
}
@@ -2114,13 +2114,13 @@ static ZIPARCHIVE_METHOD(getExternalAttributesName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/z/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/z/|l",
&name, &name_len, &z_opsys, &z_attr, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
}
idx = zip_name_locate(intern, name, 0);
@@ -2156,7 +2156,7 @@ static ZIPARCHIVE_METHOD(getExternalAttributesIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/z/|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz/z/|l",
&index, &z_opsys, &z_attr, &flags) == FAILURE) {
return;
}
@@ -2194,12 +2194,12 @@ static ZIPARCHIVE_METHOD(getCommentName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l",
&name, &name_len, &flags) == FAILURE) {
return;
}
if (name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as entry name");
RETURN_FALSE;
}
@@ -2230,7 +2230,7 @@ static ZIPARCHIVE_METHOD(getCommentIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l",
&index, &flags) == FAILURE) {
return;
}
@@ -2255,7 +2255,7 @@ static ZIPARCHIVE_METHOD(deleteIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}
@@ -2287,7 +2287,7 @@ static ZIPARCHIVE_METHOD(deleteName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
if (name_len < 1) {
@@ -2319,7 +2319,7 @@ static ZIPARCHIVE_METHOD(renameIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &index, &new_name, &new_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &index, &new_name, &new_name_len) == FAILURE) {
return;
}
@@ -2328,7 +2328,7 @@ static ZIPARCHIVE_METHOD(renameIndex)
}
if (new_name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as new entry name");
RETURN_FALSE;
}
if (zip_rename(intern, index, (const char *)new_name) != 0) {
@@ -2354,12 +2354,12 @@ static ZIPARCHIVE_METHOD(renameName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
return;
}
if (new_name_len < 1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name");
+ php_error_docref(NULL, E_NOTICE, "Empty string as new entry name");
RETURN_FALSE;
}
@@ -2386,7 +2386,7 @@ static ZIPARCHIVE_METHOD(unchangeIndex)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}
@@ -2418,7 +2418,7 @@ static ZIPARCHIVE_METHOD(unchangeName)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@@ -2503,7 +2503,7 @@ static ZIPARCHIVE_METHOD(extractTo)
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
return;
}
@@ -2522,7 +2522,7 @@ static ZIPARCHIVE_METHOD(extractTo)
if (zval_files && (Z_TYPE_P(zval_files) != IS_NULL)) {
switch (Z_TYPE_P(zval_files)) {
case IS_STRING:
- if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_files), Z_STRLEN_P(zval_files) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_files), Z_STRLEN_P(zval_files))) {
RETURN_FALSE;
}
break;
@@ -2537,7 +2537,7 @@ static ZIPARCHIVE_METHOD(extractTo)
case IS_LONG:
break;
case IS_STRING:
- if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file))) {
RETURN_FALSE;
}
break;
@@ -2547,7 +2547,7 @@ static ZIPARCHIVE_METHOD(extractTo)
break;
case IS_LONG:
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");
+ php_error_docref(NULL, E_WARNING, "Invalid argument, expect string or array of strings");
break;
}
} else {
@@ -2555,13 +2555,13 @@ static ZIPARCHIVE_METHOD(extractTo)
int filecount = zip_get_num_files(intern);
if (filecount == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive");
+ php_error_docref(NULL, E_WARNING, "Illegal archive");
RETURN_FALSE;
}
for (i = 0; i < filecount; i++) {
char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED);
- if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
+ if (!php_zip_extract_file(intern, pathto, file, strlen(file))) {
RETURN_FALSE;
}
}
@@ -2594,12 +2594,12 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
ZIP_FROM_OBJECT(intern, self);
if (type == 1) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P|ll", &filename, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|ll", &filename, &len, &flags) == FAILURE) {
return;
}
PHP_ZIP_STAT_PATH(intern, filename->val, filename->len, flags, sb);
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ll", &index, &len, &flags) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &index, &len, &flags) == FAILURE) {
return;
}
PHP_ZIP_STAT_INDEX(intern, index, 0, sb);
@@ -2670,7 +2670,7 @@ static ZIPARCHIVE_METHOD(getStream)
ZIP_FROM_OBJECT(intern, self);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "P", &filename) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &filename) == FAILURE) {
return;
}
@@ -2680,7 +2680,7 @@ static ZIPARCHIVE_METHOD(getStream)
obj = Z_ZIP_P(self);
- stream = php_stream_zip_open(obj->filename, filename->val, mode STREAMS_CC TSRMLS_CC);
+ stream = php_stream_zip_open(obj->filename, filename->val, mode STREAMS_CC);
if (stream) {
php_stream_to_zval(stream, return_value);
}
@@ -2898,14 +2898,14 @@ static PHP_MINIT_FUNCTION(zip)
INIT_CLASS_ENTRY(ce, "ZipArchive", zip_class_functions);
ce.create_object = php_zip_object_new;
- zip_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
+ zip_class_entry = zend_register_internal_class(&ce);
zend_hash_init(&zip_prop_handlers, 0, NULL, php_zip_free_prop_handler, 1);
- php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING TSRMLS_CC);
- php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "status", php_zip_status, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "numFiles", php_zip_get_num_files, NULL, NULL, IS_LONG);
+ php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL, php_zipobj_get_filename, IS_STRING);
+ php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL, php_zipobj_get_zip_comment, NULL, IS_STRING);
REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);
@@ -2985,7 +2985,7 @@ static PHP_MINIT_FUNCTION(zip)
REGISTER_ZIP_CLASS_CONST_LONG("OPSYS_DEFAULT", ZIP_OPSYS_DEFAULT);
#endif /* ifdef ZIP_OPSYS_DEFAULT */
- php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper TSRMLS_CC);
+ php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper);
le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number);
le_zip_entry = zend_register_list_destructors_ex(php_zip_free_entry, NULL, le_zip_entry_name, module_number);
@@ -2999,7 +2999,7 @@ static PHP_MINIT_FUNCTION(zip)
static PHP_MSHUTDOWN_FUNCTION(zip)
{
zend_hash_destroy(&zip_prop_handlers);
- php_unregister_url_stream_wrapper("zip" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("zip");
return SUCCESS;
}
/* }}} */
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index 7fab823297..388f7efd1a 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -50,10 +50,10 @@ extern zend_module_entry zip_module_entry;
/* {{{ ZIP_OPENBASEDIR_CHECKPATH(filename) */
#if PHP_API_VERSION < 20100412
# define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
/* }}} */
@@ -90,8 +90,8 @@ static inline ze_zip_object *php_zip_fetch_object(zend_object *obj) {
#define Z_ZIP_P(zv) php_zip_fetch_object(Z_OBJ_P((zv)))
-php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
+php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC);
extern php_stream_wrapper php_stream_zip_wrapper;
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c
index f2537e49c3..a0c6ec2f6d 100644
--- a/ext/zip/zip_stream.c
+++ b/ext/zip/zip_stream.c
@@ -44,7 +44,7 @@ struct php_zip_stream_data_t {
/* {{{ php_zip_ops_read */
-static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count)
{
ssize_t n = 0;
STREAM_DATA_FROM_STREAM();
@@ -55,7 +55,7 @@ static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRML
int ze, se;
zip_file_error_get(self->zf, &ze, &se);
stream->eof = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
+ php_error_docref(NULL, E_WARNING, "Zip stream error: %s", zip_file_strerror(self->zf));
return 0;
}
/* cast count to signed value to avoid possibly negative n
@@ -71,7 +71,7 @@ static size_t php_zip_ops_read(php_stream *stream, char *buf, size_t count TSRML
/* }}} */
/* {{{ php_zip_ops_write */
-static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t count)
{
if (!stream) {
return 0;
@@ -82,7 +82,7 @@ static size_t php_zip_ops_write(php_stream *stream, const char *buf, size_t coun
/* }}} */
/* {{{ php_zip_ops_close */
-static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_zip_ops_close(php_stream *stream, int close_handle)
{
STREAM_DATA_FROM_STREAM();
if (close_handle) {
@@ -103,7 +103,7 @@ static int php_zip_ops_close(php_stream *stream, int close_handle TSRMLS_DC)
/* }}} */
/* {{{ php_zip_ops_flush */
-static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
+static int php_zip_ops_flush(php_stream *stream)
{
if (!stream) {
return 0;
@@ -113,7 +113,7 @@ static int php_zip_ops_flush(php_stream *stream TSRMLS_DC)
}
/* }}} */
-static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
+static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ */
{
struct zip_stat sb;
const char *path = stream->orig_path;
@@ -148,7 +148,7 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D
memcpy(file_dirname, path, path_len - fragment_len);
file_dirname[path_len - fragment_len] = '\0';
- file_basename = php_basename((char *)path, path_len - fragment_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename((char *)path, path_len - fragment_len, NULL, 0);
fragment++;
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) {
@@ -200,7 +200,7 @@ php_stream_ops php_stream_zipio_ops = {
};
/* {{{ php_stream_zip_open */
-php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC)
+php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC)
{
struct zip_file *zf = NULL;
int err = 0;
@@ -254,7 +254,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
const char *mode,
int options,
char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
int path_len;
@@ -292,7 +292,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
memcpy(file_dirname, path, path_len - fragment_len);
file_dirname[path_len - fragment_len] = '\0';
- file_basename = php_basename(path, path_len - fragment_len, NULL, 0 TSRMLS_CC);
+ file_basename = php_basename(path, path_len - fragment_len, NULL, 0);
fragment++;
if (ZIP_OPENBASEDIR_CHECKPATH(file_dirname)) {
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index e5c2f37016..a93e46d339 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -58,7 +58,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
int compression_coding;
ZEND_END_MODULE_GLOBALS(zlib);
-php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
+php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC);
extern php_stream_ops php_stream_gzio_ops;
extern php_stream_wrapper php_stream_gzip_wrapper;
extern php_stream_filter_factory php_zlib_filter_factory;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index ffde50ba0b..3f66ed106d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -62,13 +62,13 @@ static void php_zlib_free(voidpf opaque, voidpf address)
/* }}} */
/* {{{ php_zlib_output_conflict_check() */
-static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C) > 0) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter") TSRMLS_CC)) {
+ if (php_output_get_level() > 0) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter"))) {
return FAILURE;
}
}
@@ -77,13 +77,13 @@ static int php_zlib_output_conflict_check(const char *handler_name, size_t handl
/* }}} */
/* {{{ php_zlib_output_encoding() */
-static int php_zlib_output_encoding(TSRMLS_D)
+static int php_zlib_output_encoding(void)
{
zval *enc;
if (!ZLIBG(compression_coding)) {
zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
(enc = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING") - 1))) {
@@ -191,7 +191,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
php_zlib_context *ctx = *(php_zlib_context **) handler_context;
PHP_OUTPUT_TSRMLS(output_context);
- if (!php_zlib_output_encoding(TSRMLS_C)) {
+ if (!php_zlib_output_encoding()) {
/* "Vary: Accept-Encoding" header sent along uncompressed content breaks caching in MSIE,
so let's just send it with successfully compressed content or unless the complete
buffer gets discarded, see http://bugs.php.net/40325;
@@ -205,7 +205,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if ((output_context->op & PHP_OUTPUT_HANDLER_START)
&& (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL))
) {
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
return FAILURE;
}
@@ -217,7 +217,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
int flags;
- if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags TSRMLS_CC)) {
+ if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags)) {
/* only run this once */
if (!(flags & PHP_OUTPUT_HANDLER_STARTED)) {
if (SG(headers_sent) || !ZLIBG(output_compression)) {
@@ -226,17 +226,17 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
}
switch (ZLIBG(compression_coding)) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
default:
deflateEnd(&ctx->Z);
return FAILURE;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -246,7 +246,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
/* }}} */
/* {{{ php_zlib_output_handler_context_init() */
-static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
+static php_zlib_context *php_zlib_output_handler_context_init(void)
{
php_zlib_context *ctx = (php_zlib_context *) ecalloc(1, sizeof(php_zlib_context));
ctx->Z.zalloc = php_zlib_alloc;
@@ -256,7 +256,7 @@ static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_output_handler_context_dtor() */
-static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
+static void php_zlib_output_handler_context_dtor(void *opaq)
{
php_zlib_context *ctx = (php_zlib_context *) opaq;
@@ -270,7 +270,7 @@ static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
/* }}} */
/* {{{ php_zlib_output_handler_init() */
-static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
php_output_handler *h = NULL;
@@ -280,8 +280,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
ZLIBG(handler_registered) = 1;
- if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) {
- php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC);
+ if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags))) {
+ php_output_handler_set_context(h, php_zlib_output_handler_context_init(), php_zlib_output_handler_context_dtor);
}
return h;
@@ -289,7 +289,7 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
/* }}} */
/* {{{ php_zlib_output_compression_start() */
-static void php_zlib_output_compression_start(TSRMLS_D)
+static void php_zlib_output_compression_start(void)
{
zval zoh;
php_output_handler *h;
@@ -301,12 +301,12 @@ static void php_zlib_output_compression_start(TSRMLS_D)
ZLIBG(output_compression) = PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
/* break omitted intentionally */
default:
- if ( php_zlib_output_encoding(TSRMLS_C) &&
- (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) &&
- (SUCCESS == php_output_handler_start(h TSRMLS_CC))) {
+ if ( php_zlib_output_encoding() &&
+ (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS)) &&
+ (SUCCESS == php_output_handler_start(h))) {
if (ZLIBG(output_handler) && *ZLIBG(output_handler)) {
ZVAL_STRING(&zoh, ZLIBG(output_handler));
- php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS);
zval_ptr_dtor(&zoh);
}
}
@@ -316,7 +316,7 @@ static void php_zlib_output_compression_start(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_encode() */
-static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level TSRMLS_DC)
+static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level)
{
int status;
z_stream Z;
@@ -347,7 +347,7 @@ static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encod
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return NULL;
}
/* }}} */
@@ -402,7 +402,7 @@ static inline int php_zlib_inflate_rounds(z_stream *Z, size_t max, char **buf, s
/* }}} */
/* {{{ php_zlib_decode() */
-static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len TSRMLS_DC)
+static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len)
{
int status = Z_DATA_ERROR;
z_stream Z;
@@ -438,17 +438,17 @@ retry_raw_inflate:
*out_buf = NULL;
*out_len = 0;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return FAILURE;
}
/* }}} */
/* {{{ php_zlib_cleanup_ob_gzhandler_mess() */
-static void php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_D)
+static void php_zlib_cleanup_ob_gzhandler_mess(void)
{
if (ZLIBG(ob_gzhandler)) {
deflateEnd(&(ZLIBG(ob_gzhandler)->Z));
- php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler) TSRMLS_CC);
+ php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler));
ZLIBG(ob_gzhandler) = NULL;
}
}
@@ -472,28 +472,28 @@ static PHP_FUNCTION(ob_gzhandler)
* - OG(running) is not set or set to any other output handler
* - we have to mess around with php_output_context */
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &in_str, &in_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &in_str, &in_len, &flags)) {
RETURN_FALSE;
}
- if (!(encoding = php_zlib_output_encoding(TSRMLS_C))) {
+ if (!(encoding = php_zlib_output_encoding())) {
RETURN_FALSE;
}
if (flags & PHP_OUTPUT_HANDLER_START) {
switch (encoding) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
if (!ZLIBG(ob_gzhandler)) {
- ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
+ ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init();
}
ctx.op = flags;
@@ -506,7 +506,7 @@ static PHP_FUNCTION(ob_gzhandler)
if (ctx.out.data && ctx.out.free) {
efree(ctx.out.data);
}
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
RETURN_FALSE;
}
@@ -551,7 +551,7 @@ static PHP_FUNCTION(gzfile)
zend_long use_include_path = 0;
php_stream *stream;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &use_include_path)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &use_include_path)) {
return;
}
@@ -560,7 +560,7 @@ static PHP_FUNCTION(gzfile)
}
/* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
/* Error reporting is already done by stream code */
@@ -591,7 +591,7 @@ static PHP_FUNCTION(gzopen)
php_stream *stream;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
return;
}
@@ -599,7 +599,7 @@ static PHP_FUNCTION(gzopen)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -619,7 +619,7 @@ static PHP_FUNCTION(readgzfile)
size_t size;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -627,7 +627,7 @@ static PHP_FUNCTION(readgzfile)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -645,16 +645,16 @@ static PHP_FUNCTION(name) \
zend_long level = -1; \
zend_long encoding = default_encoding; \
if (default_encoding) { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ll", &in, &level, &encoding)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S|ll", &in, &level, &encoding)) { \
return; \
} \
} else { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &in, &encoding, &level)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &in, &encoding, &level)) { \
return; \
} \
} \
if (level < -1 || level > 9) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%pd) must be within -1..9", level); \
+ php_error_docref(NULL, E_WARNING, "compression level (%pd) must be within -1..9", level); \
RETURN_FALSE; \
} \
switch (encoding) { \
@@ -663,10 +663,10 @@ static PHP_FUNCTION(name) \
case PHP_ZLIB_ENCODING_DEFLATE: \
break; \
default: \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
+ php_error_docref(NULL, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
RETURN_FALSE; \
} \
- if ((out = php_zlib_encode(in->val, in->len, encoding, level TSRMLS_CC)) == NULL) { \
+ if ((out = php_zlib_encode(in->val, in->len, encoding, level)) == NULL) { \
RETURN_FALSE; \
} \
RETURN_STR(out); \
@@ -679,14 +679,14 @@ static PHP_FUNCTION(name) \
size_t in_len; \
size_t out_len; \
zend_long max_len = 0; \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &in_buf, &in_len, &max_len)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &in_buf, &in_len, &max_len)) { \
return; \
} \
if (max_len < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
+ php_error_docref(NULL, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
RETURN_FALSE; \
} \
- if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len TSRMLS_CC)) { \
+ if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len)) { \
RETURN_FALSE; \
} \
RETVAL_STRINGL(out_buf, out_len); \
@@ -902,13 +902,13 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0);
if (ini_value && *ini_value && int_value) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
+ php_error_docref("ref.outcontrol", E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
return FAILURE;
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- int status = php_output_get_status(TSRMLS_C);
+ int status = php_output_get_status();
if (status & PHP_OUTPUT_SENT) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_compression - headers already sent");
return FAILURE;
}
}
@@ -918,8 +918,8 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ZLIBG(output_compression) = ZLIBG(output_compression_default);
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
- if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) {
- php_zlib_output_compression_start(TSRMLS_C);
+ if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))) {
+ php_zlib_output_compression_start();
}
}
@@ -930,12 +930,12 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
/* {{{ OnUpdate_zlib_output_handler */
static PHP_INI_MH(OnUpdate_zlib_output_handler)
{
- if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status(TSRMLS_C) & PHP_OUTPUT_SENT)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent");
+ if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status() & PHP_OUTPUT_SENT)) {
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_handler - headers already sent");
return FAILURE;
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
/* }}} */
@@ -951,12 +951,12 @@ PHP_INI_END()
/* {{{ PHP_MINIT_FUNCTION */
static PHP_MINIT_FUNCTION(zlib)
{
- php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
- php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper);
+ php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory);
- php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check);
+ php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check);
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);
@@ -972,8 +972,8 @@ static PHP_MINIT_FUNCTION(zlib)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
static PHP_MSHUTDOWN_FUNCTION(zlib)
{
- php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
- php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("zlib");
+ php_stream_filter_unregister_factory("zlib.*");
UNREGISTER_INI_ENTRIES();
@@ -987,7 +987,7 @@ static PHP_RINIT_FUNCTION(zlib)
ZLIBG(compression_coding) = 0;
if (!ZLIBG(handler_registered)) {
ZLIBG(output_compression) = ZLIBG(output_compression_default);
- php_zlib_output_compression_start(TSRMLS_C);
+ php_zlib_output_compression_start();
}
return SUCCESS;
@@ -997,7 +997,7 @@ static PHP_RINIT_FUNCTION(zlib)
/* {{{ PHP_RSHUTDOWN_FUNCTION */
static PHP_RSHUTDOWN_FUNCTION(zlib)
{
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
ZLIBG(handler_registered) = 0;
return SUCCESS;
diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c
index 2f0d1f7706..f17a8d6ce0 100644
--- a/ext/zlib/zlib_filter.c
+++ b/ext/zlib/zlib_filter.c
@@ -76,7 +76,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
while (buckets_in->head) {
size_t bin = 0, desired;
- bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(buckets_in->head);
while (bin < (unsigned int) bucket->buflen) {
@@ -98,7 +98,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
data->finished = '\1';
} else if (status != Z_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
/* reset these because despite the error the filter may be used again */
data->strm.next_in = data->inbuf;
data->strm.avail_in = 0;
@@ -112,20 +112,20 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
} else if (status == Z_STREAM_END && data->strm.avail_out >= data->outbuf_len) {
/* no more data to decompress, and nothing was spat out */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_PASS_ON;
}
}
consumed += bucket->buflen;
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (!data->finished && flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -136,8 +136,8 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -152,7 +152,7 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
return exit_status;
}
-static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_zlib_inflate_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_zlib_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -201,7 +201,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
bucket = buckets_in->head;
- bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+ bucket = php_stream_bucket_make_writeable(bucket);
while (bin < (unsigned int) bucket->buflen) {
desired = bucket->buflen - bin;
@@ -214,7 +214,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH));
if (status != Z_OK) {
/* Something bad happened */
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
return PSFS_ERR_FATAL;
}
desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */
@@ -226,15 +226,15 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
php_stream_bucket *out_bucket;
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC);
+ out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, out_bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
consumed += bucket->buflen;
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
@@ -245,8 +245,8 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - data->strm.avail_out;
- bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
- php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
+ bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0);
+ php_stream_bucket_append(buckets_out, bucket);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
@@ -261,7 +261,7 @@ static php_stream_filter_status_t php_zlib_deflate_filter(
return exit_status;
}
-static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC)
+static void php_zlib_deflate_dtor(php_stream_filter *thisfilter)
{
if (thisfilter && Z_PTR(thisfilter->abstract)) {
php_zlib_filter_data *data = Z_PTR(thisfilter->abstract);
@@ -282,7 +282,7 @@ static php_stream_filter_ops php_zlib_deflate_ops = {
/* {{{ zlib.* common factory */
-static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC)
+static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent)
{
php_stream_filter_ops *fops = NULL;
php_zlib_filter_data *data;
@@ -291,7 +291,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* Create this filter */
data = pecalloc(1, sizeof(php_zlib_filter_data), persistent);
if (!data) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", sizeof(php_zlib_filter_data));
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_zlib_filter_data));
return NULL;
}
@@ -303,14 +303,14 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
data->strm.avail_out = data->outbuf_len = data->inbuf_len = 0x8000;
data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent);
if (!data->inbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", data->inbuf_len);
pefree(data, persistent);
return NULL;
}
data->strm.avail_in = 0;
data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent);
if (!data->outbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %zd bytes", data->outbuf_len);
+ php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", data->outbuf_len);
pefree(data->inbuf, persistent);
pefree(data, persistent);
return NULL;
@@ -332,7 +332,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
ZVAL_DUP(&tmp, tmpzval);
convert_to_long(&tmp);
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 32) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
} else {
windowBits = Z_LVAL(tmp);
}
@@ -365,7 +365,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* Memory Level (1 - 9) */
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > MAX_MEM_LEVEL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for memory level. (%pd)", Z_LVAL(tmp));
} else {
memLevel = Z_LVAL(tmp);
}
@@ -377,7 +377,7 @@ static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *f
/* log-2 base of history window (9 - 15) */
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 16) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
} else {
windowBits = Z_LVAL(tmp);
}
@@ -400,13 +400,13 @@ factory_setlevel:
/* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
if (Z_LVAL(tmp) < -1 || Z_LVAL(tmp) > 9) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%pd)", Z_LVAL(tmp));
+ php_error_docref(NULL, E_WARNING, "Invalid compression level specified. (%pd)", Z_LVAL(tmp));
} else {
level = Z_LVAL(tmp);
}
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored");
+ php_error_docref(NULL, E_WARNING, "Invalid filter parameter, ignored");
}
}
status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0);
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index 796b8a54e0..329180bc3b 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -32,7 +32,7 @@ struct php_gz_stream_data_t {
php_stream *stream;
};
-static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_gziop_read(php_stream *stream, char *buf, size_t count)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int read;
@@ -47,7 +47,7 @@ static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_
return (size_t)((read < 0) ? 0 : read);
}
-static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int wrote;
@@ -58,14 +58,14 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count
return (size_t)((wrote < 0) ? 0 : wrote);
}
-static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC)
+static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
assert(self != NULL);
if (whence == SEEK_END) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SEEK_END is not supported");
+ php_error_docref(NULL, E_WARNING, "SEEK_END is not supported");
return -1;
}
*newoffs = gzseek(self->gz_file, offset, whence);
@@ -73,7 +73,7 @@ static int php_gziop_seek(php_stream *stream, zend_off_t offset, int whence, zen
return (*newoffs < 0) ? -1 : 0;
}
-static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_gziop_close(php_stream *stream, int close_handle)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
int ret = EOF;
@@ -93,7 +93,7 @@ static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
return ret;
}
-static int php_gziop_flush(php_stream *stream TSRMLS_DC)
+static int php_gziop_flush(php_stream *stream)
{
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract;
@@ -111,7 +111,7 @@ php_stream_ops php_stream_gzio_ops = {
};
php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
- char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
+ char **opened_path, php_stream_context *context STREAMS_DC)
{
struct php_gz_stream_data_t *self;
php_stream *stream = NULL, *innerstream = NULL;
@@ -119,7 +119,7 @@ php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, con
/* sanity check the stream: it can be either read-only or write-only */
if (strchr(mode, '+')) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!");
+ php_error_docref(NULL, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!");
}
return NULL;
}
@@ -152,7 +152,7 @@ php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, const char *path, con
efree(self);
if (options & REPORT_ERRORS) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzopen failed");
+ php_error_docref(NULL, E_WARNING, "gzopen failed");
}
}