library/src/blockclass/BP-BlockClass.cc
// see if a command exists (return if exists)
see if a command exists (return if exists)
see if a command exists ( return if exists )
P_BP_CC_DECISION_TREE Block::ccCommandExists(char *command_name)
{
	size_t i = 0;
	for
	(
			i = 0;
			this->cc_session->commands[i];
			i++
	)
	{
		if
		(
				strncmp
				(
						this->cc_session->commands[i]->command,
						command_name,
						bpstrlen(command_name)
				) == 0
		)
		{
			return (P_BP_CC_DECISION_TREE) this->cc_session->commands[i];
		}
	}
	return NULL;
}
P_BP_CC_DECISION_TREE Block :: ccCommandExists ( char * command_name ) { size_t i = 0 ; for ( i = 0 ; this -> cc_session -> commands [ i ] ; i ++ ) { if ( strncmp ( this -> cc_session -> commands [ i ] -> command , command_name , bpstrlen ( command_name ) ) == 0 ) { return ( P_BP_CC_DECISION_TREE ) this -> cc_session -> commands [ i ] ; } } return NULL ; }
see if a command exists (return if exists)
see if a command exists ( return if exists )
// walk commands and try to find command name in commands // check to see if command matches command string in command array (match command) // return null if unfound