} php_istream;
static int le_istream;
-static void istream_destructor(php_istream *stm);
+static void istream_destructor(php_istream *stm TSRMLS_DC);
static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_istream *stm = (php_istream *)rsrc->ptr;
- istream_destructor(stm);
+ istream_destructor(stm TSRMLS_CC);
}
-#ifdef ZTS
-# define TSRMLS_FIXED() TSRMLS_FETCH();
-#else
-# define TSRMLS_FIXED()
-#endif
-
#define FETCH_STM() \
- TSRMLS_FIXED() \
+ TSRMLS_FETCH(); \
php_istream *stm = (php_istream*)This; \
if (GetCurrentThreadId() != stm->engine_thread) \
return RPC_E_WRONG_THREAD;
stm_clone
};
-static void istream_destructor(php_istream *stm)
+static void istream_destructor(php_istream *stm TSRMLS_DC)
{
- TSRMLS_FETCH();
-
if (stm->id) {
int id = stm->id;
stm->id = 0;
static int le_dispatch;
-static void disp_destructor(php_dispatchex *disp);
+static void disp_destructor(php_dispatchex *disp TSRMLS_DC);
static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_dispatchex *disp = (php_dispatchex *)rsrc->ptr;
- disp_destructor(disp);
+ disp_destructor(disp TSRMLS_CC);
}
int php_com_wrapper_minit(INIT_FUNC_ARGS)
}
/* }}} */
-#ifdef ZTS
-# define TSRMLS_FIXED() TSRMLS_FETCH();
-#else
-# define TSRMLS_FIXED()
-#endif
-
#define FETCH_DISP(methname) \
- TSRMLS_FIXED() \
+ TSRMLS_FETCH(); \
php_dispatchex *disp = (php_dispatchex*)This; \
if (COMG(rshutdown_started)) { \
trace(" PHP Object:%p (name:unknown) %s\n", disp->object, methname); \
return disp;
}
-static void disp_destructor(php_dispatchex *disp)
-{
- TSRMLS_FETCH();
-
+static void disp_destructor(php_dispatchex *disp TSRMLS_DC)
+{
/* Object store not available during request shutdown */
if (COMG(rshutdown_started)) {
trace("destroying COM wrapper for PHP object %p (name:unknown)\n", disp->object);
# define php_curl_ret(__ret) RETVAL_FALSE; return;
#endif
-static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */
+static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
{
CURLcode error = CURLE_OK;
#if LIBCURL_VERSION_NUM < 0x071100
char *copystr = NULL;
#endif
- TSRMLS_FETCH();
-
/* Disable file:// if open_basedir or safe_mode are used */
if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) {
#if LIBCURL_VERSION_NUM >= 0x071304
#endif
if (url) {
- if (!php_curl_option_url(ch, url, url_len)) {
+ if (!php_curl_option_url(ch, url, url_len TSRMLS_CC)) {
_php_curl_close_ex(ch TSRMLS_CC);
RETURN_FALSE;
}
}
#endif
if (option == CURLOPT_URL) {
- if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue))) {
+ if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
}
/* {{{ _php_regcomp
*/
-static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
+static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC)
{
int r = 0;
int patlen = strlen(pattern);
reg_cache *rc = NULL;
- TSRMLS_FETCH();
if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) {
/* easier than dealing with overflow as it happens */
#undef regfree
#define regfree(a);
#undef regcomp
-#define regcomp(a, b, c) _php_regcomp(a, b, c)
+#define regcomp(a, b, c) _php_regcomp(a, b, c TSRMLS_CC)
static void php_ereg_init_globals(zend_ereg_globals *ereg_globals TSRMLS_DC)
{
/* {{{ php_ereg_replace
* this is the meat and potatoes of regex replacement! */
-PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended)
+PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC)
{
regex_t re;
regmatch_t *subs;
}
/* do the actual work */
- ret = php_ereg_replace(pattern, replace, string, icase, 1);
+ ret = php_ereg_replace(pattern, replace, string, icase, 1 TSRMLS_CC);
if (ret == (char *) -1) {
RETVAL_FALSE;
} else {
extern zend_module_entry ereg_module_entry;
#define phpext_ereg_ptr &ereg_module_entry
-PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended);
+PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC);
PHP_FUNCTION(ereg);
PHP_FUNCTION(eregi);
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) {
- TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid context pointer value");
return OCI_ERROR;
switch(outcol->data_type) {
case SQLT_RSET: {
php_oci_statement *nested_stmt;
- TSRMLS_FETCH();
nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0 TSRMLS_CC);
if (!nested_stmt) {
case SQLT_BFILE: {
php_oci_descriptor *descr;
int dtype;
- TSRMLS_FETCH();
if (outcol->data_type == SQLT_BFILE) {
dtype = OCI_DTYPE_FILE;
}
/* }}} */
-static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */
+static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */
{
char buffer[MAXPATHLEN];
- TSRMLS_FETCH();
-
*egdsocket = 0;
*seeded = 0;
}
randfile = CONF_get_string(req->req_config, req->section_name, "RANDFILE");
- php_openssl_load_rand_file(randfile, &egdsocket, &seeded);
+ php_openssl_load_rand_file(randfile, &egdsocket, &seeded TSRMLS_CC);
if ((req->priv_key = EVP_PKEY_new()) != NULL) {
switch(req->priv_key_type) {
ZVAL_STRINGL(&result, buf, length- 1, 1); \
}
-static int php_sybase_fetch_result_row (sybase_result *result, int numrows)
+static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS_DC)
{
int i, j;
CS_INT retcode;
- TSRMLS_FETCH();
/* We've already fetched everything */
if (result->last_retcode == CS_END_DATA || result->last_retcode == CS_END_RESULTS) {
return retcode;
}
-static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int buffered, int store)
+static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store TSRMLS_DC)
{
int num_fields;
sybase_result *result;
if (buffered) {
retcode = CS_SUCCEED;
} else {
- if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) {
+ if ((retcode = php_sybase_fetch_result_row(result, -1 TSRMLS_CC)) == CS_FAIL) {
return NULL;
}
}
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
case CS_STATUS_RESULT:
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
RETURN_FALSE;
case CS_PARAM_RESULT:
case CS_ROW_RESULT:
if (status != Q_RESULT) {
- result = php_sybase_fetch_result_set(sybase_ptr, buffered, store);
+ result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC);
if (result == NULL) {
ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL);
sybase_ptr->dead = 1;
/* Unbuffered? */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1);
+ php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
}
/* At the end? */
/* Unbuffered ? Fetch next row */
if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) {
- php_sybase_fetch_result_row(result, 1);
+ php_sybase_fetch_result_row(result, 1 TSRMLS_CC);
}
/* At the end? */
/* 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);
+ php_sybase_fetch_result_row(result, offset+ 1 TSRMLS_CC);
}
if (offset < 0 || offset >= result->num_rows) {
/* 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);
+ php_sybase_fetch_result_row(result, row TSRMLS_CC);
}
if (row < 0 || row >= result->num_rows) {
#ifdef PHP_WIN32
#include "win32_internal_function_disabled.h"
-static php_win32_disable_functions() {
+static php_win32_disable_functions(TSRMLS_D)
+{
int i;
- TSRMLS_FETCH();
if (EG(windows_version_info).dwMajorVersion < 5) {
for (i = 0; i < function_name_cnt_5; i++) {
#ifdef PHP_WIN32
/* Disable incompatible functions for the running platform */
- if (php_win32_disable_functions() == FAILURE) {
+ if (php_win32_disable_functions(TSRMLS_C) == FAILURE) {
php_printf("Unable to disable unsupported functions\n");
return FAILURE;
}
#if 0
+/*
This function is most likely a bad idea. Just playing with it for now.
-
+*/
PHP_FUNCTION(apache_exec_uri)
{
char *filename;
int filename_len;
request_rec *rr=NULL;
- TSRMLS_FETCH();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
return;
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2010 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/3_01.txt |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available at through the world-wide-web at |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: Rasmus Lerdorf <rasmus@php.net> |
- | (with helpful hints from Dean Gaudet <dgaudet@arctic.org> |
- | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+ | Authors: Rasmus Lerdorf <rasmus@php.net> |
+ | (with helpful hints from Dean Gaudet <dgaudet@arctic.org> |
+ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if 0
+/*
This function is most likely a bad idea. Just playing with it for now.
+*/
PHP_FUNCTION(apache_exec_uri)
{
zval **filename;
request_rec *rr=NULL;
- TSRMLS_FETCH();
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
WRONG_PARAM_COUNT;
{
char *header_name, *header_content;
char *p;
- TSRMLS_FETCH();
http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL);
static int
php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
- TSRMLS_FETCH();
-
if (SG(sapi_headers).send_default_content_type) {
fd_printf(PHG(cip)->fd,"Content-Type: text/html\n");
}
/*
int i;
char *http_cookie = NULL;
- NTSRMLS_FETCH();
i = Ns_SetIFind(NSG(conn->headers), "cookie");
if(i != -1) {
/*
uint max_read;
uint total_read = 0;
- NTSRMLS_FETCH();
max_read = MIN(NSG(data_avail), count_bytes);
}
-int php_doit(TSRMLS_D TSRMLS_DC)
+int php_doit(TSRMLS_D)
{
struct stat sb;
zend_file_handle file_handle;
struct httpinfo *hip = PHG(cip)->hip;
- TSRMLS_FETCH();
if (php_request_startup(TSRMLS_C) == FAILURE) {
return -1;