Lines Matching refs:name

46 		if (c->name) {  in free_zend_constant()
47 zend_string_release_ex(c->name, 0); in free_zend_constant()
55 if (c->name) { in free_zend_constant()
56 zend_string_release_ex(c->name, 1); in free_zend_constant()
76 c->name = zend_string_copy(c->name); in copy_zend_constant()
128 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
134 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
138 ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, bool bval, int flags, … in zend_register_bool_constant() argument
144 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
148 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
154 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
159 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
165 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
170 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, const char *strval,… in zend_register_stringl_constant() argument
176 c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
181 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, const char *strval, … in zend_register_string_constant() argument
183 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
186 static zend_constant *zend_get_halt_offset_constant(const char *name, size_t name_len) in zend_get_halt_offset_constant() argument
194 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_halt_offset_constant()
212 ZEND_API zend_constant *_zend_get_special_const(const char *name, size_t len) /* {{{ */ in _zend_get_special_const() argument
215 if ((name[0] == 'n' || name[0] == 'N') && in _zend_get_special_const()
216 (name[1] == 'u' || name[1] == 'U') && in _zend_get_special_const()
217 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
218 (name[3] == 'l' || name[3] == 'L') in _zend_get_special_const()
222 if ((name[0] == 't' || name[0] == 'T') && in _zend_get_special_const()
223 (name[1] == 'r' || name[1] == 'R') && in _zend_get_special_const()
224 (name[2] == 'u' || name[2] == 'U') && in _zend_get_special_const()
225 (name[3] == 'e' || name[3] == 'E') in _zend_get_special_const()
230 if ((name[0] == 'f' || name[0] == 'F') && in _zend_get_special_const()
231 (name[1] == 'a' || name[1] == 'A') && in _zend_get_special_const()
232 (name[2] == 'l' || name[2] == 'L') && in _zend_get_special_const()
233 (name[3] == 's' || name[3] == 'S') && in _zend_get_special_const()
234 (name[4] == 'e' || name[4] == 'E') in _zend_get_special_const()
256 static zend_constant *zend_get_constant_str_impl(const char *name, size_t name_len) in zend_get_constant_str_impl() argument
258 zend_constant *c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len); in zend_get_constant_str_impl()
263 c = zend_get_halt_offset_constant(name, name_len); in zend_get_constant_str_impl()
268 return zend_get_special_const(name, name_len); in zend_get_constant_str_impl()
271 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
273 zend_constant *c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_str()
280 ZEND_API zend_constant *zend_get_constant_ptr(zend_string *name) in zend_get_constant_ptr() argument
282 zend_constant *c = zend_hash_find_ptr(EG(zend_constants), name); in zend_get_constant_ptr()
287 c = zend_get_halt_offset_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_ptr()
292 return zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant_ptr()
295 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
297 zend_constant *c = zend_get_constant_ptr(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()
426 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
428 int prefix_len = colon - name; in zend_get_constant_ex()
438 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
456 c = zend_get_constant_str_impl(name, name_len); in zend_get_constant_ex()
462 zend_throw_error(NULL, "Undefined constant \"%s\"", name); in zend_get_constant_ex()
468 zend_error(E_DEPRECATED, "Constant %s is deprecated", name); in zend_get_constant_ex()
489 zend_string *name; in zend_register_constant() local
497 const char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
499 lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), persistent); in zend_register_constant()
500 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
502 name = lowercase_name; in zend_register_constant()
504 name = c->name; in zend_register_constant()
516 if (zend_string_equals_literal(name, "__COMPILER_HALT_OFFSET__") in zend_register_constant()
517 || (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name))) in zend_register_constant()
518 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL in zend_register_constant()
520 zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
521 zend_string_release(c->name); in zend_register_constant()