-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsish.h
49 lines (43 loc) · 872 Bytes
/
sish.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* sish.h
*
* Created on: Dec 9, 2015
*/
#ifndef SISH_H_
#define SISH_H_
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#define BUFSIZE 4096
#define OUT_STD 7
#define OUT_FILE 8
#define APPEND_FILE 9
#define CANNOT_EXECUTE 127
typedef struct taskNode_ taskNode;
struct taskNode_ {
char *command[BUFSIZE];
int out_method;
char *in_file;
char *out_file;
char *append_file;
taskNode *next;
};
void init();
void loop();
char* getinput();
void split_input(char *line);
void builtins_cd();
void builtins_echo(taskNode *cur);
void handle(taskNode *curr);
void spawn_proc(int, int, taskNode*);
int makeTask(taskNode *cur);
void gc(taskNode *);
#endif /* SISH_H_ */