Lines Matching refs:attr
39 uint32_t zend_attribute_attribute_get_flags(zend_attribute *attr, zend_class_entry *scope) in zend_attribute_attribute_get_flags() argument
42 if (attr->argc > 0) { in zend_attribute_attribute_get_flags()
45 if (FAILURE == zend_get_attribute_value(&flags, attr, 0, scope)) { in zend_attribute_attribute_get_flags()
72 zend_attribute *attr, uint32_t target, zend_class_entry *scope) in validate_allow_dynamic_properties() argument
199 zend_attribute *attr; in get_attribute() local
201 ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) { in get_attribute()
202 if (attr->offset == offset && zend_string_equals(attr->lcname, lcname)) { in get_attribute()
203 return attr; in get_attribute()
214 zend_attribute *attr; in get_attribute_str() local
216 ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) { in get_attribute_str()
217 if (attr->offset == offset && zend_string_equals_cstr(attr->lcname, str, len)) { in get_attribute_str()
218 return attr; in get_attribute_str()
246 ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_cla… in zend_get_attribute_value() argument
248 if (i >= attr->argc) { in zend_get_attribute_value()
252 ZVAL_COPY_OR_DUP(ret, &attr->args[i].value); in zend_get_attribute_value()
377 ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr) in zend_is_attribute_repeated() argument
382 if (other != attr && other->offset == attr->offset) { in zend_is_attribute_repeated()
383 if (zend_string_equals(other->lcname, attr->lcname)) { in zend_is_attribute_repeated()
394 zend_attribute *attr = Z_PTR_P(v); in attr_free() local
395 bool persistent = attr->flags & ZEND_ATTRIBUTE_PERSISTENT; in attr_free()
397 zend_string_release(attr->name); in attr_free()
398 zend_string_release(attr->lcname); in attr_free()
400 for (uint32_t i = 0; i < attr->argc; i++) { in attr_free()
401 if (attr->args[i].name) { in attr_free()
402 zend_string_release(attr->args[i].name); in attr_free()
405 zval_internal_ptr_dtor(&attr->args[i].value); in attr_free()
407 zval_ptr_dtor(&attr->args[i].value); in attr_free()
411 pefree(attr, persistent); in attr_free()
422 zend_attribute *attr = pemalloc(ZEND_ATTRIBUTE_SIZE(argc), persistent); in zend_add_attribute() local
425 attr->name = zend_string_copy(name); in zend_add_attribute()
427 attr->name = zend_string_dup(name, persistent); in zend_add_attribute()
430 attr->lcname = zend_string_tolower_ex(attr->name, persistent); in zend_add_attribute()
431 attr->flags = flags; in zend_add_attribute()
432 attr->lineno = lineno; in zend_add_attribute()
433 attr->offset = offset; in zend_add_attribute()
434 attr->argc = argc; in zend_add_attribute()
438 attr->args[i].name = NULL; in zend_add_attribute()
439 ZVAL_UNDEF(&attr->args[i].value); in zend_add_attribute()
442 zend_hash_next_index_insert_ptr(*attributes, attr); in zend_add_attribute()
444 return attr; in zend_add_attribute()
455 zend_attribute *attr; in zend_mark_internal_attribute() local
461 ZEND_HASH_FOREACH_PTR(ce->attributes, attr) { in zend_mark_internal_attribute()
462 if (zend_string_equals(attr->name, zend_ce_attribute->name)) { in zend_mark_internal_attribute()
465 internal_attr->flags = Z_LVAL(attr->args[0].value); in zend_mark_internal_attribute()
481 zend_attribute *attr = zend_add_class_attribute(ce, zend_ce_attribute->name, 1); in zend_internal_attribute_register() local
482 ZVAL_LONG(&attr->args[0].value, flags); in zend_internal_attribute_register()
494 zend_internal_attribute *attr; in zend_register_attribute_ce() local
499 attr = zend_mark_internal_attribute(zend_ce_attribute); in zend_register_attribute_ce()
505 attr = zend_mark_internal_attribute(zend_ce_allow_dynamic_properties); in zend_register_attribute_ce()
506 attr->validator = validate_allow_dynamic_properties; in zend_register_attribute_ce()
522 attr = zend_mark_internal_attribute(zend_ce_deprecated); in zend_register_attribute_ce()