library/src/datastructures/BP-HashTable.cc
// iterate through all hashes and display
iterate through all hashes and display
iterate through all hashes and display
HASH_ITER(hh, entry_table, entry, tmp)
		{
			if(entry == table)
				continue;
			data_destroy_status  = ERR_FAILURE;
			table_destroy_status = ERR_FAILURE;
			if(entry->type != BP_HASH_TABLE_KEYED_ENTRY_TYPE_NAMED_HASH_TABLE)
			{
				data_destroy_status = BP_HashRegDestroyKeyedEntryData
				(
					hreg,
					entry
				);
				if(data_destroy_status == ERR_FAILURE)
				{
					return ERR_FAILURE;
				}
			}
			else
			{
				table_destroy_status = BP_HashRegDestroyTable_r
				(
					hreg,
					entry
				);
				if(table_destroy_status == ERR_FAILURE)
				{
					return ERR_FAILURE;
				}
			}
		}
HASH_ITER ( hh , entry_table , entry , tmp ) { if ( entry == table ) continue ; data_destroy_status = ERR_FAILURE ; table_destroy_status = ERR_FAILURE ; if ( entry -> type != BP_HASH_TABLE_KEYED_ENTRY_TYPE_NAMED_HASH_TABLE ) { data_destroy_status = BP_HashRegDestroyKeyedEntryData ( hreg , entry ) ; if ( data_destroy_status == ERR_FAILURE ) { return ERR_FAILURE ; } } else { table_destroy_status = BP_HashRegDestroyTable_r ( hreg , entry ) ; if ( table_destroy_status == ERR_FAILURE ) { return ERR_FAILURE ; } } }
iterate through all hashes and display
iterate through all hashes and display
// always skip self references // reset lock status on loop // It's either a data entry or a hash table.  If it's data, just lock it.  If it's a table, // check out the tables member elements. // printf("\n Destroying data!: %s", entry->key); // destroy the keyed entry at this position // exit if the lock failed // printf("\n [!!] Failed to destroy data."); // printf("\n Destroying table!: %s", entry->key); // recurse and destroy lower tables/data // exit if the destruction fails // printf("\n Failed to destroy: %s", entry->key);