library/src/utility/BP-StringFormattingSessions.cc
// Repaint an existing string entry with a provided (NULL TERMINATED) paint set array.  This array can be
// generated by using the BP_GenerateAlternatingColorStack() routine found in BP-StringUtilities.cc (near the bottom.)
// Just use one color entry as an argument to that routine to generate solid colors.
Repaint an existing string entry with a provided (NULL TERMINATED) paint set array.  This array can be
generated by using the BP_GenerateAlternatingColorStack() routine found in BP-StringUtilities.cc (near the bottom.)
Just use one color entry as an argument to that routine to generate solid colors.
Repaint an existing string entry with a provided ( NULL TERMINATED ) paint set array . This array can be generated by using the BP_GenerateAlternatingColorStack () routine found in BP - StringUtilities . cc ( near the bottom . ) Just use one color entry as an argument to that routine to generate solid colors .
BP_ERROR_T BP_RepaintExistingStringEntry(P_BP_SFS_STRING_ENTRY entry, P_BP_COLOR_CODE_SET_T * paint_set)
{
	if(!entry)
		return ERR_FAILURE;
	if(!paint_set)
		return ERR_FAILURE;
	if(!paint_set[0])
		return ERR_FAILURE;
	size_t paint_iter = 0;
	size_t n = 0;
	for(; n < entry->string_length; n++, paint_iter++)
	{
		if(!paint_set[paint_iter])
			paint_iter = 0;
		entry->string[n].color_info.bg = paint_set[paint_iter]->bg;
		entry->string[n].color_info.fg = paint_set[paint_iter]->fg;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_RepaintExistingStringEntry ( P_BP_SFS_STRING_ENTRY entry , P_BP_COLOR_CODE_SET_T * paint_set ) { if ( ! entry ) return ERR_FAILURE ; if ( ! paint_set ) return ERR_FAILURE ; if ( ! paint_set [ 0 ] ) return ERR_FAILURE ; size_t paint_iter = 0 ; size_t n = 0 ; for ( ; n < entry -> string_length ; n ++ , paint_iter ++ ) { if ( ! paint_set [ paint_iter ] ) paint_iter = 0 ; entry -> string [ n ] . color_info . bg = paint_set [ paint_iter ] -> bg ; entry -> string [ n ] . color_info . fg = paint_set [ paint_iter ] -> fg ; } return ERR_SUCCESS ; }
Repaint an existing string entry with a provided (NULL TERMINATED) paint set array.
Repaint an existing string entry with a provided ( NULL TERMINATED ) paint set array .
// ensure we have an entry // ensure we have a paint set to paint with // ensure we have at least one entry // paint iter, used for alternating in the case of a short list // walk the string // reset paint iterator if necessary // set colors directly // return indicating success