/*
   +----------------------------------------------------------------------+
   | Zend Engine                                                          |
   +----------------------------------------------------------------------+
   | Copyright (c) 1998-2003 Zend Technologies Ltd. (http://www.zend.com) |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.00 of the Zend license,     |
   | that is bundled with this package in the file LICENSE, and is        | 
   | available at through the world-wide-web at                           |
   | http://www.zend.com/license/2_00.txt.                                |
   | 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.              |
   +----------------------------------------------------------------------+
   | Authors: Sterling Hughes <sterling@php.net>                          |
   +----------------------------------------------------------------------+
*/

/* $Id: $ */

#ifndef ZEND_FAST_HASH_H
#define ZEND_FAST_HASH_H

#include "zend.h"

BEGIN_EXTERN_C()

typedef int (*zend_fast_hash_dtor_func_t)(void * TSRMLS_DC);

typedef struct _zend_fast_hash_slist {
	struct _zend_fast_hash_slist *next;

	char *key;
	int   key_len;

	unsigned long hval;

	void *ptr;
} zend_fast_hash_slist;	

typedef struct {
	zend_fast_hash_slist **table;
	int slots;
	int size;
	zend_bool persistent;
	zend_fast_hash_dtor_func_t dtor;
} zend_fast_hash;

ZEND_API void zend_fast_hash_init(zend_fast_hash *, int, zend_bool, zend_fast_hash_dtor_func_t TSRMLS_DC);
ZEND_API int  zend_fast_hash_update(zend_fast_hash *, char *, int, const void * TSRMLS_DC);
ZEND_API int  zend_fast_hash_find(zend_fast_hash *, char *, int, void ** TSRMLS_DC);
ZEND_API int  zend_fast_hash_delete(zend_fast_hash *, char *, int TSRMLS_DC);
ZEND_API void zend_fast_hash_apply(zend_fast_hash *, apply_func_t TSRMLS_DC);
ZEND_API void zend_fast_hash_apply_with_argument(zend_fast_hash *, apply_func_arg_t, void * TSRMLS_DC);
ZEND_API int  zend_fast_hash_count(zend_fast_hash * TSRMLS_DC);
ZEND_API void zend_fast_hash_clean(zend_fast_hash * TSRMLS_DC);
ZEND_API void zend_fast_hash_destroy(zend_fast_hash * TSRMLS_DC);
	
END_EXTERN_C()

#endif

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: t
 * End:
 */
