-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.h
More file actions
46 lines (41 loc) · 1 KB
/
header.h
File metadata and controls
46 lines (41 loc) · 1 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
#ifndef HEADER_H
#define HEADER_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <time.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <inttypes.h>
#include <math.h>
#include <signal.h>
#include <sys/select.h>
#include <errno.h>
typedef long long ll;
char newroot[1024];
ll no_commands=0; // no of commands divided by ';'
char hist[22][1024]; // it starts from hist[1]
ll hist_cnt=0;
ll bg_jobs[1024]; //list of background jobs pid (-1 when bg terminated)
ll bg_cnt;
char lwd[1024]; //last working directory
ll fore_pid=-1;
ll err_code=-1; // -1=nothing, 0=success, >0=error
char **semicolon_tokenize();
char **filter_token();
char *actual_path(char *rel_path);
char *relative_path(char *check);
void prompt();
char **filter_token(char *str);
void CTRLZ(int sig);
void CTRLC(int sig);
ll REDIRECT(char **com);
ll execute(char **com, char *input_str);
#endif