/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* hash table library interface definitions
*
* NOTE: new code should use the more general <cdt.h>
*/
#ifndef _HASH_H
#define _HASH_H
#include <hashpart.h>
#define hashgetbucket(s) ((Hash_bucket_t*)((s)-((sizeof(Hash_bucket_t)+sizeof(char*)-1)/sizeof(char*))*sizeof(char*)))
/*
* DEPRECATED renames for compatibility
*/
/*
* the #define's avoid union tags
*/
unsigned int hash; /* hash flags and value */ \
char* name /* key name */
char* value /* key value */
typedef struct /* bucket header */
{
{
};
typedef struct /* hash scan bucket position */
{
#ifdef _HASH_POSITION_PRIVATE_
#endif
typedef struct /* last lookup cache */
{
#ifdef _HASH_LAST_PRIVATE_
#endif
} Hash_last_t;
{
#ifdef _HASH_ROOT_PRIVATE_
#endif
};
{
#ifdef _HASH_TABLE_PRIVATE_
#endif
};
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
extern void hashdone(Hash_position_t*);
extern void hashdump(Hash_table_t*, int);
extern char* hashlook(Hash_table_t*, const char*, long, const char*);
extern void hashsize(Hash_table_t*, int);
extern int hashwalk(Hash_table_t*, int, int (*)(const char*, char*, void*), void*);
#undef extern
#endif