-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.h
More file actions
59 lines (47 loc) · 1.23 KB
/
Copy pathheader.h
File metadata and controls
59 lines (47 loc) · 1.23 KB
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
50
51
52
53
54
55
56
57
58
59
#ifndef FILE_FOO_SEEN
#define FILE_FOO_SEEN
char** arr;
char *home;
#include <syscall.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <signal.h>
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
void display(char *home);
char** get_command();
char** seperate_command(char *input, int *num);
void piping(char **tokens,int*,char*);
void execute(char** tokens, int *pos, char* home,int,int);
int command_cd(char **tokens, char* home);
int command_echo(char **tokens);
int command_pwd();
int command_pinfo(char **tokens);
void listjobs();
void sendsig(char** tokens);
void movetofg(char **tokens);
void killallbg();
int system_command_background(char **tokens);
int system_command_foreground(char **tokens,int,int);
void HandleSignal(int sig, siginfo_t *si, void *context);
void ctrlC(int);
void ctrlZ(int);
typedef struct
{
pid_t pid;
char pname[100];
}bgprocs;
pid_t shellpid;
bgprocs joblist[1000];
#endif