OS2021_Project1.Shell
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

36 行
1.4 KiB

  1. #pragma once
  2. #define CMDLINE_MAX_SIZE 1024 /* max length of a single command line */
  3. #define ARGS_MAX_QUANTITY 128 /* max args on a command line */
  4. #define BUFFER_MAX_SIZE 64 /* max size of a buffer which contains parsed arguments */
  5. #define CMDLINE_DIV ' \t\r\n\a'
  6. #define CMDLINE_HISTORY_MAX_QUANTITY 256
  7. #define JOBS_MAX_QUANTITY 16
  8. #define PATH_MAX_SIZE 256
  9. #define LS_BUF_SIZE 1024
  10. #define REDIRECT_FILENAME_MAX_SIZE 64 /* redirection filename */
  11. #define REDIRECT_ARG_MAX_SIZE 16 /* redirection argument */
  12. #define REDIRECT_NO 0 /* no redirection */
  13. #define REDIRECT_OUT 1 /* redirect output */
  14. #define REDIRECT_IN 2 /* redirect input */
  15. /* readline - Get the command line */
  16. char *readline();
  17. /* parseline - Evaluate the command line that the user has just typed in */
  18. int parseline(char *cmdline, char **args);
  19. /* check_redirect - check if the command contains redirection */
  20. int check_redirect(char **args, char *redirect_filename, char **redirect_args);
  21. /* check_redirect - check if the command contains pipe */
  22. int check_pipe(char **args, char **pipe_arg_1, char **pipe_arg_2);
  23. /* execute - Execute the command line */
  24. int execute(char *cmdline, char **args);
  25. /* builtin functions - Handle built-in command */
  26. int built_in(char **args);
  27. int builtin_cd(char **args);
  28. int builtin_history(char **args);
  29. int builtin_mytop();