library/src/databases/bpdb/BP-DB.cc
// destroy all registered sql syntax generators
destroy all registered sql syntax generators
destroy all registered sql syntax generators
BP_ERROR_T BP_DBDestroyAllRegisteredSQLSyntaxGenerators(P_BPDB bpdb)
{
	if(!bpdb)
		return ERR_FAILURE;
	if(!bpdb->sqlgen_reg)
		return ERR_FAILURE;
	BP_HashRegDisplay(bpdb->sqlgen_reg, BP_FALSE, BP_TRUE);
	if(bpdb->sqlgen_reg->hive)
	{
		BP_HASH_ITER_OPEN(bpdb->sqlgen_reg->hive, sqlgen_table_entry)
		{
			BP_HASH_ITER_OPEN((P_BP_HTKE) sqlgen_table_entry->data, sqlgen_entry)
			{
				P_BPDB_SQLGEN curr_sqlgen = (P_BPDB_SQLGEN) sqlgen_entry->data;
				BP_DBSGClose(curr_sqlgen);
			}
			BP_HASH_ITER_CLOSE;
		}
		BP_HASH_ITER_CLOSE;
	}
	BP_DestroyHashTableRegistry(bpdb->sqlgen_reg);
	bpdb->sqlgen_reg = NULL;
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DBDestroyAllRegisteredSQLSyntaxGenerators ( P_BPDB bpdb ) { if ( ! bpdb ) return ERR_FAILURE ; if ( ! bpdb -> sqlgen_reg ) return ERR_FAILURE ; BP_HashRegDisplay ( bpdb -> sqlgen_reg , BP_FALSE , BP_TRUE ) ; if ( bpdb -> sqlgen_reg -> hive ) { BP_HASH_ITER_OPEN ( bpdb -> sqlgen_reg -> hive , sqlgen_table_entry ) { BP_HASH_ITER_OPEN ( ( P_BP_HTKE ) sqlgen_table_entry -> data , sqlgen_entry ) { P_BPDB_SQLGEN curr_sqlgen = ( P_BPDB_SQLGEN ) sqlgen_entry -> data ; BP_DBSGClose ( curr_sqlgen ) ; } BP_HASH_ITER_CLOSE ; } BP_HASH_ITER_CLOSE ; } BP_DestroyHashTableRegistry ( bpdb -> sqlgen_reg ) ; bpdb -> sqlgen_reg = NULL ; return ERR_SUCCESS ; }
destroy all registered sql syntax generators
destroy all registered sql syntax generators
// ensure that we have a bpdb structure to work with // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Iterate through SQL Generators And Destroy %%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // display the hash table registry // iterate through hash entries // iterate through table // iterate through entries // set current sql generator // close the current sql generator // destroy the sqlgen hash table registry // nullify the current registry // return indicating success