OS2021_Project1.Shell
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  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();