-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.c
47 lines (31 loc) · 884 Bytes
/
conf.c
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
#include "conf.h"
const int FSIZE_X=161,FSIZE_Y=60;
const int SIZE_X=80,SIZE_Y=24;
const int SIZE_Y_CORRECTION=7;
const int SH3L=3,SH4L=4,SH5L=5;
const int MAX_NSH3=3,MAX_NSH4=2,MAX_NSH5=1;
const char DPLYCOL[4]={31,32,33,34};
const char SPREAD_DEF=1;
const char SH3_NOSH=2,SH4_NOSH=3,SH5_NOSH=4;
void
objFree(void* p_obj){ //generic destructor
NULL_P_CHECK(p_obj);
free(p_obj);
p_obj=NULL;
return;}
#ifndef NO_TERM
void
termUnbuff(){
tcgetattr(STDIN_FILENO,&termSettingBackup);
termSettingBackup.c_lflag &=(~ICANON & ~ECHO);
tcsetattr(STDIN_FILENO,TCSANOW,&termSettingBackup);}
void
termUnbuffRestore(){
tcsetattr(STDIN_FILENO,TCSANOW,&termSettingBackup);}
void
termNonBlocking(){
fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK);}
void
termBlocking(){
fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) ^ O_NONBLOCK);}
#endif