projects
/
visor
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
moved terminal stuff to their own file
[visor]
/
visor
/
src
/
main_unix.c
1
#include <stdio.h>
2
3
static int init(void);
4
static void cleanup(void);
5
static void sighandler(int s);
6
7
int main(int argc, char **argv)
8
{
9
int res;
10
char c;
11
12
if(init() == -1) {
13
return 1;
14
}
15
16
for(;;) {
17
if(term_getchar() == 'q') {
18
break;
19
}
20
/* proc input */
21
}
22
23
cleanup();
24
return 0;
25
}
26
27
static int init(void)
28
{
29
if(term_init() == -1) {
30
return -1;
31
}
32
term_clear();
33
return 0;
34
}
35
36
static void cleanup(void)
37
{
38
term_cleanup();
39
}