-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple_shell.h
29 lines (26 loc) · 850 Bytes
/
simple_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
#ifndef SIMPLE_SHELL_H
#define SIMPLE_SHELL_H
/*libraries*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <stdbool.h>
/*simple_shell*/
char **split_strings(const char *input, const char *delims);
void free_memory(char **tokens, char *buffer);
int handle_command(char **tokens, char **env, char *buffer, int *status);
/*execute_command*/
int execute_command(char **tokens, char **env);
int check_command_access(char **cmd, char **env);
int execute_child_process(char **cmd, char **env, char *path);
char *search_in_path(char *cmd, char **env);
char *check_direct_access(const char *cmd);
/*env*/
void print_environment(char **env);
/*my_own_func*/
void *_realloc(void *ptr, size_t old_size, size_t new_size);
char *_getenv(const char *name, char **env);
#endif