return SUCCESS;
}
-static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags)
+static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC)
{
char *spec_walk;
char buf[1024];
void **p;
int arg_count;
int quiet = flags & ZEND_PARSE_PARAMS_QUIET;
- TSRMLS_FETCH();
for (spec_walk = type_spec; *spec_walk; spec_walk++) {
c = *spec_walk;
return SUCCESS;
}
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...)
+ZEND_API int zend_parse_parameters_ex(int flags TSRMLS_DC, int num_args, char *type_spec, ...)
{
va_list va;
int retval;
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, flags);
+ retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
va_end(va);
return retval;
}
-ZEND_API int zend_parse_parameters(int num_args, char *type_spec, ...)
+ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)
{
va_list va;
int retval;
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, 0);
+ retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
va_end(va);
return retval;
/* Parameter parsing API -- andrei */
#define ZEND_PARSE_PARAMS_QUIET 1<<1
-ZEND_API int zend_parse_parameters(int num_args, char *type_spec, ...);
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
+ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
+ZEND_API int zend_parse_parameters_ex(int flags TSRMLS_DC, int num_args, char *type_spec, ...);
/* Parameter parsing API -- andrei */
RETURN_FALSE;
}
- resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type));
+ resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type) TSRMLS_CC);
if (resource_type) {
RETURN_STRING(resource_type, 1);
} else {
binary_op_addr:
EG(binary_op)(&Ts[opline->result.u.var].tmp_var,
get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R),
- get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) );
+ get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
FREE_OP(&opline->op1, EG(free_op1));
FREE_OP(&opline->op2, EG(free_op2));
NEXT_OPCODE();
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
- EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
+ EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
FREE_OP(&opline->op2, EG(free_op2));
}
is_equal_function(&Ts[opline->result.u.var].tmp_var,
get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R),
- get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
+ get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
FREE_OP(&opline->op2, EG(free_op2));
if (switch_expr_is_overloaded) {
zend_op **original_opline_ptr;
int orig_free_op1, orig_free_op2;
int (*orig_unary_op)(zval *result, zval *op1);
- int (*orig_binary_op)(zval *result, zval *op1, zval *op2);
+ int (*orig_binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zval function_name_copy;
TSRMLS_FETCH();
/*#undef ZTS*/
#ifdef ZTS
-#include "../TSRM/TSRM.h"
-
#ifdef __cplusplus
class ZendFlexLexer;
class ZendIniFlexLexer;
zend_ptr_stack argument_stack;
int free_op1, free_op2;
int (*unary_op)(zval *result, zval *op1);
- int (*binary_op)(zval *result, zval *op1, zval *op2);
+ int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zval *garbage[2];
int garbage_ptr;
}
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
{
Bucket *p1, *p2;
int result;
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new));
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
ZEND_API int zend_hash_num_elements(HashTable *ht);
BEGIN_EXTERN_C()
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
-ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
-ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
+ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
+ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(char *s, uint len);
END_EXTERN_C()
error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);
- sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno());
+ sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
if (CG(ini_parser_unbuffered_errors)) {
#ifdef PHP_WIN32
#endif /* ZTS && __cplusplus */
BEGIN_EXTERN_C()
-int zend_ini_scanner_get_lineno(void);
+int zend_ini_scanner_get_lineno(TSRMLS_D);
char *zend_ini_scanner_get_filename(void);
int zend_ini_open_file_for_scanning(zend_file_handle *fh);
void zend_ini_close_file(zend_file_handle *fh);
#else /* ZTS */
-int zend_ini_scanner_get_lineno()
+int zend_ini_scanner_get_lineno(TSRMLS_D)
{
- TSRMLS_FETCH();
-
return CG(ini_scanner)->lineno();
}
;
top_statement_list:
- top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { TSRMLS_FETCH(); HANDLE_INTERACTIVE(); }
+ top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
inner_statement_list:
- inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { TSRMLS_FETCH(); HANDLE_INTERACTIVE(); }
+ inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
common_scalar { $$ = $1; }
| T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_CT TSRMLS_CC); }
| '+' static_scalar { $$ = $1; }
- | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
+ | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
;
BEGIN_EXTERN_C()
-int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
+int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
{
zend_lex_state original_lex_state;
zend_file_handle file_handle;
- TSRMLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
return SUCCESS;
}
-int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name)
+int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
{
zend_lex_state original_lex_state;
zval tmp = *str;
#ifdef ZTS
istrstream *input_stream;
#endif
- TSRMLS_FETCH();
str = &tmp;
zval_copy_ctor(str);
return index;
}
-ZEND_API int zend_list_delete(int id)
+ZEND_API int _zend_list_delete(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
}
-ZEND_API void *zend_list_find(int id, int *type)
+ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
*type = le->type;
}
-ZEND_API int zend_list_addref(int id)
+ZEND_API int _zend_list_addref(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
}
-ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
+ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
int actual_resource_type;
}
-char *zend_rsrc_list_get_rsrc_type(int resource)
+char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC)
{
zend_rsrc_list_dtors_entry *lde;
int rsrc_type;
void zend_destroy_rsrc_list_dtors(void);
ZEND_API int zend_list_insert(void *ptr, int type);
-ZEND_API int zend_list_addref(int id);
-ZEND_API int zend_list_delete(int id);
-ZEND_API void *zend_list_find(int id, int *type);
+ZEND_API int _zend_list_addref(int id TSRMLS_DC);
+ZEND_API int _zend_list_delete(int id TSRMLS_DC);
+ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
+
+#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC)
+#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC)
+#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC)
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
-ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
+ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
-ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource);
+ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
ZEND_API int zend_fetch_list_dtor_id(char *type_name);
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
}
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1,resource_type2) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
}
-ZEND_API void convert_scalar_to_number(zval *op)
+ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
{
switch (op->type) {
case IS_STRING:
#define zendi_convert_scalar_to_number(op, holder, result) \
if (op==result) { \
- convert_scalar_to_number(op); \
+ convert_scalar_to_number(op TSRMLS_CC); \
} else { \
switch ((op)->type) { \
case IS_STRING: \
case IS_NULL:
op->value.lval = 0;
break;
- case IS_RESOURCE:
- zend_list_delete(op->value.lval);
+ case IS_RESOURCE: {
+ TSRMLS_FETCH();
+
+ zend_list_delete(op->value.lval);
+ }
/* break missing intentionally */
case IS_BOOL:
case IS_LONG:
case IS_NULL:
op->value.dval = 0.0;
break;
- case IS_RESOURCE:
- zend_list_delete(op->value.lval);
+ case IS_RESOURCE: {
+ TSRMLS_FETCH();
+
+ zend_list_delete(op->value.lval);
+ }
/* break missing intentionally */
case IS_BOOL:
case IS_LONG:
case IS_NULL:
op->value.lval = 0;
break;
- case IS_RESOURCE:
- zend_list_delete(op->value.lval);
+ case IS_RESOURCE: {
+ TSRMLS_FETCH();
+
+ zend_list_delete(op->value.lval);
+ }
/* break missing intentionally */
case IS_LONG:
op->value.lval = (op->value.lval ? 1 : 0);
va_end(ap);
}
-ZEND_API int add_function(zval *result, zval *op1, zval *op2)
+ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int sub_function(zval *result, zval *op1, zval *op2)
+ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int mul_function(zval *result, zval *op1, zval *op2)
+ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
return FAILURE; /* unknown datatype */
}
-ZEND_API int div_function(zval *result, zval *op1, zval *op2)
+ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int mod_function(zval *result, zval *op1, zval *op2)
+ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2)
+ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int boolean_not_function(zval *result, zval *op1)
+ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy;
}
-ZEND_API int bitwise_not_function(zval *result, zval *op1)
+ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy = *op1;
}
-ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
+ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
+ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
+ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2)
+ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2)
+ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int concat_function(zval *result, zval *op1, zval *op2)
+ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
}
-ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2)
+ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
return SUCCESS;
}
-ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2)
+ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
}
-ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
+ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
return SUCCESS;
}
if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) {
- zend_compare_arrays(result, op1, op2);
+ zend_compare_arrays(result, op1, op2 TSRMLS_CC);
return SUCCESS;
}
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
- zend_compare_objects(result, op1, op2);
+ zend_compare_objects(result, op1, op2 TSRMLS_CC);
return SUCCESS;
}
static int hash_zval_identical_function(const zval **z1, const zval **z2)
{
zval result;
+ TSRMLS_FETCH();
/* is_identical_function() returns 1 in case of identity and 0 in case
* of a difference;
* whereas this comparison function is expected to return 0 on identity,
* and non zero otherwise.
*/
- if (is_identical_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
+ if (is_identical_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) {
return 1;
}
return !result.value.lval;
}
-ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
result->type = IS_BOOL;
if (op1->type != op2->type) {
}
break;
case IS_ARRAY:
- if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1)==0) {
+ if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) {
result->value.lval = 1;
} else {
result->value.lval = 0;
if (Z_OBJCE_P(op1) != Z_OBJCE_P(op2)) {
result->value.lval = 0;
} else {
- if (zend_hash_compare(Z_OBJPROP_P(op1), Z_OBJPROP_P(op2), (compare_func_t) hash_zval_identical_function, 1)==0) {
+ if (zend_hash_compare(Z_OBJPROP_P(op1), Z_OBJPROP_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) {
result->value.lval = 1;
} else {
result->value.lval = 0;
}
-ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
result->type = IS_BOOL;
- if (is_identical_function( result, op1, op2 ) == FAILURE) {
+ if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
return FAILURE;
}
result->value.lval = !result->value.lval;
}
-ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
- if (compare_function(result, op1, op2) == FAILURE) {
+ if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
return FAILURE;
}
convert_to_boolean(result);
}
-ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
- if (compare_function(result, op1, op2) == FAILURE) {
+ if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
return FAILURE;
}
convert_to_boolean(result);
}
-ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
- if (compare_function(result, op1, op2) == FAILURE) {
+ if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
return FAILURE;
}
if (result->type == IS_LONG) {
}
-ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
+ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
- if (compare_function(result, op1, op2) == FAILURE) {
+ if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) {
return FAILURE;
}
if (result->type == IS_LONG) {
}
-static int hash_zval_compare_function(const zval **z1, const zval **z2)
+static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC)
{
zval result;
- if (compare_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
+ if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) {
return 1;
}
return result.value.lval;
-ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2)
+ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC)
{
result->type = IS_LONG;
- result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0);
+ result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
}
-ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2)
+ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC)
{
- zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht);
+ zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht TSRMLS_CC);
}
-ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2)
+ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC)
{
/* OBJECTS_FIXME */
if (Z_OBJCE_P(o1) != Z_OBJCE_P(o2)) {
result->type = IS_LONG;
return;
}
- zend_compare_symbol_tables(result, Z_OBJPROP_P(o1), Z_OBJPROP_P(o2));
+ zend_compare_symbol_tables(result, Z_OBJPROP_P(o1), Z_OBJPROP_P(o2) TSRMLS_CC);
}
#define MAX_LENGTH_OF_LONG 18
#define MAX_LENGTH_OF_DOUBLE 32
-ZEND_API int add_function(zval *result, zval *op1, zval *op2);
-ZEND_API int sub_function(zval *result, zval *op1, zval *op2);
-ZEND_API int mul_function(zval *result, zval *op1, zval *op2);
-ZEND_API int div_function(zval *result, zval *op1, zval *op2);
-ZEND_API int mod_function(zval *result, zval *op1, zval *op2);
-ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2);
-ZEND_API int boolean_not_function(zval *result, zval *op1);
-ZEND_API int bitwise_not_function(zval *result, zval *op1);
-ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2);
-ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2);
-ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2);
-ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2);
-ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2);
-ZEND_API int concat_function(zval *result, zval *op1, zval *op2);
-
-ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2);
-ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2);
-ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2);
-ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2);
-ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2);
-ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
+ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC);
+ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC);
+ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+
+ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
{
long local_lval;
ZEND_API int decrement_function(zval *op2);
BEGIN_EXTERN_C()
-ZEND_API void convert_scalar_to_number(zval *op);
+ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
ZEND_API void convert_to_double(zval *op);
END_EXTERN_C()
ZEND_API int zval_is_true(zval *op);
-ZEND_API int compare_function(zval *result, zval *op1, zval *op2);
-ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2);
-ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2);
+ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
+ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API void zend_str_tolower(char *str, unsigned int length);
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
-ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2);
-ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
-ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
+ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC);
+ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
+ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
ZEND_API int zend_atoi(const char *str, int str_len);
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
- convert_scalar_to_number(*ppzv); \
+ convert_scalar_to_number(*ppzv TSRMLS_CC); \
}
zend_hash_destroy(zvalue->value.obj.properties);
FREE_HASHTABLE(zvalue->value.obj.properties);
break;
- case IS_RESOURCE:
- /* destroy resource */
- zend_list_delete(zvalue->value.lval);
+ case IS_RESOURCE: {
+ TSRMLS_FETCH();
+
+ /* destroy resource */
+ zend_list_delete(zvalue->value.lval);
+ }
break;
case IS_LONG:
case IS_DOUBLE:
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (zvalue->type) {
- case IS_RESOURCE:
- zend_list_addref(zvalue->value.lval);
+ case IS_RESOURCE: {
+ TSRMLS_FETCH();
+
+ zend_list_addref(zvalue->value.lval);
+ }
break;
case IS_BOOL:
case IS_LONG: