예제 #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);
}