library/src/javascript/builtin/system/BP-JSSystemBuiltins.cc
// simply takes a string argument and prints it to stdout
simply takes a string argument and prints it to stdout
simply takes a string argument and prints it to stdout
static bool BP_JSDebugPrintStdout(JSContext *cx, unsigned argc, jsval *vp)
{
	JS::CallArgs args = CallArgsFromVp(argc, vp);
	if(argc != 1)
		return false;
	JSString * arg_str = args[0].toString();
	char * encoded_arg_str = JS_EncodeString(cx, arg_str);
	BP_BOOL str_reasonable = BP_StringIsReasonablePrintableString(encoded_arg_str, bpstrlen(encoded_arg_str)-1, BP_TRUE, BP_TRUE);
	if(str_reasonable == BP_FALSE)
	{
		JS_free(cx, encoded_arg_str);
		return false;
	}
	printf("%s", encoded_arg_str);
	JS_free(cx, encoded_arg_str);
	return true;
}
static bool BP_JSDebugPrintStdout ( JSContext * cx , unsigned argc , jsval * vp ) { JS :: CallArgs args = CallArgsFromVp ( argc , vp ) ; if ( argc != 1 ) return false ; JSString * arg_str = args [ 0 ] . toString ( ) ; char * encoded_arg_str = JS_EncodeString ( cx , arg_str ) ; BP_BOOL str_reasonable = BP_StringIsReasonablePrintableString ( encoded_arg_str , bpstrlen ( encoded_arg_str ) - 1 , BP_TRUE , BP_TRUE ) ; if ( str_reasonable == BP_FALSE ) { JS_free ( cx , encoded_arg_str ) ; return false ; } printf ( " " , encoded_arg_str ) ; JS_free ( cx , encoded_arg_str ) ; return true ; }
simply takes a string argument and prints it to stdout
simply takes a string argument and prints it to stdout
// get arguments // if we have the correct number of arguments // set the first argument // encode the string /*
	// Optional Buffer analysis: Uncomment to enable

	// create ascii configuration
	BP_BUFFER_ANALYSIS_ASCII_CONFIGURATION ascii_config;

	// zero out the structure (automagic macro)
	BP_ZERO_STACK(ascii_config);

	// set some flags in the structure (default is BP_FALSE aka 0)
	ascii_config.count_ascii                      = BP_TRUE;
	ascii_config.count_extended                   = BP_TRUE;
	ascii_config.count_individual_characters      = BP_TRUE;

	// create analysis of buffer
	P_BP_BUFFER_ANALYSIS buff_analysis = BP_CreateBufferAnalysis
	(
			(unsigned char *) encoded_arg_str,
			bpstrlen(encoded_arg_str),
			&ascii_config
	);

	// buffer analysis
	BP_DisplayBufferAnalysisASCII(buff_analysis);
	*/ // check if the buffer is reasonable // return failure if the print string is not reasonable // free the encoded argument string // exit immediately because the string is unreasonable // print out the encoded string to the console // free the string // return indicating true