summaryrefslogtreecommitdiff
path: root/Zend/zend_list.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-03-28 15:32:52 +0000
committerZeev Suraski <zeev@php.net>2001-03-28 15:32:52 +0000
commit3492049c8690cd3be4c5ca11c2a7b5ef40ada3ed (patch)
treebdb27b68eeed1d2c1f7503c29bf81e49430e2577 /Zend/zend_list.c
parent3d3d8881c6061739b8687f4e635670c0d78ab0e1 (diff)
downloadphp-git-3492049c8690cd3be4c5ca11c2a7b5ef40ada3ed.tar.gz
Get rid of more redundant code
Diffstat (limited to 'Zend/zend_list.c')
-rw-r--r--Zend/zend_list.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index fbdd774367..3f2020d9b4 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -31,7 +31,7 @@ ZEND_API int le_index_ptr;
static HashTable list_destructors;
-static inline int zend_list_do_insert(HashTable *list, void *ptr, int type)
+ZEND_API int zend_list_insert(void *ptr, int type)
{
int index;
zend_rsrc_list_entry le;
@@ -40,12 +40,12 @@ static inline int zend_list_do_insert(HashTable *list, void *ptr, int type)
le.type=type;
le.refcount=1;
- index = zend_hash_next_free_element(list);
- zend_hash_index_update(list, index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
+ index = zend_hash_next_free_element(&EG(regular_list));
+ zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
return index;
}
-static inline int zend_list_do_delete(HashTable *list,int id)
+ZEND_API int zend_list_delete(int id)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
@@ -63,11 +63,11 @@ static inline int zend_list_do_delete(HashTable *list,int id)
}
-static inline void *zend_list_do_find(HashTable *list,int id, int *type)
+ZEND_API void *zend_list_find(int id, int *type)
{
zend_rsrc_list_entry *le;
- if (zend_hash_index_find(list, id, (void **) &le)==SUCCESS) {
+ if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
*type = le->type;
return le->ptr;
} else {
@@ -77,14 +77,6 @@ static inline void *zend_list_do_find(HashTable *list,int id, int *type)
}
-ZEND_API int zend_list_insert(void *ptr, int type)
-{
- ELS_FETCH();
-
- return zend_list_do_insert(&EG(regular_list), ptr, type);
-}
-
-
ZEND_API int zend_list_addref(int id)
{
zend_rsrc_list_entry *le;
@@ -100,22 +92,6 @@ ZEND_API int zend_list_addref(int id)
}
-ZEND_API int zend_list_delete(int id)
-{
- ELS_FETCH();
-
- return zend_list_do_delete(&EG(regular_list), id);
-}
-
-
-ZEND_API void *zend_list_find(int id, int *type)
-{
- ELS_FETCH();
-
- return zend_list_do_find(&EG(regular_list), id, type);
-}
-
-
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
int rsrc_id;