-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathholberton.h
More file actions
47 lines (42 loc) · 1.04 KB
/
holberton.h
File metadata and controls
47 lines (42 loc) · 1.04 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
#ifndef HOLBERTON_H
#define HOLBERTON_H
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#define _NORMAL 1
#define _SKIP 2
#define _SHELL_END 3
extern char **environ;
int promptShell(void);
char **getToken(char **buf, char *pattern);
void shellInstance(void);
void execute(char *arg, char **args);
char *getKeyValue(char *key);
char *getPathArgs(char *prog);
char *get_x_args(char **env_paths, char *program);
char *_strcat(char *dest, char *src);
char *_strcpy(char *dest, char *src);
char *_memset(char *s, char b, unsigned int n);
int _strlen(char *s);
unsigned int countToks(char *str, char *delim);
char *_stralloc(int count, ...);
char *_strstr(char *haystack, char *needle);
int built_ins(char **args);
int _env(char **args);
int _bin_exit(char **args);
int _strcmp(char *s1, char *s2);
/**
* struct built - built ins structure
* @cmd: command to match
* @f: function to return
*/
typedef struct built
{
char *cmd;
int (*f)(char **);
} built_t;
#endif