#include <stdio.h>
#include <Foundation/NSHashTable.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSAutoreleasePool.h>

int main ()
{
NSHashTable *ht;
NSHashEnumerator he;
int i;
void *v;
NSAutoreleasePool *arp = [NSAutoreleasePool new];

  /* Test with ints */

	ht = NSCreateHashTable (NSIntHashCallBacks, 0);
	
	printf ("Inserting integers into hashtable \n", (int)v);
	for (i = 1; i < 16; i++)
		NSHashInsert (ht, (void*)i);
	
	printf ("Removing integer 3 from hashtable \n", (int)v);
	NSHashRemove (ht, (void*)3);
	
	printf ("Enumerating hashtable \n", (int)v);
	he = NSEnumerateHashTable (ht);
	while ((v = NSNextHashEnumeratorItem (&he)))
		printf ("(%d) ", (int)v);
	printf ("\n");
	
	NSFreeHashTable (ht);
	
	[arp release];
	printf("nshashtable test complete\n");
	exit (0);
}
