FreeBSD/sys/boot/arm/at91/bootspi/loader_prompt.c
/*
 * .KB_C_FN_DEFINITION_START
 * void ServicePrompt(char)
 *  This private function process each character checking for valid commands.
 * This function is only executed if the character is considered valid.
 * Each command is terminated with NULL (0) or ''.
 * .KB_C_FN_DEFINITION_END
 */
.KB_C_FN_DEFINITION_START
void ServicePrompt(char)
This private function process each character checking for valid commands.
This function is only executed if the character is considered valid.
Each command is terminated with NULL (0) or ''.
. KB_C_FN_DEFINITION_START void ServicePrompt ( char ) This private function process each character checking for valid commands . This function is only executed if the character is considered valid . Each command is terminated with NULL ( 0 ) or ' ' .
static void
ServicePrompt(char p_char)
{
	if (p_char == '\r')
		p_char = 0;
	if (p_char == '\010') {
		if (buffCount) {
			inputBuffer[--buffCount] = 0;
			printf(backspaceString);
		}
		return;
	}
	if (buffCount < MAX_INPUT_SIZE - 1) {
		inputBuffer[buffCount++] = p_char;
		putchar(p_char);
	}
	if (!p_char) {
		printf("\n");
		ParseCommand(inputBuffer);
		p_memset(inputBuffer, 0, MAX_INPUT_SIZE);
		buffCount = 0;
		printf("\n>");
	}
}
static void ServicePrompt ( char p_char ) { if ( p_char == ' \r ' ) p_char = 0 ; if ( p_char == ' \010 ' ) { if ( buffCount ) { inputBuffer [ -- buffCount ] = 0 ; printf ( backspaceString ) ; } return ; } if ( buffCount < MAX_INPUT_SIZE - 1 ) { inputBuffer [ buffCount ++ ] = p_char ; putchar ( p_char ) ; } if ( ! p_char ) { printf ( " \n " ) ; ParseCommand ( inputBuffer ) ; p_memset ( inputBuffer , 0 , MAX_INPUT_SIZE ) ; buffCount = 0 ; printf ( " \n " ) ; } }
.KB_C_FN_DEFINITION_START
 void ServicePrompt(char)
  This private function process each character checking for valid commands.
. KB_C_FN_DEFINITION_START void ServicePrompt ( char ) This private function process each character checking for valid commands .
/* handle backspace BS */