Deleted Added
full compact
zend_API.h (f4cfaf36) zend_API.h (2161103f)
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |

--- 659 unchanged lines hidden (view full) ---

668 } \
669 }
670
671
672#define ZEND_SET_SYMBOL(symtable, name, var) \
673 { \
674 char *_name = (name); \
675 \
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |

--- 659 unchanged lines hidden (view full) ---

668 } \
669 }
670
671
672#define ZEND_SET_SYMBOL(symtable, name, var) \
673 { \
674 char *_name = (name); \
675 \
676 ZEND_SET_SYMBOL_WITH_LENGTH(symtable, _name, strlen(_name)+1, var, 1, 0); \
676 ZEND_SET_SYMBOL_WITH_LENGTH(symtable, _name, strlen(_name), var, 1, 0); \
677 }
678
679#define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \
680 { \
677 }
678
679#define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var, _refcount, _is_ref) \
680 { \
681 zval **orig_var; \
681 zval *orig_var; \
682 \
682 \
683 if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \
684 && Z_ISREF_PP(orig_var)) { \
685 Z_SET_REFCOUNT_P(var, Z_REFCOUNT_PP(orig_var)); \
686 Z_SET_ISREF_P(var); \
683 if ((orig_var = zend_hash_str_find(symtable, (name), (name_length))) != NULL \
684 && Z_ISREF_P(orig_var)) { \
685 Z_SET_REFCOUNT_P(var, Z_REFCOUNT_P(orig_var)); \
686 /*???Z_SET_ISREF_P(var);*/ \
687 \
688 if (_refcount) { \
689 Z_SET_REFCOUNT_P(var, Z_REFCOUNT_P(var) + _refcount - 1); \
690 } \
687 \
688 if (_refcount) { \
689 Z_SET_REFCOUNT_P(var, Z_REFCOUNT_P(var) + _refcount - 1); \
690 } \
691 zval_dtor(*orig_var); \
692 **orig_var = *(var); \
693 FREE_ZVAL(var); \
691 zval_dtor(orig_var); \
692 ZVAL_COPY_VALUE(orig_var, var); \
693 /*???FREE_ZVAL(var);*/ \
694 } else { \
694 } else { \
695 Z_SET_ISREF_TO_P(var, _is_ref); \
695 /*???Z_SET_ISREF_TO_P(var, _is_ref);*/ \
696 if (_refcount) { \
697 Z_SET_REFCOUNT_P(var, _refcount); \
698 } \
696 if (_refcount) { \
697 Z_SET_REFCOUNT_P(var, _refcount); \
698 } \
699 zend_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \
699 zend_hash_str_update(symtable, (name), (name_length), var); \
700 } \
701 }
702
703
704#define ZEND_SET_GLOBAL_VAR(name, var) \
705 ZEND_SET_SYMBOL(&EG(symbol_table), name, var)
706
707#define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \

--- 41 unchanged lines hidden ---
700 } \
701 }
702
703
704#define ZEND_SET_GLOBAL_VAR(name, var) \
705 ZEND_SET_SYMBOL(&EG(symbol_table), name, var)
706
707#define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var, _refcount, _is_ref) \

--- 41 unchanged lines hidden ---