FreeBSD/sys/boot/arm/at91/bootiic/env_vars.c
/*
 * .KB_C_FN_DEFINITION_START
 * int ReadCharFromEnvironment(char *)
 *  This private function reads characters from the environment variables
 * to service the command prompt during auto-boot or just to setup the
 * default environment.  Returns positive value if valid character was
 * set in the pointer.  Returns negative value to signal input stream
 * terminated.  Returns 0 to indicate _wait_ condition.
 * .KB_C_FN_DEFINITION_END
 */
.KB_C_FN_DEFINITION_START
int ReadCharFromEnvironment(char *)
This private function reads characters from the environment variables
to service the command prompt during auto-boot or just to setup the
default environment.  Returns positive value if valid character was
set in the pointer.  Returns negative value to signal input stream
terminated.  Returns 0 to indicate _wait_ condition.
. KB_C_FN_DEFINITION_START int ReadCharFromEnvironment ( char * ) This private function reads characters from the environment variables to service the command prompt during auto - boot or just to setup the default environment . Returns positive value if valid character was set in the pointer . Returns negative value to signal input stream terminated . Returns 0 to indicate _wait_ condition .
static int
ReadCharFromEnvironment(int timeout)
{
	int ch;
	if (currentIndex < MAX_BOOT_COMMANDS) {
		ch = boot_commands[currentIndex][currentOffset++];
		if (ch == '\0' || (currentOffset >= MAX_INPUT_SIZE)) {
			currentOffset = 0;
			++currentIndex;
			ch = '\r';
		}
		return (ch);
	}
	return (-1);
}
static int ReadCharFromEnvironment ( int timeout ) { int ch ; if ( currentIndex < MAX_BOOT_COMMANDS ) { ch = boot_commands [ currentIndex ] [ currentOffset ++ ] ; if ( ch == ' \0 ' || ( currentOffset >= MAX_INPUT_SIZE ) ) { currentOffset = 0 ; ++ currentIndex ; ch = ' \r ' ; } return ( ch ) ; } return ( -1 ) ; }
.KB_C_FN_DEFINITION_START
 int ReadCharFromEnvironment(char *)
  This private function reads characters from the environment variables
 to service the command prompt during auto-boot or just to setup the
 default environment.
. KB_C_FN_DEFINITION_START int ReadCharFromEnvironment ( char * ) This private function reads characters from the environment variables to service the command prompt during auto - boot or just to setup the default environment .