library/src/databases/bpdb/BP-DB.cc
// looks up a table by a table n
looks up a table by a table n
looks up a table by a table n
P_BP_HASH_TABLE_KEYED_ENTRY BP_DBLookupTableByName(P_BPDB bpdb, char * table_name)
{
	if(!table_name)
		return NULL;
	if(!BP_StringIsReasonableForTableNameDB(table_name, bpstrlen(table_name)))
		return NULL;
	char * table_path[10];
	BP_ZERO_STACK(table_path);
	table_path[0] = "tables";
	table_path[1] = table_name;
	table_path[2] = NULL;
	P_BP_HASH_TABLE_KEYED_ENTRY table = (P_BP_HASH_TABLE_KEYED_ENTRY) BP_HashRegLookupTableByPath(bpdb->system_hreg, (char **) &table_path);
	return table;
}
P_BP_HASH_TABLE_KEYED_ENTRY BP_DBLookupTableByName ( P_BPDB bpdb , char * table_name ) { if ( ! table_name ) return NULL ; if ( ! BP_StringIsReasonableForTableNameDB ( table_name , bpstrlen ( table_name ) ) ) return NULL ; char * table_path [ 10 ] ; BP_ZERO_STACK ( table_path ) ; table_path [ 0 ] = " " ; table_path [ 1 ] = table_name ; table_path [ 2 ] = NULL ; P_BP_HASH_TABLE_KEYED_ENTRY table = ( P_BP_HASH_TABLE_KEYED_ENTRY ) BP_HashRegLookupTableByPath ( bpdb -> system_hreg , ( char * * ) & table_path ) ; return table ; }
looks up a table by a table n
looks up a table by a table n
// ensure we have a table name // ensure name is reasonable for table // create table path stack // set table name for lookup // lookup table // table name (or null if unfound)