Lines Matching refs:res

45 ZEND_API int ZEND_FASTCALL zend_list_delete(zend_resource *res)  in zend_list_delete()  argument
47 if (GC_DELREF(res) <= 0) { in zend_list_delete()
48 return zend_hash_index_del(&EG(regular_list), res->handle); in zend_list_delete()
54 ZEND_API int ZEND_FASTCALL zend_list_free(zend_resource *res) in zend_list_free() argument
56 if (GC_REFCOUNT(res) <= 0) { in zend_list_free()
57 return zend_hash_index_del(&EG(regular_list), res->handle); in zend_list_free()
63 static void zend_resource_dtor(zend_resource *res) in zend_resource_dtor() argument
66 zend_resource r = *res; in zend_resource_dtor()
68 res->type = -1; in zend_resource_dtor()
69 res->ptr = NULL; in zend_resource_dtor()
82 ZEND_API int ZEND_FASTCALL zend_list_close(zend_resource *res) in zend_list_close() argument
84 if (GC_REFCOUNT(res) <= 0) { in zend_list_close()
85 return zend_list_free(res); in zend_list_close()
86 } else if (res->type >= 0) { in zend_list_close()
87 zend_resource_dtor(res); in zend_list_close()
101 ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resourc… in zend_fetch_resource2() argument
103 if (res) { in zend_fetch_resource2()
104 if (resource_type1 == res->type) { in zend_fetch_resource2()
105 return res->ptr; in zend_fetch_resource2()
108 if (resource_type2 == res->type) { in zend_fetch_resource2()
109 return res->ptr; in zend_fetch_resource2()
122 ZEND_API void *zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource… in zend_fetch_resource() argument
124 if (resource_type == res->type) { in zend_fetch_resource()
125 return res->ptr; in zend_fetch_resource()
137 ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type) in zend_fetch_resource_ex() argument
140 if (res == NULL) { in zend_fetch_resource_ex()
147 if (Z_TYPE_P(res) != IS_RESOURCE) { in zend_fetch_resource_ex()
155 return zend_fetch_resource(Z_RES_P(res), resource_type_name, resource_type); in zend_fetch_resource_ex()
158 ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type… in zend_fetch_resource2_ex() argument
161 if (res == NULL) { in zend_fetch_resource2_ex()
168 if (Z_TYPE_P(res) != IS_RESOURCE) { in zend_fetch_resource2_ex()
176 return zend_fetch_resource2(Z_RES_P(res), resource_type_name, resource_type1, resource_type2); in zend_fetch_resource2_ex()
181 zend_resource *res = Z_RES_P(zv); in list_entry_destructor() local
184 if (res->type >= 0) { in list_entry_destructor()
185 zend_resource_dtor(res); in list_entry_destructor()
187 efree_size(res, sizeof(zend_resource)); in list_entry_destructor()
192 zend_resource *res = Z_RES_P(zv); in plist_entry_destructor() local
194 if (res->type >= 0) { in plist_entry_destructor()
197 ld = zend_hash_index_find_ptr(&list_destructors, res->type); in plist_entry_destructor()
200 ld->plist_dtor_ex(res); in plist_entry_destructor()
203 zend_error(E_WARNING,"Unknown list entry type (%d)", res->type); in plist_entry_destructor()
206 free(res); in plist_entry_destructor()
225 zend_resource *res = Z_PTR_P(zv); in zend_close_rsrc() local
227 if (res->type >= 0) { in zend_close_rsrc()
228 zend_resource_dtor(res); in zend_close_rsrc()
326 const char *zend_rsrc_list_get_rsrc_type(zend_resource *res) in zend_rsrc_list_get_rsrc_type() argument
330 lde = zend_hash_index_find_ptr(&list_destructors, res->type); in zend_rsrc_list_get_rsrc_type()