| ... | @@ -12,43 +12,77 @@ const std = @import("std"); | ... | @@ -12,43 +12,77 @@ const std = @import("std"); |
| 12 | /// Contains constants for the C0 control codes of the ASCII encoding. | 12 | /// Contains constants for the C0 control codes of the ASCII encoding. |
| 13 | /// https://en.wikipedia.org/wiki/C0_and_C1_control_codes | 13 | /// https://en.wikipedia.org/wiki/C0_and_C1_control_codes |
| 14 | pub const control_code = struct { | 14 | pub const control_code = struct { |
| 15 | pub const NUL = 0x00; | 15 | /// Null. |
| 16 | pub const SOH = 0x01; | 16 | pub const nul = 0x00; |
| 17 | pub const STX = 0x02; | 17 | /// Start of Heading. |
| 18 | pub const ETX = 0x03; | 18 | pub const soh = 0x01; |
| 19 | pub const EOT = 0x04; | 19 | /// Start of Text. |
| 20 | pub const ENQ = 0x05; | 20 | pub const stx = 0x02; |
| 21 | pub const ACK = 0x06; | 21 | /// End of Text. |
| 22 | pub const BEL = 0x07; | 22 | pub const etx = 0x03; |
| 23 | pub const BS = 0x08; | 23 | /// End of Transmission. |
| 24 | pub const TAB = 0x09; | 24 | pub const eot = 0x04; |
| 25 | pub const LF = 0x0A; | 25 | /// Enquiry. |
| 26 | pub const VT = 0x0B; | 26 | pub const enq = 0x05; |
| 27 | pub const FF = 0x0C; | 27 | /// Acknowledge. |
| 28 | pub const CR = 0x0D; | 28 | pub const ack = 0x06; |
| 29 | pub const SO = 0x0E; | 29 | /// Bell, Alert. |
| 30 | pub const SI = 0x0F; | 30 | pub const bel = 0x07; |
| 31 | pub const DLE = 0x10; | 31 | /// Backspace. |
| 32 | pub const DC1 = 0x11; | 32 | pub const bs = 0x08; |
| 33 | pub const DC2 = 0x12; | 33 | /// Horizontal Tab, Tab ('\t'). |
| 34 | pub const DC3 = 0x13; | 34 | pub const ht = 0x09; |
| 35 | pub const DC4 = 0x14; | 35 | /// Line Feed, Newline ('\n'). |
| 36 | pub const NAK = 0x15; | 36 | pub const lf = 0x0A; |
| 37 | pub const SYN = 0x16; | 37 | /// Vertical Tab. |
| 38 | pub const ETB = 0x17; | 38 | pub const vt = 0x0B; |
| 39 | pub const CAN = 0x18; | 39 | /// Form Feed. |
| 40 | pub const EM = 0x19; | 40 | pub const ff = 0x0C; |
| 41 | pub const SUB = 0x1A; | 41 | /// Carriage Return ('\r'). |
| 42 | pub const ESC = 0x1B; | 42 | pub const cr = 0x0D; |
| 43 | pub const FS = 0x1C; | 43 | /// Shift Out. |
| 44 | pub const GS = 0x1D; | 44 | pub const so = 0x0E; |
| 45 | pub const RS = 0x1E; | 45 | /// Shift In. |
| 46 | pub const US = 0x1F; | 46 | pub const si = 0x0F; |
| 47 | | 47 | /// Data Link Escape. |
| 48 | pub const DEL = 0x7F; | 48 | pub const dle = 0x10; |
| 49 | | 49 | /// Device Control One (XON). |
| 50 | pub const XON = 0x11; | 50 | pub const dc1 = 0x11; |
| 51 | pub const XOFF = 0x13; | 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 | const tIndex = enum(u3) { | 88 | const tIndex = enum(u3) { |