library/src/utility/BP-StringFormattingSessions.cc
// add a string entry to a column using a string entry pointer.  This is not a
// copy oriented routine.  This routine simply stores the string entry pointer
// within the column.  Again, the string_entry and related data is NOT duplicated,
// only a reference is stored.
add a string entry to a column using a string entry pointer.  This is not a
copy oriented routine.  This routine simply stores the string entry pointer
within the column.  Again, the string_entry and related data is NOT duplicated,
only a reference is stored.
add a string entry to a column using a string entry pointer . This is not a copy oriented routine . This routine simply stores the string entry pointer within the column . Again the string_entry and related data is NOT duplicated only a reference is stored .
BP_ERROR_T BP_AddStringEntryToColumnSFSession
(
	P_BP_SF_SESSION sfs,
	char * row_group_identifier,
	char * row_identifier,
	char * column_group_identifier,
	char * column_identifier,
	P_BP_SFS_STRING_ENTRY string_entry,
	P_BP_STRING_ROW_BORDER_SET border_set
)
{
	if(!sfs)
		return ERR_FAILURE;
	if(!sfs->tq)
		return ERR_FAILURE;
	if(!row_group_identifier || !row_identifier || !column_group_identifier || !column_identifier)
		return ERR_FAILURE;
	BP_SFS_SEARCH_QUERY search_query;
	BP_ZERO_STACK(search_query);
	search_query.row_group_id    = row_group_identifier;
	search_query.row_id          = row_identifier;
	search_query.column_group_id = column_group_identifier;
	search_query.column_id       = column_identifier;
	P_BP_SFS_SEARCH_RESULTS sfs_search_results = BP_SearchStringFormattingSession
	(
			sfs,
			&search_query
	);
	if(!sfs_search_results)
		return ERR_FAILURE;
	if(!sfs_search_results->result_n || !sfs_search_results->results)
		return ERR_FAILURE;
	if(!sfs_search_results->results[0].row_group)
	if(!sfs_search_results->results[0].row)
	if(!sfs_search_results->results[0].column_group)
	if(!sfs_search_results->results[0].column)
	{
		tq_free(sfs->tq, sfs_search_results);
		return ERR_FAILURE;
	}
	%%
	%%
	P_BP_SFS_STRING_COLUMN column = sfs_search_results->results[0].column;
	column->entries++;
	column->col_data = (P_BP_SFS_STRING_ENTRY *) tq_realloc
	(
			sfs->tq,
			column->col_data,
			sizeof(P_BP_SFS_STRING_ENTRY) * (column->entries + 1),
			BPLN
	);
	if(!column->col_data)
	{
		tq_free(sfs->tq, column);
		return ERR_FAILURE;
	}
	column->col_data[column->entries-1] = string_entry;
	if(column->widest_column < string_entry->string_length)
		column->widest_column = string_entry->string_length;
	tq_free(sfs->tq, sfs_search_results);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_AddStringEntryToColumnSFSession ( P_BP_SF_SESSION sfs , char * row_group_identifier , char * row_identifier , char * column_group_identifier , char * column_identifier , P_BP_SFS_STRING_ENTRY string_entry , P_BP_STRING_ROW_BORDER_SET border_set ) { if ( ! sfs ) return ERR_FAILURE ; if ( ! sfs -> tq ) return ERR_FAILURE ; if ( ! row_group_identifier || ! row_identifier || ! column_group_identifier || ! column_identifier ) return ERR_FAILURE ; BP_SFS_SEARCH_QUERY search_query ; BP_ZERO_STACK ( search_query ) ; search_query . row_group_id = row_group_identifier ; search_query . row_id = row_identifier ; search_query . column_group_id = column_group_identifier ; search_query . column_id = column_identifier ; P_BP_SFS_SEARCH_RESULTS sfs_search_results = BP_SearchStringFormattingSession ( sfs , & search_query ) ; if ( ! sfs_search_results ) return ERR_FAILURE ; if ( ! sfs_search_results -> result_n || ! sfs_search_results -> results ) return ERR_FAILURE ; if ( ! sfs_search_results -> results [ 0 ] . row_group ) if ( ! sfs_search_results -> results [ 0 ] . row ) if ( ! sfs_search_results -> results [ 0 ] . column_group ) if ( ! sfs_search_results -> results [ 0 ] . column ) { tq_free ( sfs -> tq , sfs_search_results ) ; return ERR_FAILURE ; } P_BP_SFS_STRING_COLUMN column = sfs_search_results -> results [ 0 ] . column ; column -> entries ++ ; column -> col_data = ( P_BP_SFS_STRING_ENTRY * ) tq_realloc ( sfs -> tq , column -> col_data , sizeof ( P_BP_SFS_STRING_ENTRY ) * ( column -> entries + 1 ) , BPLN ) ; if ( ! column -> col_data ) { tq_free ( sfs -> tq , column ) ; return ERR_FAILURE ; } column -> col_data [ column -> entries - 1 ] = string_entry ; if ( column -> widest_column < string_entry -> string_length ) column -> widest_column = string_entry -> string_length ; tq_free ( sfs -> tq , sfs_search_results ) ; return ERR_SUCCESS ; }
add a string entry to a column using a string entry pointer.
add a string entry to a column using a string entry pointer .
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Search for Row %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // create/zero out search query // set row group id // attempt to search for the row // ensure the stars line up // printf("\n Getting here when adding ENTRIES!: %s - %s - %s - %s", row_group_identifier, row_identifier, column_group_identifier, column_group_identifier); // BP_DisplaySFSSearchResults(sfs_search_results); // ensure we have results // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Add Column to Column Group %%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // create reference for added readability // increment the row count // attempt to reallocate the row to // contain space for the new pointer. // set the string entry here // destroy the search results // return indicating success