Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
C | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
1 | <?php declare(strict_types=1); |
2 | |
3 | namespace Aviat\Kilo\Enum; |
4 | |
5 | use Aviat\Kilo\Traits; |
6 | |
7 | /** |
8 | * Just a namespace for C language constants |
9 | */ |
10 | class C { |
11 | use Traits\ConstList; |
12 | |
13 | // ------------------------------------------------------------------------ |
14 | // ! Misc I/O constants |
15 | // ------------------------------------------------------------------------ |
16 | |
17 | public const STDIN_FILENO = 0; |
18 | public const STDOUT_FILENO = 1; |
19 | public const STDERR_FILENO = 2; |
20 | public const TCSAFLUSH = 2; |
21 | |
22 | // ------------------------------------------------------------------------ |
23 | // ! Termios flags and constants |
24 | // ------------------------------------------------------------------------ |
25 | |
26 | /* Input modes */ |
27 | public const IGNBRK = (1 << 0); /* Ignore break condition. */ |
28 | public const BRKINT = (1 << 1); /* Signal interrupt on break. */ |
29 | public const IGNPAR = (1 << 2); /* Ignore characters with parity errors. */ |
30 | public const PARMRK = (1 << 3); /* Mark parity and framing errors. */ |
31 | public const INPCK = (1 << 4); /* Enable input parity check. */ |
32 | public const ISTRIP = (1 << 5); /* Strip 8th bit off characters. */ |
33 | public const INLCR = (1 << 6); /* Map NL to CR on input. */ |
34 | public const IGNCR = (1 << 7); /* Ignore CR. */ |
35 | public const ICRNL = (1 << 8); /* Map CR to NL on input. */ |
36 | public const IXON = (1 << 9); /* Enable start/stop output control. */ |
37 | public const IXOFF = (1 << 10); /* Enable start/stop input control. */ |
38 | public const IXANY = (1 << 11); /* Any character will restart after stop. */ |
39 | public const IMAXBEL = (1 << 13); /* Ring bell when input queue is full. */ |
40 | public const IUCLC = (1 << 14); /* Translate upper case input to lower case. */ |
41 | |
42 | /* Output modes */ |
43 | public const OPOST = (1 << 0); /* Perform output processing. */ |
44 | public const ONLCR = (1 << 1); /* Map NL to CR-NL on output. */ |
45 | public const OXTABS = (1 << 2); /* Expand tabs to spaces. */ |
46 | public const ONOEOT = (1 << 3); /* Discard EOT (^D) on output. */ |
47 | public const OCRNL = (1 << 4); /* Map CR to NL. */ |
48 | public const ONOCR = (1 << 5); /* Discard CR's when on column 0. */ |
49 | public const ONLRET = (1 << 6); /* Move to column 0 on NL. */ |
50 | public const NLDLY = (3 << 8); /* NL delay. */ |
51 | public const NL0 = (0 << 8); /* NL type 0. */ |
52 | public const NL1 = (1 << 8); /* NL type 1. */ |
53 | public const TABDLY = (3 << 10 | 1 << 2); /* TAB delay. */ |
54 | public const TAB0 = (0 << 10); /* TAB delay type 0. */ |
55 | public const TAB1 = (1 << 10); /* TAB delay type 1. */ |
56 | public const TAB2 = (2 << 10); /* TAB delay type 2. */ |
57 | public const TAB3 = (1 << 2); /* Expand tabs to spaces. */ |
58 | public const CRDLY = (3 << 12); /* CR delay. */ |
59 | public const CR0 = (0 << 12); /* CR delay type 0. */ |
60 | public const CR1 = (1 << 12); /* CR delay type 1. */ |
61 | public const CR2 = (2 << 12); /* CR delay type 2. */ |
62 | public const CR3 = (3 << 12); /* CR delay type 3. */ |
63 | public const FFDLY = (1 << 14); /* FF delay. */ |
64 | public const FF0 = (0 << 14); /* FF delay type 0. */ |
65 | public const FF1 = (1 << 14); /* FF delay type 1. */ |
66 | public const BSDLY = (1 << 15); /* BS delay. */ |
67 | public const BS0 = (0 << 15); /* BS delay type 0. */ |
68 | public const BS1 = (1 << 15); /* BS delay type 1. */ |
69 | public const VTDLY = (1 << 16); /* VT delay. */ |
70 | public const VT0 = (0 << 16); /* VT delay type 0. */ |
71 | public const VT1 = (1 << 16); /* VT delay type 1. */ |
72 | public const OLCUC = (1 << 17); /* Translate lower case output to upper case */ |
73 | public const OFILL = (1 << 18); /* Send fill characters for delays. */ |
74 | public const OFDEL = (1 << 19); /* Fill is DEL. */ |
75 | |
76 | /* Control modes */ |
77 | public const CIGNORE = (1 << 0); /* Ignore these control flags. */ |
78 | public const CS5 = 0; /* 5 bits per byte. */ |
79 | public const CS6 = (1 << 8); /* 6 bits per byte. */ |
80 | public const CS7 = (1 << 9); /* 7 bits per byte. */ |
81 | public const CS8 = (C::CS6|C::CS7); /* 8 bits per byte. */ |
82 | public const CSIZE = (C::CS5|C::CS6|C::CS7|C::CS8); /* Number of bits per byte (mask). */ |
83 | public const CSTOPB = (1 << 10); /* Two stop bits instead of one. */ |
84 | public const CREAD = (1 << 11); /* Enable receiver. */ |
85 | public const PARENB = (1 << 12); /* Parity enable. */ |
86 | public const PARODD = (1 << 13); /* Odd parity instead of even. */ |
87 | public const HUPCL = (1 << 14); /* Hang up on last close. */ |
88 | public const CLOCAL = (1 << 15); /* Ignore modem status lines. */ |
89 | public const CRTSCTS = (1 << 16); /* RTS/CTS flow control. */ |
90 | public const CRTS_IFLOW = C::CRTSCTS; /* Compatibility. */ |
91 | public const CCTS_OFLOW = C::CRTSCTS; /* Compatibility. */ |
92 | public const CDTRCTS = (1 << 17); /* DTR/CTS flow control. */ |
93 | public const MDMBUF = (1 << 20); /* DTR/DCD flow control. */ |
94 | public const CHWFLOW = (C::MDMBUF|C::CRTSCTS|C::CDTRCTS); /* All types of flow control. */ |
95 | |
96 | /* Local modes */ |
97 | public const ECHOKE = (1 << 0); /* Visual erase for KILL. */ |
98 | public const _ECHOE = (1 << 1); /* Visual erase for ERASE. */ |
99 | public const ECHOE = C::_ECHOE; |
100 | public const _ECHOK = (1 << 2); /* Echo NL after KILL. */ |
101 | public const ECHOK = C::_ECHOK; |
102 | public const _ECHO = (1 << 3); /* Enable echo. */ |
103 | public const ECHO = C::_ECHO; |
104 | public const _ECHONL = (1 << 4); /* Echo NL even if ECHO is off. */ |
105 | public const ECHONL = C::_ECHONL; |
106 | public const ECHOPRT = (1 << 5); /* Hardcopy visual erase. */ |
107 | public const ECHOCTL = (1 << 6); /* Echo control characters as ^X. */ |
108 | public const _ISIG = (1 << 7); /* Enable signals. */ |
109 | public const ISIG = C::_ISIG; |
110 | public const _ICANON = (1 << 8); /* Do erase and kill processing. */ |
111 | public const ICANON = C::_ICANON; |
112 | public const ALTWERASE = (1 << 9); /* Alternate WERASE algorithm. */ |
113 | public const _IEXTEN = (1 << 10); /* Enable DISCARD and LNEXT. */ |
114 | public const IEXTEN = C::_IEXTEN; |
115 | public const EXTPROC = (1 << 11); /* External processing. */ |
116 | public const _TOSTOP = (1 << 22); /* Send SIGTTOU for background output. */ |
117 | public const TOSTOP = C::_TOSTOP; |
118 | public const FLUSHO = (1 << 23); /* Output being flushed (state). */ |
119 | public const XCASE = (1 << 24); /* Canonical upper/lower case. */ |
120 | public const NOKERNINFO = (1 << 25); /* Disable VSTATUS. */ |
121 | public const PENDIN = (1 << 29); /* Retype pending input (state). */ |
122 | public const _NOFLSH = (1 << 31); /* Disable flush after interrupt. */ |
123 | public const NOFLSH = C::_NOFLSH; |
124 | |
125 | /* Control characters */ |
126 | public const VEOF = 0; /* End-of-file character [ICANON]. */ |
127 | public const VEOL = 1; /* End-of-line character [ICANON]. */ |
128 | public const VEOL2 = 2; /* Second EOL character [ICANON]. */ |
129 | public const VERASE = 3; /* Erase character [ICANON]. */ |
130 | public const VWERASE = 4; /* Word-erase character [ICANON]. */ |
131 | public const VKILL = 5; /* Kill-line character [ICANON]. */ |
132 | public const VREPRINT = 6; /* Reprint-line character [ICANON]. */ |
133 | public const VINTR = 8; /* Interrupt character [ISIG]. */ |
134 | public const VQUIT = 9; /* Quit character [ISIG]. */ |
135 | public const VSUSP = 10; /* Suspend character [ISIG]. */ |
136 | public const VDSUSP = 11; /* Delayed suspend character [ISIG]. */ |
137 | public const VSTART = 12; /* Start (X-ON) character [IXON, IXOFF]. */ |
138 | public const VSTOP = 13; /* Stop (X-OFF) character [IXON, IXOFF]. */ |
139 | public const VLNEXT = 14; /* Literal-next character [IEXTEN]. */ |
140 | public const VDISCARD = 15; /* Discard character [IEXTEN]. */ |
141 | public const VMIN = 16; /* Minimum number of bytes read at once [!ICANON]. */ |
142 | public const VTIME = 17; /* Time-out value (tenths of a second) [!ICANON]. */ |
143 | public const VSTATUS = 18; /* Status character [ICANON]. */ |
144 | public const NCCS = 20; /* Value duplicated in <hurd/tioctl.defs>. */ |
145 | |
146 | // ------------------------------------------------------------------------ |
147 | // ! IOCTL constants |
148 | // ------------------------------------------------------------------------ |
149 | public const TIOCGWINSZ = 0x5413; |
150 | } |