library/src/utility/BP-StringUtilities.cc
char * BP_GenUCharAsPHPDecimal(unsigned char val, P_BP_LINKL tq)
{
	// DONT CHECK VALUES, AS EVERY BYTE FROM 0x00 to 0xff ARE VALID

		// define output buffer
		char *out_buff = NULL;

		// allocate using tailqueue if we have one, if not use normal calloc
		if(tq)
			out_buff = (char *) tq_calloc(tq, 5, 1, BPLN);
		else
			out_buff = (char *) bpcalloc(5, 1);


		// create the buffer
		sprintf(out_buff, "%u", (unsigned char) val);


		// If the out buffer was generated ok, and the tail queue is set,
		// change the type of the assigned chunk to user defined ascii.  This
		// allows the List flattener to work on this chunk (if not it'd be considered
		// a binary calloc chunk)
		if(out_buff && tq)
		{

			// set data type via manual means since we're creating a string
			P_BP_LINKL_DATA linkl_data = BP_BackwardLookupDataItemFromPointer(tq, out_buff);

			// set the data type here
			linkl_data->data_type = BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII;

		}

		// return the filled out buffer
		return out_buff;

}
// Encodes a single character as a decimal number
Encodes a single character as a decimal number
Encodes a single character as a decimal number
char * BP_GenUCharAsPHPDecimal(unsigned char val, P_BP_LINKL tq)
{
		char *out_buff = NULL;
		if(tq)
			out_buff = (char *) tq_calloc(tq, 5, 1, BPLN);
		else
			out_buff = (char *) bpcalloc(5, 1);
		sprintf(out_buff, "%u", (unsigned char) val);
		if(out_buff && tq)
		{
			P_BP_LINKL_DATA linkl_data = BP_BackwardLookupDataItemFromPointer(tq, out_buff);
			linkl_data->data_type = BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII;
		}
		return out_buff;
}
char * BP_GenUCharAsPHPDecimal ( unsigned char val , P_BP_LINKL tq ) { char * out_buff = NULL ; if ( tq ) out_buff = ( char * ) tq_calloc ( tq , 5 , 1 , BPLN ) ; else out_buff = ( char * ) bpcalloc ( 5 , 1 ) ; sprintf ( out_buff , " " , ( unsigned char ) val ) ; if ( out_buff && tq ) { P_BP_LINKL_DATA linkl_data = BP_BackwardLookupDataItemFromPointer ( tq , out_buff ) ; linkl_data -> data_type = BP_MEMPROF_ALLOC_TYPE_USER_DEFINED_ASCII ; } return out_buff ; }
Encodes a single character as a decimal number
Encodes a single character as a decimal number
// DONT CHECK VALUES, AS EVERY BYTE FROM 0x00 to 0xff ARE VALID // define output buffer // allocate using tailqueue if we have one, if not use normal calloc // create the buffer // If the out buffer was generated ok, and the tail queue is set, // change the type of the assigned chunk to user defined ascii.  This // allows the List flattener to work on this chunk (if not it'd be considered // a binary calloc chunk) // set data type via manual means since we're creating a string // set the data type here // return the filled out buffer