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()
136 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
142 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
146 ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, … in zend_register_bool_constant() argument
152 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
156 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
162 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
167 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
173 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
178 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval,… in zend_register_stringl_constant() argument
184 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
189 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, … in zend_register_string_constant() argument
191 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
194 static zend_constant *zend_get_halt_offset_constant(const char *name, size_t name_len) in zend_get_halt_offset_constant() argument
202 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_halt_offset_constant()
220 ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t len) /* {{{ */ in _zend_get_special_const() argument
223 if ((name[0] == 'n' || name[0] == 'N') && in _zend_get_special_const()
224 (name[1] == 'u' || name[1] == 'U') && in _zend_get_special_const()
225 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
226 (name[3] == 'l' || name[3] == 'L') in _zend_get_special_const()
230 if ((name[0] == 't' || name[0] == 'T') && in _zend_get_special_const()
231 (name[1] == 'r' || name[1] == 'R') && in _zend_get_special_const()
232 (name[2] == 'u' || name[2] == 'U') && in _zend_get_special_const()
233 (name[3] == 'e' || name[3] == 'E') in _zend_get_special_const()
238 if ((name[0] == 'f' || name[0] == 'F') && in _zend_get_special_const()
239 (name[1] == 'a' || name[1] == 'A') && in _zend_get_special_const()
240 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
241 (name[3] == 's' || name[3] == 'S') && in _zend_get_special_const()
242 (name[4] == 'e' || name[4] == 'E') in _zend_get_special_const()
264 static zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len) in zend_get_constant_str_impl() argument
266 zend_constant *c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len); in zend_get_constant_str_impl()
271 c = zend_get_halt_offset_constant(name, name_len); in zend_get_constant_str_impl()
276 return zend_get_special_const(name, name_len); in zend_get_constant_str_impl()
279 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
281 zend_constant *c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_str()
288 static zend_constant *zend_get_constant_impl(zend_string *name) in zend_get_constant_impl() argument
290 zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); in zend_get_constant_impl()
295 c = zend_get_halt_offset_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
300 return zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
303 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
305 zend_constant *c = zend_get_constant_impl(name); in zend_get_constant()
402 const char *name = ZSTR_VAL(cname); in zend_get_constant_ex() local
406 if (name[0] == '\\') { in zend_get_constant_ex()
407 name += 1; in zend_get_constant_ex()
412 if ((colon = zend_memrchr(name, ':', name_len)) && in zend_get_constant_ex()
413 colon > name && (*(colon - 1) == ':')) { in zend_get_constant_ex()
414 int class_name_len = colon - name - 1; in zend_get_constant_ex()
417 zend_string *class_name = zend_string_init_interned(name, class_name_len, 0); in zend_get_constant_ex()
498 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
500 int prefix_len = colon - name; in zend_get_constant_ex()
510 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
528 c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_ex()
534 zend_throw_error(NULL, "Undefined constant \"%s\"", name); in zend_get_constant_ex()
540 zend_error(E_DEPRECATED, "Constant %s is deprecated", name); in zend_get_constant_ex()
561 zend_string *name; in zend_register_constant() local
569 const char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
571 lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), persistent); in zend_register_constant()
572 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
574 name = lowercase_name; in zend_register_constant()
576 name = c->name; in zend_register_constant()
580 if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") in zend_register_constant()
581 || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name))) in zend_register_constant()
582 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL in zend_register_constant()
584 zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
585 zend_string_release(c->name); in zend_register_constant()