-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
58 lines (47 loc) · 1.44 KB
/
Copy pathshell.h
File metadata and controls
58 lines (47 loc) · 1.44 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
/*
Name : UdayKumar Upputuri
Date : 10/06/2026
Project Name : Minishell
Description: Implementing a minimalistic shell, mini-shell(msh) as part of the Linux Internal module.
*/
#ifndef HEADER_H
#define HEADER_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio_ext.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#define BUILTIN 1
#define EXTERNAL 2
#define NO_COMMAND 3
#define RED "\x1b[31m"
#define GREEN "\x1b[32m"
#define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define CYAN "\x1b[36m"
#define RESET "\x1b[0m"
//sturcture to store the stopped processes
typedef struct list{
int pid;
char cmd[30];
struct list *link;
}list;
int insert_first();
int delete_first();
int print_list();
void scan_input(char *prompt, char *input_string);
char *get_command(char *input_string);
//void copy_change(char *prompt, char *input_string); //logic written in scan.c itself only
int check_command_type(char *command);
void echo(char *input_string, int status);
void execute_internal_commands(char *input_string);
void execute_external_commands(char *input_string);
void signal_handler(int sig_num);
void extract_external_commands(char **external_commands); //extracts external commands from file and storing it in 2D array
#endif