-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
68 lines (62 loc) · 1.45 KB
/
shell.h
File metadata and controls
68 lines (62 loc) · 1.45 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
62
63
64
65
66
67
68
#ifndef SHELL_H
#define SHELL_H
/**
* Libraries
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
#include <signal.h>
/**
* The global variable environment
*/
extern char **environ;
/**
* struct list_path - Linked list containing PATH directories
* @dir: directory in path
* @p: pointer to next node
*/
typedef struct list_path
{
char *dir;
struct list_path *p;
} list_path;
/**
* struct mybuild - pointer to function with corresponding buildin command
* @name: buildin command
* @func: execute the buildin command
*/
typedef struct mybuild
{
char *name;
void (*func)(char **);
} mybuild;
/**
* Functions
*/
void sig_handler(int sig_num);
int _strlen(char *s);
void _puts(char *str);
int _putchar(char c);
void _EOF(int len, char *buff);
void _isatty(void);
char **splitstring(char *str, const char *delim);
void execute(char **argv);
char *_getenv(const char *name);
char *_strdup(char *str);
char *concat_all(char *name, char *sep, char *value);
void(*checkbuild(char **arv))(char **arv);
list_path *linkpath(char *path);
list_path *add_node_end(list_path **head, char *str);
char *_which(char *filename, list_path *head);
void free_list(list_path *head);
void freearv(char **arv);
void *_realloc(void *ptr, unsigned int old_size, unsigned int new_size);
void *_calloc(unsigned int nmemb, unsigned int size);
#endif