Lines Matching refs:name
42 if (c->name) { in free_zend_constant()
43 zend_string_release_ex(c->name, 0); in free_zend_constant()
48 if (c->name) { in free_zend_constant()
49 zend_string_release_ex(c->name, 1); in free_zend_constant()
66 c->name = zend_string_copy(c->name); in copy_zend_constant()
149 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
155 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
159 ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zend_bool bval, int fl… in zend_register_bool_constant() argument
165 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
169 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
175 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
180 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
186 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
191 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_… in zend_register_stringl_constant() argument
197 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
202 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int fl… in zend_register_string_constant() argument
204 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
207 static zend_constant *zend_get_special_constant(const char *name, size_t name_len) in zend_get_special_constant() argument
215 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_special_constant()
246 static inline zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len) in zend_get_constant_str_impl() argument
251 if ((c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len)) == NULL) { in zend_get_constant_str_impl()
253 zend_str_tolower_copy(lcname, name, name_len); in zend_get_constant_str_impl()
259 c = zend_get_special_constant(name, name_len); in zend_get_constant_str_impl()
267 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
269 zend_constant *c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_str()
273 static inline zend_constant *zend_get_constant_impl(zend_string *name) in zend_get_constant_impl() argument
279 zv = zend_hash_find(EG(zend_constants), name); in zend_get_constant_impl()
281 char *lcname = do_alloca(ZSTR_LEN(name) + 1, use_heap); in zend_get_constant_impl()
282 zend_str_tolower_copy(lcname, ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
283 zv = zend_hash_str_find(EG(zend_constants), lcname, ZSTR_LEN(name)); in zend_get_constant_impl()
290 c = zend_get_special_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
299 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
301 zend_constant *c = zend_get_constant_impl(name); in zend_get_constant()
306 const char *ns_sep = zend_memrchr(ZSTR_VAL(c->name), '\\', ZSTR_LEN(c->name)); in is_access_deprecated()
309 size_t shortname_offset = ns_sep - ZSTR_VAL(c->name) + 1; in is_access_deprecated()
310 size_t shortname_len = ZSTR_LEN(c->name) - shortname_offset; in is_access_deprecated()
313 ZSTR_VAL(c->name) + shortname_offset, in is_access_deprecated()
318 return memcmp(access_name, ZSTR_VAL(c->name), ZSTR_LEN(c->name)) != 0; in is_access_deprecated()
327 const char *name = ZSTR_VAL(cname); in zend_get_constant_ex() local
331 if (name[0] == '\\') { in zend_get_constant_ex()
332 name += 1; in zend_get_constant_ex()
337 if ((colon = zend_memrchr(name, ':', name_len)) && in zend_get_constant_ex()
338 colon > name && (*(colon - 1) == ':')) { in zend_get_constant_ex()
339 int class_name_len = colon - name - 1; in zend_get_constant_ex()
342 zend_string *class_name = zend_string_init(name, class_name_len, 0); in zend_get_constant_ex()
415 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
417 int prefix_len = colon - name; in zend_get_constant_ex()
426 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
450 name = constant_name; in zend_get_constant_ex()
456 c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_ex()
465 if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST)) && is_access_deprecated(c, name)) { in zend_get_constant_ex()
469 ZSTR_VAL(c->name)); in zend_get_constant_ex()
492 zend_string *name; in zend_register_constant() local
500 lowercase_name = zend_string_tolower_ex(c->name, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT); in zend_register_constant()
502 name = lowercase_name; in zend_register_constant()
504 char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
506 …lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), ZEND_CONSTANT_FLAGS(c) & C… in zend_register_constant()
507 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
509 name = lowercase_name; in zend_register_constant()
511 name = c->name; in zend_register_constant()
516 if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") in zend_register_constant()
517 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL) { in zend_register_constant()
520 if (ZSTR_VAL(c->name)[0] == '\0' && ZSTR_LEN(c->name) > sizeof("\0__COMPILER_HALT_OFFSET__")-1 in zend_register_constant()
521 …&& memcmp(ZSTR_VAL(name), "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0… in zend_register_constant()
523 zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
524 zend_string_release(c->name); in zend_register_constant()