-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell.h
79 lines (64 loc) · 1.9 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _SHELL_H_
#define _SHELL_H_
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/wait.h>
#include <stdint.h>
#include <linux/limits.h>
#include <limits.h>
#include <signal.h>
/* define */
#define notUsed __attribute__((unused))
/*checkExE Func*/
int checkExE(char *file);
int createChild(char *cmd, char **av);
char *_strdup(char *str);
int _strcmp(char *x, char *y);
/*choseOrder Func*/
int choseOrder(char **strRead_cp, char **argv,
unsigned int numCount, int er, char **simi);
/*exitFile Func*/
int modify_exit(char **av, char *argv, int err, int count, char **simi);
int _nan(char *s);
int _stoi(char *s);
/*freeAll Func*/
void free_2d(char **array);
void freeExit(char **str, int numExit);
/*getAll Func*/
char **get_argv(char *strRead);
char **get_dirs(char *path);
char *string_concat(char *s1, char *s2);
char *check_path(char *file, char **dirs);
char *_getenv(const char *key);
/*getCdMod Func*/
int getCdMod(char **strRead_cp, char *argv, unsigned int numCount);
void __cd_error(char *argv, unsigned int count, char *av);
void __cd_success(char *cwd);
int rezise(char *str, ssize_t numchar);
/*strtokMod Func*/
char *strtokMod(char *str, const char *delim);
unsigned int check_delim(char c, const char *str);
/*getEnv Func*/
void getEnv(void);
/*getLineMod Func*/
ssize_t getLineMod(char **ptr, size_t *n, FILE *stream);
void bring_line(char **ptr, size_t *n, char *str, size_t j);
/*getSimiColon Func*/
char **getSemiColon(char *strRead);
/*helper Func*/
void _putchar(char c);
void _putstr(char *s);
int _strlen(char *s);
int _putnum(unsigned int num);
int print_stderr(char *argv, unsigned int count, char *av, char *prompt);
/*Shell Func*/
int checkEmpty(char *buffer);
char *readIn(void);
int exeFile(char *cmd, char **av, char *argv, int numCount);
int main(notUsed int argc, char *argv[]);
#endif