/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* 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
*/
#include "hashlib.h"
/*
* hash table sequential scan
*
* Hash_position_t* pos;
* Hash_bucket_t* b;
* pos = hashscan(tab, flags);
* while (b = hashnext(&pos)) ...;
* hashdone(pos);
*/
/*
* return pos for scan on table
*/
{
{
do
{
register Hash_bucket_t* b;
{
b->hash &= ~HASH_HIDDEN;
}
}
return(pos);
}
/*
* return next scan element
*/
{
register Hash_bucket_t* b;
for (;;)
{
if (!(b = b->next))
{
do
{
{
}
}
if (!(b->hash & HASH_DELETED) && (!(pos->tab->flags & HASH_VALUE) || b->value) && (!pos->flags || !(b->hash & (HASH_HIDDEN|HASH_HIDES)))) break;
if (b->hash & HASH_HIDES)
{
if (!(h->hash & HASH_HIDDEN))
{
h->hash |= HASH_HIDDEN;
if (!(b->hash & HASH_DELETED)) break;
}
}
else b->hash &= ~HASH_HIDDEN;
}
}
/*
* terminate scan
*/
void
{
if (pos)
{
}
}