| ... | @@ -9,6 +9,48 @@ | ... | @@ -9,6 +9,48 @@ |
| 9 | | 9 | |
| 10 | const std = @import("std"); | 10 | const std = @import("std"); |
| 11 | | 11 | |
| | 12 | /// Contains constants for the C0 control codes of the ASCII encoding. |
| | 13 | /// https://en.wikipedia.org/wiki/C0_and_C1_control_codes |
| | 14 | pub const control_code = struct { |
| | 15 | pub const NUL = 0x00; |
| | 16 | pub const SOH = 0x01; |
| | 17 | pub const STX = 0x02; |
| | 18 | pub const ETX = 0x03; |
| | 19 | pub const EOT = 0x04; |
| | 20 | pub const ENQ = 0x05; |
| | 21 | pub const ACK = 0x06; |
| | 22 | pub const BEL = 0x07; |
| | 23 | pub const BS = 0x08; |
| | 24 | pub const TAB = 0x09; |
| | 25 | pub const LF = 0x0A; |
| | 26 | pub const VT = 0x0B; |
| | 27 | pub const FF = 0x0C; |
| | 28 | pub const CR = 0x0D; |
| | 29 | pub const SO = 0x0E; |
| | 30 | pub const SI = 0x0F; |
| | 31 | pub const DLE = 0x10; |
| | 32 | pub const DC1 = 0x11; |
| | 33 | pub const DC2 = 0x12; |
| | 34 | pub const DC3 = 0x13; |
| | 35 | pub const DC4 = 0x14; |
| | 36 | pub const NAK = 0x15; |
| | 37 | pub const SYN = 0x16; |
| | 38 | pub const ETB = 0x17; |
| | 39 | pub const CAN = 0x18; |
| | 40 | pub const EM = 0x19; |
| | 41 | pub const SUB = 0x1A; |
| | 42 | pub const ESC = 0x1B; |
| | 43 | pub const FS = 0x1C; |
| | 44 | pub const GS = 0x1D; |
| | 45 | pub const RS = 0x1E; |
| | 46 | pub const US = 0x1F; |
| | 47 | |
| | 48 | pub const DEL = 0x7F; |
| | 49 | |
| | 50 | pub const XON = 0x11; |
| | 51 | pub const XOFF = 0x13; |
| | 52 | }; |
| | 53 | |
| 12 | const tIndex = enum(u3) { | 54 | const tIndex = enum(u3) { |
| 13 | Alpha, | 55 | Alpha, |
| 14 | Hex, | 56 | Hex, |