Lines Matching refs:name
45 if (c->name) { in free_zend_constant()
46 zend_string_release_ex(c->name, 0); in free_zend_constant()
51 if (c->name) { in free_zend_constant()
52 zend_string_release_ex(c->name, 1); in free_zend_constant()
69 c->name = zend_string_copy(c->name); in copy_zend_constant()
151 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
157 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
161 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
167 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
171 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
177 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
182 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
188 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
193 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval,… in zend_register_stringl_constant() argument
199 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
204 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, … in zend_register_string_constant() argument
206 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
209 static zend_constant *zend_get_halt_offset_constant(const char *name, size_t name_len) in zend_get_halt_offset_constant() argument
217 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_halt_offset_constant()
235 ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t len) /* {{{ */ in _zend_get_special_const() argument
238 if ((name[0] == 'n' || name[0] == 'N') && in _zend_get_special_const()
239 (name[1] == 'u' || name[1] == 'U') && in _zend_get_special_const()
240 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
241 (name[3] == 'l' || name[3] == 'L') in _zend_get_special_const()
245 if ((name[0] == 't' || name[0] == 'T') && in _zend_get_special_const()
246 (name[1] == 'r' || name[1] == 'R') && in _zend_get_special_const()
247 (name[2] == 'u' || name[2] == 'U') && in _zend_get_special_const()
248 (name[3] == 'e' || name[3] == 'E') in _zend_get_special_const()
253 if ((name[0] == 'f' || name[0] == 'F') && in _zend_get_special_const()
254 (name[1] == 'a' || name[1] == 'A') && in _zend_get_special_const()
255 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
256 (name[3] == 's' || name[3] == 'S') && in _zend_get_special_const()
257 (name[4] == 'e' || name[4] == 'E') in _zend_get_special_const()
279 static zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len) in zend_get_constant_str_impl() argument
281 zend_constant *c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len); in zend_get_constant_str_impl()
286 c = zend_get_halt_offset_constant(name, name_len); in zend_get_constant_str_impl()
291 return zend_get_special_const(name, name_len); in zend_get_constant_str_impl()
294 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
296 zend_constant *c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_str()
303 static zend_constant *zend_get_constant_impl(zend_string *name) in zend_get_constant_impl() argument
305 zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); in zend_get_constant_impl()
310 c = zend_get_halt_offset_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
315 return zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_impl()
318 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
320 zend_constant *c = zend_get_constant_impl(name); in zend_get_constant()
332 const char *name = ZSTR_VAL(cname); in zend_get_constant_ex() local
336 if (name[0] == '\\') { in zend_get_constant_ex()
337 name += 1; in zend_get_constant_ex()
342 if ((colon = zend_memrchr(name, ':', name_len)) && in zend_get_constant_ex()
343 colon > name && (*(colon - 1) == ':')) { in zend_get_constant_ex()
344 int class_name_len = colon - name - 1; in zend_get_constant_ex()
347 zend_string *class_name = zend_string_init(name, class_name_len, 0); in zend_get_constant_ex()
420 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
422 int prefix_len = colon - name; in zend_get_constant_ex()
432 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
450 c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_ex()
456 zend_throw_error(NULL, "Undefined constant \"%s\"", name); in zend_get_constant_ex()
462 zend_error(E_DEPRECATED, "Constant %s is deprecated", name); in zend_get_constant_ex()
483 zend_string *name; in zend_register_constant() local
491 char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
493 lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), persistent); in zend_register_constant()
494 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
496 name = lowercase_name; in zend_register_constant()
498 name = c->name; in zend_register_constant()
502 if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") in zend_register_constant()
503 || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name))) in zend_register_constant()
504 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL in zend_register_constant()
506 zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
507 zend_string_release(c->name); in zend_register_constant()