-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.h
34 lines (30 loc) · 959 Bytes
/
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
#ifndef SHELL_H
#define SHELL_H
/*lib*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
/*main functions*/
int start_shell(int ac, char **av, char **env);
char *get_input(char **av);
char **input_tokenizer(char *input, char **av);
int tokens_number(char *input);
void execute_commands(char **tokens, char **av, char **env);
int get_accessable_path(char **tokens, char **env);
char *_getenv(char **env, char *command);
void print_env(char **env);
void free_arr(char **arr);
int custom_commands(char **tokens, char **env);
void exit_shell(char **tokens);
/*utili functions*/
int _strlen(char *line);
int _strcpy(char *dest, char *src);
int _strcmp(char *s1, char *s2, size_t len);
char *_strcat(char *dest, const char *src);
void _print(int status, char **av, char *message);
void print_execute_error(int status, char **av, char *command);
#endif /*SHELL_H*/