Lines Matching refs:name

46 		if (c->name) {  in free_zend_constant()
47 zend_string_release_ex(c->name, 0); in free_zend_constant()
52 if (c->name) { in free_zend_constant()
53 zend_string_release_ex(c->name, 1); in free_zend_constant()
70 c->name = zend_string_copy(c->name); in copy_zend_constant()
126 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
132 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
136 ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, … in zend_register_bool_constant() argument
142 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
146 ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zend_long lval, int fl… in zend_register_long_constant() argument
152 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
157 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
163 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
168 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval,… in zend_register_stringl_constant() argument
174 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
179 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, … in zend_register_string_constant() argument
181 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
184 static zend_constant *zend_get_halt_offset_constant(const char *name, size_t name_len) in zend_get_halt_offset_constant() argument
192 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_halt_offset_constant()
210 ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t len) /* {{{ */ in _zend_get_special_const() argument
213 if ((name[0] == 'n' || name[0] == 'N') && in _zend_get_special_const()
214 (name[1] == 'u' || name[1] == 'U') && in _zend_get_special_const()
215 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
216 (name[3] == 'l' || name[3] == 'L') in _zend_get_special_const()
220 if ((name[0] == 't' || name[0] == 'T') && in _zend_get_special_const()
221 (name[1] == 'r' || name[1] == 'R') && in _zend_get_special_const()
222 (name[2] == 'u' || name[2] == 'U') && in _zend_get_special_const()
223 (name[3] == 'e' || name[3] == 'E') in _zend_get_special_const()
228 if ((name[0] == 'f' || name[0] == 'F') && in _zend_get_special_const()
229 (name[1] == 'a' || name[1] == 'A') && in _zend_get_special_const()
230 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
231 (name[3] == 's' || name[3] == 'S') && in _zend_get_special_const()
232 (name[4] == 'e' || name[4] == 'E') in _zend_get_special_const()
254 static zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len) in zend_get_constant_str_impl() argument
256 zend_constant *c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len); in zend_get_constant_str_impl()
261 c = zend_get_halt_offset_constant(name, name_len); in zend_get_constant_str_impl()
266 return zend_get_special_const(name, name_len); in zend_get_constant_str_impl()
269 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
271 zend_constant *c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_str()
278 static zend_constant *zend_get_constant_impl(zend_string *name) in zend_get_constant_impl() argument
280 zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); in zend_get_constant_impl()
285 c = zend_get_halt_offset_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
290 return zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
293 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
295 zend_constant *c = zend_get_constant_impl(name); in zend_get_constant()
400 const char *name = ZSTR_VAL(cname); in zend_get_constant_ex() local
404 if (name[0] == '\\') { in zend_get_constant_ex()
405 name += 1; in zend_get_constant_ex()
410 if ((colon = zend_memrchr(name, ':', name_len)) && in zend_get_constant_ex()
411 colon > name && (*(colon - 1) == ':')) { in zend_get_constant_ex()
412 int class_name_len = colon - name - 1; in zend_get_constant_ex()
415 zend_string *class_name = zend_string_init_interned(name, class_name_len, 0); in zend_get_constant_ex()
496 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
498 int prefix_len = colon - name; in zend_get_constant_ex()
508 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
526 c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_ex()
532 zend_throw_error(NULL, "Undefined constant \"%s\"", name); in zend_get_constant_ex()
538 zend_error(E_DEPRECATED, "Constant %s is deprecated", name); in zend_get_constant_ex()
559 zend_string *name; in zend_register_constant() local
567 const char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
569 lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), persistent); in zend_register_constant()
570 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
572 name = lowercase_name; in zend_register_constant()
574 name = c->name; in zend_register_constant()
578 if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") in zend_register_constant()
579 || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name))) in zend_register_constant()
580 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL in zend_register_constant()
582 zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
583 zend_string_release(c->name); in zend_register_constant()