コード例 #1
0
ファイル: process.c プロジェクト: acgtyrant/UULP
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;
}
コード例 #2
0
ファイル: process.c プロジェクト: 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;
}
コード例 #3
0
ファイル: process.c プロジェクト: madhusirmv/C_monk
/**
 * @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;
}
コード例 #4
0
ファイル: smsh1.c プロジェクト: yangmiemie/books
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;
}
コード例 #5
0
ファイル: process.c プロジェクト: GoodLuckBamboo/studylinux
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;
}