Example #1
0
extern int process(char **arglist) {
  int rv = 0;

  if (arglist == NULL)
    rv = 0;
  else if (is_control_command(arglist[0]))
    rv = do_control_command(arglist);
  else if (ok_to_execute())
    rv = execute(arglist);

  return rv;
}
Example #2
0
File: process.c Project: lxdiyun/C
/*
 * purpose: process user command
 * 
 * returns: result of processing command
 * 
 * details: if a built-in then call appropriate function,if not
 * 	execute()
 * 
 * error: arise from subrouting, handled there
 */
int process(char **args) {
	int rv = 0;
	
	if(args[0] == NULL)
		rv = 0;
	else if(is_control_command(args[0]))
		rv = do_control_command(args);
	else if(ok_to_execute())
		rv = execute(args);

	return rv;
}
Example #3
0
/**
 * @brief	: process user commands
 * @param	: args		array of strings
 * 		  exit_code	pointer to exit code passed to builtins
 * @return	  rv		result of command execution
 */
int process(char **args,int *exit_code, bool *syn_err)
{
	int	rv = 1;			/* defaults to 1 for failed exit */

	if ( args[0] == NULL )
		rv = 0;
	else if ( is_control_command(args[0]) )
		rv = do_control_command(args, syn_err);
	else if ( ok_to_execute(syn_err) )
		if ( !builtin_command(args,&rv,exit_code))
			rv = execute(args);
	return rv;
}
Example #4
0
int process(char** args)
{
  int rv;

  if (args[0] == NULL)
    return 0; 
  else if (is_control_command(args[0]))
    rv = do_control_command(args);
  else if ((rv = ok_to_execute(args)) == 1)
    if (!builtin_command(args))
      rv = execute(args);

  return rv;
}
Example #5
0
int process(char **args)
/*
 * purpose: process user command
 * returns: result of processing command
 * details: if a built-in then call appropriate function, if not execute()
 *  errors: arise from subroutines, handled there
 */
{
	int		rv = 0;

	if ( args[0] == NULL )
		rv = 0;
	else if ( is_control_command(args[0]) )
		rv = do_control_command(args);
	else if ( ok_to_execute() )
		rv = execute(args);
	return rv;
}