library/src/utility/BP-StringUtilities.cc
// converts a string to lower case (returns bp allocated memory, must be bpfreed)
converts a string to lower case (returns bp allocated memory, must be bpfreed)
converts a string to lower case ( returns bp allocated memory must be bpfreed )
char * BP_StringToLowerCase(char * buff, size_t buff_len)
{
	if(!BP_StringIsReasonablePrintableString(buff, buff_len, BP_TRUE, BP_TRUE))
		return NULL;
	size_t string_iter = 0;
	char * ret_string = (char *) bpcalloc(buff_len+1, 1);
	if(!ret_string)
		return NULL;
	for(; string_iter < buff_len; string_iter++)
	{
		if(isalpha(buff[string_iter]))
			ret_string[string_iter] = tolower(buff[string_iter]);
		else
			ret_string[string_iter] = buff[string_iter];
	}
	return ret_string;
}
char * BP_StringToLowerCase ( char * buff , size_t buff_len ) { if ( ! BP_StringIsReasonablePrintableString ( buff , buff_len , BP_TRUE , BP_TRUE ) ) return NULL ; size_t string_iter = 0 ; char * ret_string = ( char * ) bpcalloc ( buff_len + 1 , 1 ) ; if ( ! ret_string ) return NULL ; for ( ; string_iter < buff_len ; string_iter ++ ) { if ( isalpha ( buff [ string_iter ] ) ) ret_string [ string_iter ] = tolower ( buff [ string_iter ] ) ; else ret_string [ string_iter ] = buff [ string_iter ] ; } return ret_string ; }
converts a string to lower case (returns bp allocated memory, must be bpfreed)
converts a string to lower case ( returns bp allocated memory must be bpfreed )
// ensure it's a reasonable/printable string // set string iterator // allocate space for the returning string // convert to lowercase // check the byte to see if it's alphanumeric before conversion // return the new string