Lines Matching refs:name
40 if (c->name) { in free_zend_constant()
41 zend_string_release(c->name); in free_zend_constant()
55 c->name = zend_string_copy(c->name); in copy_zend_constant()
165 ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int flags, int module_… in zend_register_null_constant() argument
171 c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); in zend_register_null_constant()
176 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
182 c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); in zend_register_bool_constant()
187 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
193 c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); in zend_register_long_constant()
199 ZEND_API void zend_register_double_constant(const char *name, size_t name_len, double dval, int fla… in zend_register_double_constant() argument
205 c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); in zend_register_double_constant()
211 ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len, char *strval, size_… in zend_register_stringl_constant() argument
217 c.name = zend_string_init(name, name_len, flags & CONST_PERSISTENT); in zend_register_stringl_constant()
223 ZEND_API void zend_register_string_constant(const char *name, size_t name_len, char *strval, int fl… in zend_register_string_constant() argument
225 zend_register_stringl_constant(name, name_len, strval, strlen(strval), flags, module_number); in zend_register_string_constant()
228 static zend_constant *zend_get_special_constant(const char *name, size_t name_len) in zend_get_special_constant() argument
236 !memcmp(name, "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) { in zend_get_special_constant()
267 ZEND_API zval *zend_get_constant_str(const char *name, size_t name_len) in zend_get_constant_str() argument
272 if ((c = zend_hash_str_find_ptr(EG(zend_constants), name, name_len)) == NULL) { in zend_get_constant_str()
274 zend_str_tolower_copy(lcname, name, name_len); in zend_get_constant_str()
280 c = zend_get_special_constant(name, name_len); in zend_get_constant_str()
288 ZEND_API zval *zend_get_constant(zend_string *name) in zend_get_constant() argument
293 if ((c = zend_hash_find_ptr(EG(zend_constants), name)) == NULL) { in zend_get_constant()
294 char *lcname = do_alloca(ZSTR_LEN(name) + 1, use_heap); in zend_get_constant()
295 zend_str_tolower_copy(lcname, ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant()
296 if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, ZSTR_LEN(name))) != NULL) { in zend_get_constant()
301 c = zend_get_special_constant(ZSTR_VAL(name), ZSTR_LEN(name)); in zend_get_constant()
314 const char *name = ZSTR_VAL(cname); in zend_get_constant_ex() local
318 if (name[0] == '\\') { in zend_get_constant_ex()
319 name += 1; in zend_get_constant_ex()
324 if ((colon = zend_memrchr(name, ':', name_len)) && in zend_get_constant_ex()
325 colon > name && (*(colon - 1) == ':')) { in zend_get_constant_ex()
326 int class_name_len = colon - name - 1; in zend_get_constant_ex()
329 zend_string *class_name = zend_string_init(name, class_name_len, 0); in zend_get_constant_ex()
398 if ((colon = zend_memrchr(name, '\\', name_len)) != NULL) { in zend_get_constant_ex()
400 int prefix_len = colon - name; in zend_get_constant_ex()
409 zend_str_tolower_copy(lcname, name, prefix_len); in zend_get_constant_ex()
438 return zend_get_constant_str(name, name_len); in zend_get_constant_ex()
486 zend_string *name; in zend_register_constant() local
494 lowercase_name = zend_string_alloc(ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT); in zend_register_constant()
495 zend_str_tolower_copy(ZSTR_VAL(lowercase_name), ZSTR_VAL(c->name), ZSTR_LEN(c->name)); in zend_register_constant()
497 name = lowercase_name; in zend_register_constant()
499 char *slash = strrchr(ZSTR_VAL(c->name), '\\'); in zend_register_constant()
501 …lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), c->flags & CONST_PERSISTEN… in zend_register_constant()
502 zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name)); in zend_register_constant()
504 name = lowercase_name; in zend_register_constant()
506 name = c->name; in zend_register_constant()
511 if ((ZSTR_LEN(c->name) == sizeof("__COMPILER_HALT_OFFSET__")-1 in zend_register_constant()
512 && !memcmp(ZSTR_VAL(name), "__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__")-1)) in zend_register_constant()
513 || zend_hash_add_constant(EG(zend_constants), name, c) == NULL) { in zend_register_constant()
516 if (ZSTR_VAL(c->name)[0] == '\0' && ZSTR_LEN(c->name) > sizeof("\0__COMPILER_HALT_OFFSET__")-1 in zend_register_constant()
517 …&& memcmp(ZSTR_VAL(name), "\0__COMPILER_HALT_OFFSET__", sizeof("\0__COMPILER_HALT_OFFSET__")) == 0… in zend_register_constant()
519 zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name)); in zend_register_constant()
520 zend_string_release(c->name); in zend_register_constant()