-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.h
44 lines (37 loc) · 1.02 KB
/
shell.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
#ifndef _MAIN_H
#define _MAIN_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <ctype.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <errno.h>
#define BUFFER_SIZE 64
#define DELIMITER " \n"
void prompt(void);
void handle_exit(char **argv);
void fork_process(int ac, char **argv, char **env);
void executeCommand(int ac, char **argv, char **env);
void error_handler(const char *command);
void p_error(const char *command);
void signal_c(int sig);
char *get_line(void);
void free_all(char **argv);
char **parse_command(char *user_line);
char *read_line(void);
char *path_to_argv(char *command);
void handl_exit(char **argv);
void handle_cd(char **argv);
int set_env(char **argv);
int unset_env(char **argv);
void print_env(char **env);
int str_len(char *str);
char *str_cpy(char *dest, char *src);
char *str_cat(char *dest, char *src);
int str_cmp(const char *str1, const char *str2);
char *str_tok(char *str, const char *delim);
char str_dup(const char *str);
#endif