testset.c 547 Bytes
#include <stdio.h>

#include "trbase.h"
#include "trdata.h"

int
main (int argc, char * argv[])
{
	TR_Set set = TR_new(TR_Set);

	set->free_msgs = 0;

	TR_setAdd(set, "a");
	TR_setAdd(set, "b");
	TR_setAdd(set, "c");

	TR_iterableForeach(set) {
		printf("%s\n", (char *)TR_iterableCurrent(set));
	}

	TR_setDelete(set, "a");
	TR_setDelete(set, "b");
	TR_setAdd(set, "b");
	TR_setAdd(set, "a");

	TR_iterableForeach(set) {
		printf("%s\n", (char *)TR_iterableCurrent(set));
	}

	TR_delete(set);
	TR_cleanup();

	return 0;
}

// vim: set ts=4 sw=4: