Lines Matching refs:res
47 ZEND_API int zend_list_delete(zend_resource *res) in zend_list_delete() argument
49 if (--GC_REFCOUNT(res) <= 0) { in zend_list_delete()
50 return zend_hash_index_del(&EG(regular_list), res->handle); in zend_list_delete()
56 ZEND_API int zend_list_free(zend_resource *res) in zend_list_free() argument
58 if (GC_REFCOUNT(res) <= 0) { in zend_list_free()
59 return zend_hash_index_del(&EG(regular_list), res->handle); in zend_list_free()
65 static void zend_resource_dtor(zend_resource *res) in zend_resource_dtor() argument
68 zend_resource r = *res; in zend_resource_dtor()
70 res->type = -1; in zend_resource_dtor()
71 res->ptr = NULL; in zend_resource_dtor()
84 ZEND_API int zend_list_close(zend_resource *res) in zend_list_close() argument
86 if (GC_REFCOUNT(res) <= 0) { in zend_list_close()
87 return zend_list_free(res); in zend_list_close()
88 } else if (res->type >= 0) { in zend_list_close()
89 zend_resource_dtor(res); in zend_list_close()
103 ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resourc… in zend_fetch_resource2() argument
105 if (res) { in zend_fetch_resource2()
106 if (resource_type1 == res->type) { in zend_fetch_resource2()
107 return res->ptr; in zend_fetch_resource2()
110 if (resource_type2 == res->type) { in zend_fetch_resource2()
111 return res->ptr; in zend_fetch_resource2()
124 ZEND_API void *zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource… in zend_fetch_resource() argument
126 if (resource_type == res->type) { in zend_fetch_resource()
127 return res->ptr; in zend_fetch_resource()
139 ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type) in zend_fetch_resource_ex() argument
142 if (res == NULL) { in zend_fetch_resource_ex()
149 if (Z_TYPE_P(res) != IS_RESOURCE) { in zend_fetch_resource_ex()
157 return zend_fetch_resource(Z_RES_P(res), resource_type_name, resource_type); in zend_fetch_resource_ex()
160 ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type… in zend_fetch_resource2_ex() argument
163 if (res == NULL) { in zend_fetch_resource2_ex()
170 if (Z_TYPE_P(res) != IS_RESOURCE) { in zend_fetch_resource2_ex()
178 return zend_fetch_resource2(Z_RES_P(res), resource_type_name, resource_type1, resource_type2); in zend_fetch_resource2_ex()
183 zend_resource *res = Z_RES_P(zv); in list_entry_destructor() local
186 if (res->type >= 0) { in list_entry_destructor()
187 zend_resource_dtor(res); in list_entry_destructor()
189 efree_size(res, sizeof(zend_resource)); in list_entry_destructor()
194 zend_resource *res = Z_RES_P(zv); in plist_entry_destructor() local
196 if (res->type >= 0) { in plist_entry_destructor()
199 ld = zend_hash_index_find_ptr(&list_destructors, res->type); in plist_entry_destructor()
202 ld->plist_dtor_ex(res); in plist_entry_destructor()
205 zend_error(E_WARNING,"Unknown list entry type (%d)", res->type); in plist_entry_destructor()
208 free(res); in plist_entry_destructor()
227 zend_resource *res = Z_PTR_P(zv); in zend_close_rsrc() local
229 if (res->type >= 0) { in zend_close_rsrc()
230 zend_resource_dtor(res); in zend_close_rsrc()
328 const char *zend_rsrc_list_get_rsrc_type(zend_resource *res) in zend_rsrc_list_get_rsrc_type() argument
332 lde = zend_hash_index_find_ptr(&list_destructors, res->type); in zend_rsrc_list_get_rsrc_type()