-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheaders.h
120 lines (81 loc) · 2.56 KB
/
headers.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <iostream>
#include <vector>
#include <iterator>
#include <sys/ioctl.h>
#include <unistd.h>
#include <dirent.h>
#include <termios.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <math.h>
#include <ctime>
#include <string.h>
#include <algorithm>
#include <fstream>
#include <fcntl.h>
#include <queue>
#include <stack>
#include <pwd.h>
#include <grp.h>
using namespace std;
#ifndef INC_HEADERS_H
#define INC_HEADERS_H
#define CLEAR "\033[2J"
#define LINE_CLEAR "\033[2K"
#define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define WHITE "\x1b[37m"
#define LRED "\x1b[91m"
#define YELLOW "\x1b[33m"
#define LCYAN "\x1b[96m"
#define BPURPLE "\x1b[45m"
#define BBLACK "\x1b[40m"
#define BRED "\x1b[41m"
#define BLGREY "\x1b[100m"
#define BLGREEN "\x1b[102m"
#define BLBLUE "\x1b[104m"
#define BLYELLOW "\x1b[103m"
#define BLMAGENTA "\x1b[105m"
#define BLCYAN "\x1b[106m"
#define BOLDON "x1b[1m"
#define BOLDOFF "x1b[21m"
#define UNDERLINEON "x1b[4m"
#define UNDERLINEOFF "x1b[24m"
extern int win_row, win_col, cur_row, cur_col, list_row, list_col, windows_capacity, cmd_cur;
extern string pwd, home, twd, MODE;
extern string cmd;
extern vector <string> dir_his;
extern vector<string>::iterator his_itr;
extern vector<string> list_cmds;
int* get_row_col(string);
vector <struct dirent *>ls_cmd(char *);
string get_cwd();
void display(vector <struct dirent *>&, int, int, bool, string);
void move_cursor(int, int, bool, string);
char check_keypress();
void top_bottom_bar(int, int);
void modify_wd(string dest_dir);
void place_cursor(int, int);
void onPressLeftN(vector <struct dirent *> &, bool &, int &);
void onPressRightN(vector <struct dirent *> &, bool &, int &);
void onPressBackN(vector <struct dirent *> &, bool &, int &);
void onPressHomeN(vector <struct dirent *> &, bool &, int &);
void onPressEnterN(vector <struct dirent *> &, bool &, int &);
void onPressDownN(vector <struct dirent *> &, bool, int &);
void onPressUpN(vector <struct dirent *> &, bool);
void switch_mode(vector <struct dirent *> &, int &, bool &);
vector <string> processCmd(int, string);
void show_error(string);
void onPressBackC();
void onPressEnterC(vector <struct dirent *> &, bool &, int &);
void storeCmd(char);
void init();
void refresh(vector <struct dirent *> &, bool &, int &);
void generate_snapshot(char *, char *);
vector <struct dirent *> ls_snap(char *);
vector <string> search(string, string);
int delete_directory(char *);
void reset(vector <struct dirent *> &, bool &, int &);
int copy_dir(char *, char *);
string replace_name(string, string, string);
#endif /*INC_MODULE1_H*/