Lines Matching refs:intern

101 	spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object;  in spl_SplOjectStorage_free_storage()  local
103 zend_object_std_dtor(&intern->std TSRMLS_CC); in spl_SplOjectStorage_free_storage()
105 zend_hash_destroy(&intern->storage); in spl_SplOjectStorage_free_storage()
107 if (intern->debug_info != NULL) { in spl_SplOjectStorage_free_storage()
108 zend_hash_destroy(intern->debug_info); in spl_SplOjectStorage_free_storage()
109 efree(intern->debug_info); in spl_SplOjectStorage_free_storage()
112 if (intern->gcdata != NULL) { in spl_SplOjectStorage_free_storage()
113 efree(intern->gcdata); in spl_SplOjectStorage_free_storage()
119 static char *spl_object_storage_get_hash(spl_SplObjectStorage *intern, zval *this, zval *obj, int … in spl_object_storage_get_hash() argument
120 if (intern->fptr_get_hash) { in spl_object_storage_get_hash()
122 …zend_call_method_with_1_params(&this, intern->std.ce, &intern->fptr_get_hash, "getHash", &rv, obj); in spl_object_storage_get_hash()
174 static void spl_object_storage_free_hash(spl_SplObjectStorage *intern, char *hash) { in spl_object_storage_free_hash() argument
175 if (intern->fptr_get_hash) { in spl_object_storage_free_hash()
192 spl_SplObjectStorageElement* spl_object_storage_get(spl_SplObjectStorage *intern, char *hash, int h… in spl_object_storage_get() argument
195 if (zend_hash_find(&intern->storage, hash, hash_len, (void**)&element) == SUCCESS) { in spl_object_storage_get()
202 void spl_object_storage_attach(spl_SplObjectStorage *intern, zval *this, zval *obj, zval *inf TSRML… in spl_object_storage_attach() argument
207 char *hash = spl_object_storage_get_hash(intern, this, obj, &hash_len TSRMLS_CC); in spl_object_storage_attach()
212 pelement = spl_object_storage_get(intern, hash, hash_len TSRMLS_CC); in spl_object_storage_attach()
222 spl_object_storage_free_hash(intern, hash); in spl_object_storage_attach()
228 …zend_hash_update(&intern->storage, hash, hash_len, &element, sizeof(spl_SplObjectStorageElement), … in spl_object_storage_attach()
229 spl_object_storage_free_hash(intern, hash); in spl_object_storage_attach()
232 int spl_object_storage_detach(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {{{… in spl_object_storage_detach() argument
235 char *hash = spl_object_storage_get_hash(intern, this, obj, &hash_len TSRMLS_CC); in spl_object_storage_detach()
239 ret = zend_hash_del(&intern->storage, hash, hash_len); in spl_object_storage_detach()
240 spl_object_storage_free_hash(intern, hash); in spl_object_storage_detach()
245 void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_SplObjectStorage *othe… in spl_object_storage_addall() argument
251 spl_object_storage_attach(intern, this, element->obj, element->inf TSRMLS_CC); in spl_object_storage_addall()
255 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in spl_object_storage_addall()
256 intern->index = 0; in spl_object_storage_addall()
262 spl_SplObjectStorage *intern; in spl_object_storage_new_ex() local
265 intern = emalloc(sizeof(spl_SplObjectStorage)); in spl_object_storage_new_ex()
266 memset(intern, 0, sizeof(spl_SplObjectStorage)); in spl_object_storage_new_ex()
267 *obj = intern; in spl_object_storage_new_ex()
269 zend_object_std_init(&intern->std, class_type TSRMLS_CC); in spl_object_storage_new_ex()
270 object_properties_init(&intern->std, class_type); in spl_object_storage_new_ex()
272 zend_hash_init(&intern->storage, 0, NULL, (void (*)(void *))spl_object_storage_dtor, 0); in spl_object_storage_new_ex()
274 …retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_obj… in spl_object_storage_new_ex()
279 spl_object_storage_addall(intern, orig, other TSRMLS_CC); in spl_object_storage_new_ex()
285 …&class_type->function_table, "gethash", sizeof("gethash"), (void **) &intern->fptr_get_hash); in spl_object_storage_new_ex()
286 if (intern->fptr_get_hash->common.scope == spl_ce_SplObjectStorage) { in spl_object_storage_new_ex()
287 intern->fptr_get_hash = NULL; in spl_object_storage_new_ex()
307 spl_SplObjectStorage *intern; in spl_object_storage_clone() local
310 new_obj_val = spl_object_storage_new_ex(old_object->ce, &intern, zobject TSRMLS_CC); in spl_object_storage_clone()
311 new_object = &intern->std; in spl_object_storage_clone()
321 spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(obj TSRMLS_CC); in spl_object_storage_debug_info() local
334 if (intern->debug_info == NULL) { in spl_object_storage_debug_info()
335 ALLOC_HASHTABLE(intern->debug_info); in spl_object_storage_debug_info()
336 ZEND_INIT_SYMTABLE_EX(intern->debug_info, zend_hash_num_elements(props) + 1, 0); in spl_object_storage_debug_info()
339 if (intern->debug_info->nApplyCount == 0) { in spl_object_storage_debug_info()
340 …zend_hash_copy(intern->debug_info, props, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(z… in spl_object_storage_debug_info()
345 zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); in spl_object_storage_debug_info()
346 while (zend_hash_get_current_data_ex(&intern->storage, (void **)&element, &pos) == SUCCESS) { in spl_object_storage_debug_info()
356 zend_hash_move_forward_ex(&intern->storage, &pos); in spl_object_storage_debug_info()
360 zend_symtable_update(intern->debug_info, zname, name_len+1, &storage, sizeof(zval *), NULL); in spl_object_storage_debug_info()
364 return intern->debug_info; in spl_object_storage_debug_info()
372 spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(obj TSRMLS_CC); in spl_object_storage_get_gc() local
376 if (intern->storage.nNumOfElements * 2 > intern->gcdata_num) { in spl_object_storage_get_gc()
377 intern->gcdata_num = intern->storage.nNumOfElements * 2; in spl_object_storage_get_gc()
378 intern->gcdata = (zval**)erealloc(intern->gcdata, sizeof(zval*) * intern->gcdata_num); in spl_object_storage_get_gc()
381 zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); in spl_object_storage_get_gc()
382 while (zend_hash_get_current_data_ex(&intern->storage, (void **)&element, &pos) == SUCCESS) { in spl_object_storage_get_gc()
383 intern->gcdata[i++] = element->obj; in spl_object_storage_get_gc()
384 intern->gcdata[i++] = element->inf; in spl_object_storage_get_gc()
385 zend_hash_move_forward_ex(&intern->storage, &pos); in spl_object_storage_get_gc()
388 *table = intern->gcdata; in spl_object_storage_get_gc()
428 int spl_object_storage_contains(spl_SplObjectStorage *intern, zval *this, zval *obj TSRMLS_DC) /* {… in spl_object_storage_contains() argument
431 char *hash = spl_object_storage_get_hash(intern, this, obj, &hash_len TSRMLS_CC); in spl_object_storage_contains()
436 found = zend_hash_exists(&intern->storage, hash, hash_len); in spl_object_storage_contains()
437 spl_object_storage_free_hash(intern, hash); in spl_object_storage_contains()
447 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
452 spl_object_storage_attach(intern, getThis(), obj, inf TSRMLS_CC); in SPL_METHOD()
460 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
465 spl_object_storage_detach(intern, getThis(), obj TSRMLS_CC); in SPL_METHOD()
467 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
468 intern->index = 0; in SPL_METHOD()
495 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
503 hash = spl_object_storage_get_hash(intern, getThis(), obj, &hash_len TSRMLS_CC); in SPL_METHOD()
508 element = spl_object_storage_get(intern, hash, hash_len TSRMLS_CC); in SPL_METHOD()
509 spl_object_storage_free_hash(intern, hash); in SPL_METHOD()
523 …spl_SplObjectStorage *intern = (spl_SplObjectStorage *)zend_object_store_get_object(getThis() TSRM… in SPL_METHOD() local
532 spl_object_storage_addall(intern, getThis(), other TSRMLS_CC); in SPL_METHOD()
534 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in SPL_METHOD()
542 …spl_SplObjectStorage *intern = (spl_SplObjectStorage *)zend_object_store_get_object(getThis() TSRM… in SPL_METHOD() local
554 if (spl_object_storage_detach(intern, getThis(), element->obj TSRMLS_CC) == FAILURE) { in SPL_METHOD()
559 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
560 intern->index = 0; in SPL_METHOD()
562 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in SPL_METHOD()
570 …spl_SplObjectStorage *intern = (spl_SplObjectStorage *)zend_object_store_get_object(getThis() TSRM… in SPL_METHOD() local
580 zend_hash_internal_pointer_reset(&intern->storage); in SPL_METHOD()
581 while (zend_hash_get_current_data(&intern->storage, (void **)&element) == SUCCESS) { in SPL_METHOD()
583 spl_object_storage_detach(intern, getThis(), element->obj TSRMLS_CC); in SPL_METHOD()
585 zend_hash_move_forward(&intern->storage); in SPL_METHOD()
588 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
589 intern->index = 0; in SPL_METHOD()
591 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in SPL_METHOD()
600 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
605 RETURN_BOOL(spl_object_storage_contains(intern, getThis(), obj TSRMLS_CC)); in SPL_METHOD()
612 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
618 RETURN_LONG(zend_hash_num_elements(&intern->storage)); in SPL_METHOD()
625 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
631 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
632 intern->index = 0; in SPL_METHOD()
639 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
645 RETURN_BOOL(zend_hash_has_more_elements_ex(&intern->storage, &intern->pos) == SUCCESS); in SPL_METHOD()
652 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
658 RETURN_LONG(intern->index); in SPL_METHOD()
666 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
672 if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == FAILURE) { in SPL_METHOD()
683 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
689 if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == FAILURE) { in SPL_METHOD()
700 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
707 if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == FAILURE) { in SPL_METHOD()
719 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
725 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in SPL_METHOD()
726 intern->index++; in SPL_METHOD()
733 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
750 ZVAL_LONG(flags, zend_hash_num_elements(&intern->storage)); in SPL_METHOD()
754 zend_hash_internal_pointer_reset_ex(&intern->storage, &pos); in SPL_METHOD()
756 while(zend_hash_has_more_elements_ex(&intern->storage, &pos) == SUCCESS) { in SPL_METHOD()
757 if (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &pos) == FAILURE) { in SPL_METHOD()
766 zend_hash_move_forward_ex(&intern->storage, &pos); in SPL_METHOD()
793 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
861 hash = spl_object_storage_get_hash(intern, getThis(), pentry, &hash_len TSRMLS_CC); in SPL_METHOD()
867 pelement = spl_object_storage_get(intern, hash, hash_len TSRMLS_CC); in SPL_METHOD()
868 spl_object_storage_free_hash(intern, hash); in SPL_METHOD()
877 spl_object_storage_attach(intern, getThis(), pentry, pinf TSRMLS_CC); in SPL_METHOD()
901 if (!intern->std.properties) { in SPL_METHOD()
902 rebuild_object_properties(&intern->std); in SPL_METHOD()
904 …zend_hash_copy(intern->std.properties, Z_ARRVAL_P(pmembers), (copy_ctor_func_t) zval_add_ref, (voi… in SPL_METHOD()
995 spl_SplObjectStorage *intern; in SPL_METHOD() local
1006 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1007 intern->flags = flags; in SPL_METHOD()
1016 …spl_SplObjectStorage *intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRML… in SPL_METHOD() local
1021 RETURN_LONG(intern->flags); in SPL_METHOD()
1029 spl_SplObjectStorage *intern; in SPL_METHOD() local
1030 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1032 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &intern->flags) == FAILURE) { in SPL_METHOD()
1042 spl_SplObjectStorage *intern; in SPL_METHOD() local
1049 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1060 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1061 …while (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == SUCCESS)… in SPL_METHOD()
1067 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1071 spl_object_storage_attach(intern, getThis(), iterator, info TSRMLS_CC); in SPL_METHOD()
1079 spl_SplObjectStorage *intern; in SPL_METHOD() local
1083 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1089 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1090 …while (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == SUCCESS … in SPL_METHOD()
1093 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1102 spl_SplObjectStorage *intern; in SPL_METHOD() local
1106 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1112 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1113 …while (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == SUCCESS … in SPL_METHOD()
1116 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1125 spl_SplObjectStorage *intern; in SPL_METHOD() local
1130 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1136 if (!zend_hash_num_elements(&intern->storage)) { in SPL_METHOD()
1140 expect = (intern->flags & MIT_NEED_ALL) ? 1 : 0; in SPL_METHOD()
1142 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1143 …while (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == SUCCESS … in SPL_METHOD()
1158 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in SPL_METHOD()
1165 static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_type, zval *return_… in spl_multiple_iterator_get_all() argument
1171 num_elements = zend_hash_num_elements(&intern->storage); in spl_multiple_iterator_get_all()
1178 zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos); in spl_multiple_iterator_get_all()
1179 …while (zend_hash_get_current_data_ex(&intern->storage, (void**)&element, &intern->pos) == SUCCESS … in spl_multiple_iterator_get_all()
1200 } else if (intern->flags & MIT_NEED_ALL) { in spl_multiple_iterator_get_all()
1211 if (intern->flags & MIT_KEYS_ASSOC) { in spl_multiple_iterator_get_all()
1228 zend_hash_move_forward_ex(&intern->storage, &intern->pos); in spl_multiple_iterator_get_all()
1237 spl_SplObjectStorage *intern; in SPL_METHOD() local
1238 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1244 …spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT, return_value TSRMLS_C… in SPL_METHOD()
1252 spl_SplObjectStorage *intern; in SPL_METHOD() local
1253 intern = (spl_SplObjectStorage*)zend_object_store_get_object(getThis() TSRMLS_CC); in SPL_METHOD()
1259 spl_multiple_iterator_get_all(intern, SPL_MULTIPLE_ITERATOR_GET_ALL_KEY, return_value TSRMLS_CC); in SPL_METHOD()