-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtav.c
More file actions
35 lines (28 loc) · 653 Bytes
/
Copy pathtav.c
File metadata and controls
35 lines (28 loc) · 653 Bytes
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
#include "helper.h"
// global variables
config g_tavProps;
int main(int argc, char** argv)
{
if (argc > 2)
{
printf("Usage: ./tav [filename]\nAdditional parameters not accepted");
exit(1);
}
initscr();
if (argc == 2)
g_tavProps.filename = argv[1];
readFile(g_tavProps.filename);
// enable the non canonical mode with all the required flags
getControl(STDIN_FILENO);
// first flush all the contents of stdout
/* fflush(stdout); */
signal(SIGWINCH, handle_winresize);
signal(SIGINT, SIG_IGN);
while (1)
{
drawWindow();
readKey(STDIN_FILENO);
signal(SIGWINCH, handle_winresize);
}
return 0;
}