-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.h
59 lines (54 loc) · 1.35 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
#ifndef MAIN_H
#define MAIN_H
extern char **environ;
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/wait.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <sys/types.h>
#include <stdarg.h>
#include <limits.h>
/**
* struct llist - s linked list
* @key: represents key
* @add: represents address
* @next: pointer to next node
*
*/
typedef struct llist
{
char *key;
char *add;
struct llist *next;
} sl_list;
int _print(char *str);
int main(void);
int isEmptyStr(const char *str);
int _strlen(char *str);
int wrd_counter(char *str);
int execute(char **args);
char *_getenv(const char *key);
char *_strdup(char *str);
int _strcmp(const char *str1, const char *str2);
char *getExecutablePath(char *cmd);
sl_list *insert_node(char *key, char *add);
char *_strcpy(char *dest, char *src);
char *_strcat(char *dest, char *src);
int notFound(void);
int _setenv(char *name, char *value);
int delete_node(const char *key);
void free_list(sl_list *head);
int stok(char *lineptr, char ***wrds, char *delim);
void explicit_free(char ***wrds, int wordCnt);
int _unsetenv(const char *name);
int builtins(char **args);
void free_env(void);
void exit_checker(char **args,
int wordCount, int *exitStatus, int *prevExitStatus);
void exit_builtin(char **args,
int wordCount, int *exitStatus, int *prevExitStatus);
void cd(char *path);
#endif