library/src/command_control_interface/BP-CommandControlInterfacePty.cc
// This function attempts to execute a command identified by command_name.  It differs from
// CCDispatcher in that this routine is designed to work with descriptors which come from
// forkpty().  Using forkpty() is slower than simple fork(), but it allows us the ability to
// control applications which require a terminal to be present.
This function attempts to execute a command identified by command_name.  It differs from
CCDispatcher in that this routine is designed to work with descriptors which come from
forkpty().  Using forkpty() is slower than simple fork(), but it allows us the ability to
control applications which require a terminal to be present.
This function attempts to execute a command identified by command_name . It differs from CCDispatcher in that this routine is designed to work with descriptors which come from forkpty () . Using forkpty () is slower than simple fork () but it allows us the ability to control applications which require a terminal to be present .
BP_ERROR_T BP_CCDispatcherFromPty
(
		P_BP_CC_SESSION session,
		char           *command_name,
		char           **arguments
)
{
	if (!session)
		return ERR_FAILURE;
	if(!command_name)
		return ERR_FAILURE;
	if (!session->fds)
		return ERR_FAILURE;
	if (!session->commands)
		return ERR_FAILURE;
	if(!session->fds->session_is_forkpty)
		return ERR_FAILURE;
	P_BP_CC_DECISION_TREE command_tree = BP_CCGetCommandByName(session,	command_name);
	if(!command_tree)
		return ERR_FAILURE;
	if(!BP_CCProcessCommandTreePty(session, command_tree->top_branch))
	{
		return ERR_FAILURE;
	}
    return ERR_SUCCESS;
}
BP_ERROR_T BP_CCDispatcherFromPty ( P_BP_CC_SESSION session , char * command_name , char * * arguments ) { if ( ! session ) return ERR_FAILURE ; if ( ! command_name ) return ERR_FAILURE ; if ( ! session -> fds ) return ERR_FAILURE ; if ( ! session -> commands ) return ERR_FAILURE ; if ( ! session -> fds -> session_is_forkpty ) return ERR_FAILURE ; P_BP_CC_DECISION_TREE command_tree = BP_CCGetCommandByName ( session , command_name ) ; if ( ! command_tree ) return ERR_FAILURE ; if ( ! BP_CCProcessCommandTreePty ( session , command_tree -> top_branch ) ) { return ERR_FAILURE ; } return ERR_SUCCESS ; }
This function attempts to execute a command identified by command_name.
This function attempts to execute a command identified by command_name .
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Run Basic Dispatcher Checks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // ensure we have a non-null session // ensure we have a command name // cannot work without a set of file descriptors // must have commands // if we don't have a master, return failure // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Run Standard Ptyfork Version %%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // attempt to lookup command tree before dispatching // After the command is identified, process.  Return result of processing. // return indicating success