| ... | ... | @@ -12,43 +12,77 @@ const std = @import("std"); |
| 12 | 12 | /// Contains constants for the C0 control codes of the ASCII encoding. |
| 13 | 13 | /// https://en.wikipedia.org/wiki/C0_and_C1_control_codes |
| 14 | 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; |
| 15 | /// Null. |
| 16 | pub const nul = 0x00; |
| 17 | /// Start of Heading. |
| 18 | pub const soh = 0x01; |
| 19 | /// Start of Text. |
| 20 | pub const stx = 0x02; |
| 21 | /// End of Text. |
| 22 | pub const etx = 0x03; |
| 23 | /// End of Transmission. |
| 24 | pub const eot = 0x04; |
| 25 | /// Enquiry. |
| 26 | pub const enq = 0x05; |
| 27 | /// Acknowledge. |
| 28 | pub const ack = 0x06; |
| 29 | /// Bell, Alert. |
| 30 | pub const bel = 0x07; |
| 31 | /// Backspace. |
| 32 | pub const bs = 0x08; |
| 33 | /// Horizontal Tab, Tab ('\t'). |
| 34 | pub const ht = 0x09; |
| 35 | /// Line Feed, Newline ('\n'). |
| 36 | pub const lf = 0x0A; |
| 37 | /// Vertical Tab. |
| 38 | pub const vt = 0x0B; |
| 39 | /// Form Feed. |
| 40 | pub const ff = 0x0C; |
| 41 | /// Carriage Return ('\r'). |
| 42 | pub const cr = 0x0D; |
| 43 | /// Shift Out. |
| 44 | pub const so = 0x0E; |
| 45 | /// Shift In. |
| 46 | pub const si = 0x0F; |
| 47 | /// Data Link Escape. |
| 48 | pub const dle = 0x10; |
| 49 | /// Device Control One (XON). |
| 50 | pub const dc1 = 0x11; |
| 51 | /// Device Control Two. |
| 52 | pub const dc2 = 0x12; |
| 53 | /// Device Control Three (XOFF). |
| 54 | pub const dc3 = 0x13; |
| 55 | /// Device Control Four. |
| 56 | pub const dc4 = 0x14; |
| 57 | /// Negative Acknowledge. |
| 58 | pub const nak = 0x15; |
| 59 | /// Synchronous Idle. |
| 60 | pub const syn = 0x16; |
| 61 | /// End of Transmission Block |
| 62 | pub const etb = 0x17; |
| 63 | /// Cancel. |
| 64 | pub const can = 0x18; |
| 65 | /// End of Medium. |
| 66 | pub const em = 0x19; |
| 67 | /// Substitute. |
| 68 | pub const sub = 0x1A; |
| 69 | /// Escape. |
| 70 | pub const esc = 0x1B; |
| 71 | /// File separator. |
| 72 | pub const fs = 0x1C; |
| 73 | /// Group Separator. |
| 74 | pub const gs = 0x1D; |
| 75 | /// Record Separator. |
| 76 | pub const rs = 0x1E; |
| 77 | /// Unit separator. |
| 78 | pub const us = 0x1F; |
| 79 | /// Delete. |
| 80 | pub const del = 0x7F; |
| 81 | |
| 82 | /// An alias to `dc1`. |
| 83 | pub const xon = dc1; |
| 84 | /// An alias to `dc3`. |
| 85 | pub const xff = dc3; |
| 52 | 86 | }; |
| 53 | 87 | |
| 54 | 88 | const tIndex = enum(u3) { |