-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathCommonType.c
More file actions
43 lines (36 loc) · 840 Bytes
/
CommonType.c
File metadata and controls
43 lines (36 loc) · 840 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
36
37
38
39
40
41
42
43
/*
* CommonType.c
* MacBlueTelnet
*
* Created by Yung-Luen Lan on 12/7/07.
* Copyright 2007 yllan.org. All rights reserved.
*
*/
#import "CommonType.h"
int isHiddenAttribute(attribute a)
{
return (!a.f.bold && ((a.f.fgColor == a.f.bgColor) ||
(a.f.fgColor == 0 && a.f.bgColor == 9)));
}
int isBlinkCell(cell c)
{
if (c.attr.f.blink && (c.attr.f.doubleByte != 0 || (c.byte != ' ' && c.byte != '\0')))
return 1;
return 0;
}
int bgColorIndexOfAttribute(attribute a)
{
return (a.f.reverse ? a.f.fgColor : a.f.bgColor);
}
int fgColorIndexOfAttribute(attribute a)
{
return (a.f.reverse ? a.f.bgColor : a.f.fgColor);
}
int bgBoldOfAttribute(attribute a)
{
return (a.f.reverse && a.f.bold);
}
int fgBoldOfAttribute(attribute a)
{
return (!a.f.reverse && a.f.bold);
}