Lines Matching refs:attr
30 void validate_attribute(zend_attribute *attr, uint32_t target, zend_class_entry *scope) in validate_attribute() argument
33 if (attr->argc > 0) { in validate_attribute()
39 if (FAILURE == zend_get_attribute_value(&flags, attr, 0, NULL)) { in validate_attribute()
73 zend_attribute *attr; in get_attribute() local
75 ZEND_HASH_FOREACH_PTR(attributes, attr) { in get_attribute()
76 if (attr->offset == offset && zend_string_equals(attr->lcname, lcname)) { in get_attribute()
77 return attr; in get_attribute()
88 zend_attribute *attr; in get_attribute_str() local
90 ZEND_HASH_FOREACH_PTR(attributes, attr) { in get_attribute_str()
91 if (attr->offset == offset && ZSTR_LEN(attr->lcname) == len) { in get_attribute_str()
92 if (0 == memcmp(ZSTR_VAL(attr->lcname), str, len)) { in get_attribute_str()
93 return attr; in get_attribute_str()
122 ZEND_API zend_result zend_get_attribute_value(zval *ret, zend_attribute *attr, uint32_t i, zend_cla… in zend_get_attribute_value() argument
124 if (i >= attr->argc) { in zend_get_attribute_value()
128 ZVAL_COPY_OR_DUP(ret, &attr->args[i].value); in zend_get_attribute_value()
166 ZEND_API zend_bool zend_is_attribute_repeated(HashTable *attributes, zend_attribute *attr) in zend_is_attribute_repeated() argument
171 if (other != attr && other->offset == attr->offset) { in zend_is_attribute_repeated()
172 if (zend_string_equals(other->lcname, attr->lcname)) { in zend_is_attribute_repeated()
183 zend_attribute *attr = Z_PTR_P(v); in attr_free() local
184 bool persistent = attr->flags & ZEND_ATTRIBUTE_PERSISTENT; in attr_free()
186 zend_string_release(attr->name); in attr_free()
187 zend_string_release(attr->lcname); in attr_free()
189 for (uint32_t i = 0; i < attr->argc; i++) { in attr_free()
190 if (attr->args[i].name) { in attr_free()
191 zend_string_release(attr->args[i].name); in attr_free()
194 zval_internal_ptr_dtor(&attr->args[i].value); in attr_free()
196 zval_ptr_dtor(&attr->args[i].value); in attr_free()
200 pefree(attr, persistent); in attr_free()
211 zend_attribute *attr = pemalloc(ZEND_ATTRIBUTE_SIZE(argc), persistent); in zend_add_attribute() local
214 attr->name = zend_string_copy(name); in zend_add_attribute()
216 attr->name = zend_string_dup(name, persistent); in zend_add_attribute()
219 attr->lcname = zend_string_tolower_ex(attr->name, persistent); in zend_add_attribute()
220 attr->flags = flags; in zend_add_attribute()
221 attr->lineno = lineno; in zend_add_attribute()
222 attr->offset = offset; in zend_add_attribute()
223 attr->argc = argc; in zend_add_attribute()
227 attr->args[i].name = NULL; in zend_add_attribute()
228 ZVAL_UNDEF(&attr->args[i].value); in zend_add_attribute()
231 zend_hash_next_index_insert_ptr(*attributes, attr); in zend_add_attribute()
233 return attr; in zend_add_attribute()
257 zend_attribute *attr = zend_add_class_attribute(ce, zend_ce_attribute->name, 1); in zend_internal_attribute_register() local
258 ZVAL_LONG(&attr->args[0].value, flags); in zend_internal_attribute_register()
271 zend_internal_attribute *attr; in zend_register_attribute_ce() local
296 attr = zend_internal_attribute_register(zend_ce_attribute, ZEND_ATTRIBUTE_TARGET_CLASS); in zend_register_attribute_ce()
297 attr->validator = validate_attribute; in zend_register_attribute_ce()