-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathCommonType.h
More file actions
47 lines (41 loc) · 1 KB
/
CommonType.h
File metadata and controls
47 lines (41 loc) · 1 KB
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
/*
* CommonType.h
* MacBlueTelnet
*
* Created by Yung-Luen Lan on 9/11/07.
* Copyright 2007 yllan.org. All rights reserved.
*
*/
typedef union {
unsigned short v;
struct {
unsigned int fgColor : 4;
unsigned int bgColor : 4;
unsigned int bold : 1;
unsigned int underline : 1;
unsigned int blink : 1;
unsigned int reverse : 1;
unsigned int doubleByte : 2;
unsigned int url : 1;
unsigned int nothing : 1;
} f;
} attribute;
typedef struct {
unsigned char byte;
attribute attr;
} cell;
typedef enum {C0, INTERMEDIATE, ALPHABETIC, DELETE, C1, G1, SPECIAL, ERROR} ASCII_CODE;
typedef enum YLEncoding {
YLBig5Encoding,
YLGBKEncoding
} YLEncoding;
typedef enum YLANSIColorKey {
YLCtrlUANSIColorKey,
YLEscEscEscANSIColorKey
} YLANSIColorKey;
int isHiddenAttribute(attribute a) ;
int isBlinkCell(cell c) ;
int bgColorIndexOfAttribute(attribute a) ;
int fgColorIndexOfAttribute(attribute a) ;
int bgBoldOfAttribute(attribute a) ;
int fgBoldOfAttribute(attribute a) ;