-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.h
More file actions
59 lines (53 loc) · 1.42 KB
/
main.h
File metadata and controls
59 lines (53 loc) · 1.42 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
#ifndef MAIN_H
#define MAIN_H
#define UNUSED(x) (void)(x)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <ctype.h>
/**
* struct builtin - data structure for builtin command
* @name: name of the builtin command
* @func: builtin command function
*
* Description: builtin command structure
*/
typedef struct builtin
{
char *name;
void (*func)(char **args, char **argv);
} builtin;
extern int errno;
extern char **environ;
char *str_sanitizer(char *source);
char *_getline(void);
char **_token(char *line_arg);
void signal_handler(int x);
void signal_handler2(int x);
void exec_cmd(char **tokens, char **argv, char *line, char **env);
void _error(char *msg, char **argv);
void err_msg(int fd, int num_cmd, char *s1, char *s2, char *s3);
char *_getpath(char *str);
char *proc_path(char **tokens, char *path);
void exec_builtin(char **tokens, char **argv, char *line);
void comment_handler(char *source);
int count_words(char *str);
void free_token_array(char **token);
void _env(char **args, char **argv);
char *_strdup(char *str);
char *_strcpy(char *dest, char *src);
int _strlen(char *s);
int _strcmp(char *s1, char *s2);
char *_strcat(char *dest, char *src);
int _putchar(char c);
void _puts(char *str);
int _atoi(char *s);
char *_strstr(char *haystack, char *needle);
#endif