1999-04-07 18:10:10 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
|
|
|
+----------------------------------------------------------------------+
|
1999-07-19 20:02:12 +00:00
|
|
|
| This source file is subject to version 0.91 of the Zend license, |
|
1999-07-16 14:58:16 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
1999-07-19 20:02:12 +00:00
|
|
|
| http://www.zend.com/license/0_91.txt. |
|
1999-07-16 14:58:16 +00:00
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
1999-04-07 18:10:10 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
1999-07-16 14:58:16 +00:00
|
|
|
|
1999-04-07 18:10:10 +00:00
|
|
|
#ifndef _LIST_H
|
|
|
|
#define _LIST_H
|
|
|
|
|
|
|
|
#include "zend_hash.h"
|
1999-04-21 19:10:54 +00:00
|
|
|
#include "zend_globals.h"
|
1999-04-07 18:10:10 +00:00
|
|
|
|
|
|
|
extern HashTable list_destructors;
|
|
|
|
|
1999-05-22 16:10:51 +00:00
|
|
|
typedef struct _list_entry {
|
1999-04-07 18:10:10 +00:00
|
|
|
void *ptr;
|
|
|
|
int type;
|
|
|
|
int refcount;
|
|
|
|
} list_entry;
|
|
|
|
|
1999-05-22 16:10:51 +00:00
|
|
|
typedef struct _list_destructors_entry {
|
1999-04-07 18:10:10 +00:00
|
|
|
void (*list_destructor)(void *);
|
|
|
|
void (*plist_destructor)(void *);
|
|
|
|
int module_number;
|
|
|
|
int resource_id;
|
|
|
|
} list_destructors_entry;
|
|
|
|
|
|
|
|
#define register_list_destructors(ld,pld) _register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
|
|
|
|
ZEND_API int _register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
|
|
|
|
|
|
|
|
enum list_entry_type {
|
|
|
|
LE_DB=1000
|
|
|
|
};
|
|
|
|
|
1999-07-09 17:24:47 +00:00
|
|
|
int list_entry_destructor(void *ptr);
|
|
|
|
int plist_entry_destructor(void *ptr);
|
1999-04-07 18:10:10 +00:00
|
|
|
|
|
|
|
int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number);
|
1999-04-21 17:26:37 +00:00
|
|
|
int init_resource_list(ELS_D);
|
|
|
|
int init_resource_plist(ELS_D);
|
1999-04-07 18:10:10 +00:00
|
|
|
void destroy_resource_list(void);
|
|
|
|
void destroy_resource_plist(void);
|
|
|
|
|
1999-06-04 11:44:02 +00:00
|
|
|
ZEND_API int zend_list_insert(void *ptr, int type);
|
|
|
|
ZEND_API int zend_plist_insert(void *ptr, int type);
|
|
|
|
ZEND_API int zend_list_addref(int id);
|
|
|
|
ZEND_API int zend_list_delete(int id);
|
|
|
|
ZEND_API int zend_plist_delete(int id);
|
|
|
|
ZEND_API void *zend_list_find(int id, int *type);
|
|
|
|
ZEND_API void *zend_plist_find(int id, int *type);
|
|
|
|
|
|
|
|
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
|
1999-04-07 18:10:10 +00:00
|
|
|
|
|
|
|
#endif
|