Advertisement
shortspecialbus

shell.h

May 19th, 2021
1,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. /*
  2.  * cs537 Project 1 - Shell
  3.  *
  4.  * Written by Stefan Strandberg (stefan@cs.wisc.edu)
  5.  * $Id: shell.h,v 1.5 2004/09/23 21:06:51 stefan Exp $
  6.  *
  7.  */
  8.  
  9. #ifndef _H_SHELL_H_
  10. #define _H_SHELL_H_
  11.  
  12. #include "job.h"
  13.  
  14. typedef struct {
  15.     char* prompt;
  16. } shell_t;
  17.  
  18. typedef enum {
  19.     // positive values mean there was a pid.
  20.     NORMAL = 0,
  21.     EXITVAL = -2,
  22.     JOBVAL = -1,
  23.     WAITERROR = -3,
  24.     CHILDEXIT = -4
  25. } action_t;
  26.  
  27. shell_t *create_shell(void);
  28. int run_shell(shell_t *shell, int interactive, int *jobnum, job_t *job,
  29.               FILE *inbuffer);
  30. void do_waitcmd(job_t *job);
  31. void do_jobcmd(job_t *jobs[], int jobnums);
  32.  
  33. #define MAX_INPUT_SIZE 512
  34.  
  35. #endif
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement