forked from cassianokc/gcshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
41 lines (26 loc) · 780 Bytes
/
common.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
#ifndef COMMON_H
#define COMMON_H
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#define SUCESS 0
#define FAILURE -1
#define TRUE 1
#define FALSE 0
#define MAX_STRING 250
#define fatal() \
do { fprintf (stderr, "Error: %s: %d: %s: %s\n", \
__FILE__, __LINE__, \
__PRETTY_FUNCTION__, strerror (errno)); \
exit (EXIT_FAILURE);} while (0)
#define STDOUT_DESC 1
#define STDIN_DESC 0
const char *PATH;
int read_word(const char *, char **, char);
int count_words(const char *, char);
void process_string(char *);
void free_pointer_to_pointers(char **, int);
void execute(char **, size_t);
int check_builtin(char **, size_t);
void help(void);
#endif