Lines Matching refs:attr
37 void validate_attribute(zend_attribute *attr, uint32_t target, zend_class_entry *scope) in validate_attribute() argument
41 uint32_t zend_attribute_attribute_get_flags(zend_attribute *attr, zend_class_entry *scope) in zend_attribute_attribute_get_flags() argument
44 if (attr->argc > 0) { in zend_attribute_attribute_get_flags()
47 if (FAILURE == zend_get_attribute_value(&flags, attr, 0, scope)) { in zend_attribute_attribute_get_flags()
74 zend_attribute *attr, uint32_t target, zend_class_entry *scope) in validate_allow_dynamic_properties() argument
162 zend_attribute *attr; in get_attribute() local
164 ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) { in get_attribute()
165 if (attr->offset == offset && zend_string_equals(attr->lcname, lcname)) { in get_attribute()
166 return attr; in get_attribute()
177 zend_attribute *attr; in get_attribute_str() local
179 ZEND_HASH_PACKED_FOREACH_PTR(attributes, attr) { in get_attribute_str()
180 if (attr->offset == offset && zend_string_equals_cstr(attr->lcname, str, len)) { in get_attribute_str()
181 return attr; in get_attribute_str()
209 ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_cla… in zend_get_attribute_value() argument
211 if (i >= attr->argc) { in zend_get_attribute_value()
215 ZVAL_COPY_OR_DUP(ret, &attr->args[i].value); in zend_get_attribute_value()
253 ZEND_API bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr) in zend_is_attribute_repeated() argument
258 if (other != attr && other->offset == attr->offset) { in zend_is_attribute_repeated()
259 if (zend_string_equals(other->lcname, attr->lcname)) { in zend_is_attribute_repeated()
270 zend_attribute *attr = Z_PTR_P(v); in attr_free() local
271 bool persistent = attr->flags & ZEND_ATTRIBUTE_PERSISTENT; in attr_free()
273 zend_string_release(attr->name); in attr_free()
274 zend_string_release(attr->lcname); in attr_free()
276 for (uint32_t i = 0; i < attr->argc; i++) { in attr_free()
277 if (attr->args[i].name) { in attr_free()
278 zend_string_release(attr->args[i].name); in attr_free()
281 zval_internal_ptr_dtor(&attr->args[i].value); in attr_free()
283 zval_ptr_dtor(&attr->args[i].value); in attr_free()
287 pefree(attr, persistent); in attr_free()
298 zend_attribute *attr = pemalloc(ZEND_ATTRIBUTE_SIZE(argc), persistent); in zend_add_attribute() local
301 attr->name = zend_string_copy(name); in zend_add_attribute()
303 attr->name = zend_string_dup(name, persistent); in zend_add_attribute()
306 attr->lcname = zend_string_tolower_ex(attr->name, persistent); in zend_add_attribute()
307 attr->flags = flags; in zend_add_attribute()
308 attr->lineno = lineno; in zend_add_attribute()
309 attr->offset = offset; in zend_add_attribute()
310 attr->argc = argc; in zend_add_attribute()
314 attr->args[i].name = NULL; in zend_add_attribute()
315 ZVAL_UNDEF(&attr->args[i].value); in zend_add_attribute()
318 zend_hash_next_index_insert_ptr(*attributes, attr); in zend_add_attribute()
320 return attr; in zend_add_attribute()
331 zend_attribute *attr; in zend_mark_internal_attribute() local
337 ZEND_HASH_FOREACH_PTR(ce->attributes, attr) { in zend_mark_internal_attribute()
338 if (zend_string_equals(attr->name, zend_ce_attribute->name)) { in zend_mark_internal_attribute()
341 internal_attr->flags = Z_LVAL(attr->args[0].value); in zend_mark_internal_attribute()
357 zend_attribute *attr = zend_add_class_attribute(ce, zend_ce_attribute->name, 1); in zend_internal_attribute_register() local
358 ZVAL_LONG(&attr->args[0].value, flags); in zend_internal_attribute_register()
370 zend_internal_attribute *attr; in zend_register_attribute_ce() local
375 attr = zend_mark_internal_attribute(zend_ce_attribute); in zend_register_attribute_ce()
376 attr->validator = validate_attribute; in zend_register_attribute_ce()
382 attr = zend_mark_internal_attribute(zend_ce_allow_dynamic_properties); in zend_register_attribute_ce()
383 attr->validator = validate_allow_dynamic_properties; in zend_register_attribute_ce()