-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshell.h
50 lines (42 loc) · 1.16 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
#ifndef _SHELL_H_
#define _SHELL_H_
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
/**
* struct list_s - singly linked list
* @str: string - (malloc'ed string)
* @next: points to the next node
*
* Description: singly linked list node structure
* for Holberton project
*/
typedef struct list_s
{
char *str;
struct list_s *next;
} list_t;
extern char **environ;
void print_env(void);
void free_list(list_t *head);
void build_linked_list(char *path, list_t **head);
void exit_helper(char **av, char **argv, char *to_string);
void error_helper(char **av, char **argv, char *to_string);
int _strlen(char *s);
int word_count(char *str);
int string_to_int(char *s);
int _strcmp(char *s1, char *s2);
char *_strdup(char *s);
char **split_string(char *str);
char *_getenv(const char *name);
char *str_concat(char *s1, char *s2);
char *_strstr(char *haystack, char *needle);
char *counter_to_string(int i, char *to_string);
char *search_path(list_t *head, char *c, char **av, char *to_string);
list_t *add_node_end(list_t **head, char *str);
#endif /* _SHELL_H_ */