ast_comparator/test/student_data/handout/shlab-handout/cases/reference_11_tsh.c
/*
 * check if the command is builtin command
 */
check if the command is builtin command
check if the command is builtin command
int
builtin_cmd(struct cmdline_tokens* toks)
{
    switch(toks -> builtins){
        case BUILTIN_NONE:
            return 0;
        case BUILTIN_QUIT:
            exit(0);
            return 1;
        case BUILTIN_JOBS:
            exec_jobs_cmd(toks);
            return 1;
        case BUILTIN_BG:
            exec_bg_cmd(toks);
            return 1;
        case BUILTIN_FG:
            exec_fg_cmd(toks);
            return 1;
        default:
            return 0; 
    }
}
int builtin_cmd ( struct cmdline_tokens * toks ) { switch ( toks -> builtins ) { case BUILTIN_NONE : return 0 ; case BUILTIN_QUIT : exit ( 0 ) ; return 1 ; case BUILTIN_JOBS : exec_jobs_cmd ( toks ) ; return 1 ; case BUILTIN_BG : exec_bg_cmd ( toks ) ; return 1 ; case BUILTIN_FG : exec_fg_cmd ( toks ) ; return 1 ; default : return 0 ; } }
check if the command is builtin command
check if the command is builtin command
// not builtin, return failure code