示例#1
0
Hash_Entry *
Hash_EnumFirst(Hash_Table *t, Hash_Search *searchPtr)
{
	searchPtr->tablePtr = t;
	searchPtr->nextIndex = 0;
	searchPtr->hashEntryPtr = NULL;
	return Hash_EnumNext(searchPtr);
}
示例#2
0
文件: hash.c 项目: coyizumi/cs111
Hash_Entry *
Hash_EnumFirst(
	Hash_Table *t,			/* Table to be searched. */
	register Hash_Search *searchPtr)/* Area in which to keep state
					 * about search.*/
{
	searchPtr->tablePtr = t;
	searchPtr->nextIndex = 0;
	searchPtr->hashEntryPtr = NULL;
	return Hash_EnumNext(searchPtr);
}
示例#3
0
/*
 *---------------------------------------------------------
 *
 * Hash_EnumFirst --
 *	This procedure sets things up for a complete search
 *	of all entries recorded in the hash table.
 *
 * Results:
 *	The return value is the address of the first entry in
 *	the hash table, or NULL if the table is empty.
 *
 * Side Effects:
 *	The information in searchPtr is initialized so that successive
 *	calls to Hash_Next will return successive HashEntry's
 *	from the table.
 *
 *---------------------------------------------------------
 */
bool VidscaleSHMIntf::
Hash_EnumFirst(SHM_Hash_Table *t, Hash_Search *searchPtr)
{

	(searchPtr->tablePtr) = t;
	(searchPtr->nextIndex) = 0;
	(searchPtr->nextOffsetHashEntry) = t->offsetHashEntry[0];
#if 0
        while(0 == (searchPtr->nextOffsetHashEntry))
        {
            (*(searchPtr->nextIndex))++;
	    *(searchPtr->nextOffsetHashEntry) = t->offsetHashEntry[*(searchPtr->nextIndex)];
        }
#endif
	return (Hash_EnumNext(searchPtr));
}
示例#4
0
文件: arch.c 项目: 0mp/freebsd
/*-
 *-----------------------------------------------------------------------
 * ArchFree --
 *	Free memory used by an archive
 *
 * Results:
 *	None.
 *
 * Side Effects:
 *	None.
 *
 *-----------------------------------------------------------------------
 */
static void
ArchFree(void *ap)
{
    Arch *a = (Arch *)ap;
    Hash_Search	  search;
    Hash_Entry	  *entry;

    /* Free memory from hash entries */
    for (entry = Hash_EnumFirst(&a->members, &search);
	 entry != NULL;
	 entry = Hash_EnumNext(&search))
	free(Hash_GetValue(entry));

    free(a->name);
    free(a->fnametab);
    Hash_DeleteTable(&a->members);
    free(a);
}