-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
61 lines (55 loc) · 1.61 KB
/
shell.h
File metadata and controls
61 lines (55 loc) · 1.61 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
60
61
#ifndef SHELL_H_
#define SHELL_H_
/*Header import*/
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "symtab.h"
#include <ctype.h>
#include "structs.h"
extern char **environ;
/*Function prototypes*/
int _erratoi(char *s);
ssize_t get_input(UCommand *cmd);
int _strcmp(const char *s1, const char *s2);
char *_strdup(const char *s);
int get_path(UCommand *cmd);
char *get_path2(char *cmd);
char *join_path(char *path, const char *command);
int splitString(UCommand *cmd, char *delimiters);
int splitString2(UCommand *cmd, char *delimiters);
void would_exit(UCommand *cmd);
int with_builtin(char *prompt);
int interactive(UCommand *cmd);
int run_builtin(UCommand *cmd);
void initsh(void);
int fill_fd(int fd);
void hsh(UCommand *cmd, char **av);
int string_array_len(char **av);
char **remove_comments(char **cmd);
int what_node(char **av);
char **copy_av(char **av);
void print_error(UCommand *cmd);
char *itoa(int value, char *result, int base);
void print_custom_error(UCommand *cmd, char *string);
int is_only_spaces(char *string);
void trim_string(char *str);
void print_prompt1(void);
void free_cmd(UCommand *cmd);
void _execve(UCommand *cmd);
char **reallocArray(char **oldArray, size_t oldSize, size_t newSize);
void print(char *string, int stream);
ssize_t _strlen(char *str);
void free_string(char **pp);
void _memset(void *ptr, int value, size_t size);
char *_strchr(char *string, int c);
int _atoi(char *s);
char **_my_strtok(char *str, char *d);
int is_delim(char c, char *delim);
#endif