mirror of
https://github.com/ziglang/zig.git
synced 2025-12-23 14:43:17 +00:00
feat: new control_code
It lowercases all constants and documents them.
This commit is contained in:
parent
d2342370fe
commit
aa0b93e875
@ -12,43 +12,77 @@ const std = @import("std");
|
|||||||
/// Contains constants for the C0 control codes of the ASCII encoding.
|
/// Contains constants for the C0 control codes of the ASCII encoding.
|
||||||
/// https://en.wikipedia.org/wiki/C0_and_C1_control_codes
|
/// https://en.wikipedia.org/wiki/C0_and_C1_control_codes
|
||||||
pub const control_code = struct {
|
pub const control_code = struct {
|
||||||
pub const NUL = 0x00;
|
/// Null.
|
||||||
pub const SOH = 0x01;
|
pub const nul = 0x00;
|
||||||
pub const STX = 0x02;
|
/// Start of Heading.
|
||||||
pub const ETX = 0x03;
|
pub const soh = 0x01;
|
||||||
pub const EOT = 0x04;
|
/// Start of Text.
|
||||||
pub const ENQ = 0x05;
|
pub const stx = 0x02;
|
||||||
pub const ACK = 0x06;
|
/// End of Text.
|
||||||
pub const BEL = 0x07;
|
pub const etx = 0x03;
|
||||||
pub const BS = 0x08;
|
/// End of Transmission.
|
||||||
pub const TAB = 0x09;
|
pub const eot = 0x04;
|
||||||
pub const LF = 0x0A;
|
/// Enquiry.
|
||||||
pub const VT = 0x0B;
|
pub const enq = 0x05;
|
||||||
pub const FF = 0x0C;
|
/// Acknowledge.
|
||||||
pub const CR = 0x0D;
|
pub const ack = 0x06;
|
||||||
pub const SO = 0x0E;
|
/// Bell, Alert.
|
||||||
pub const SI = 0x0F;
|
pub const bel = 0x07;
|
||||||
pub const DLE = 0x10;
|
/// Backspace.
|
||||||
pub const DC1 = 0x11;
|
pub const bs = 0x08;
|
||||||
pub const DC2 = 0x12;
|
/// Horizontal Tab, Tab ('\t').
|
||||||
pub const DC3 = 0x13;
|
pub const ht = 0x09;
|
||||||
pub const DC4 = 0x14;
|
/// Line Feed, Newline ('\n').
|
||||||
pub const NAK = 0x15;
|
pub const lf = 0x0A;
|
||||||
pub const SYN = 0x16;
|
/// Vertical Tab.
|
||||||
pub const ETB = 0x17;
|
pub const vt = 0x0B;
|
||||||
pub const CAN = 0x18;
|
/// Form Feed.
|
||||||
pub const EM = 0x19;
|
pub const ff = 0x0C;
|
||||||
pub const SUB = 0x1A;
|
/// Carriage Return ('\r').
|
||||||
pub const ESC = 0x1B;
|
pub const cr = 0x0D;
|
||||||
pub const FS = 0x1C;
|
/// Shift Out.
|
||||||
pub const GS = 0x1D;
|
pub const so = 0x0E;
|
||||||
pub const RS = 0x1E;
|
/// Shift In.
|
||||||
pub const US = 0x1F;
|
pub const si = 0x0F;
|
||||||
|
/// Data Link Escape.
|
||||||
|
pub const dle = 0x10;
|
||||||
|
/// Device Control One (XON).
|
||||||
|
pub const dc1 = 0x11;
|
||||||
|
/// Device Control Two.
|
||||||
|
pub const dc2 = 0x12;
|
||||||
|
/// Device Control Three (XOFF).
|
||||||
|
pub const dc3 = 0x13;
|
||||||
|
/// Device Control Four.
|
||||||
|
pub const dc4 = 0x14;
|
||||||
|
/// Negative Acknowledge.
|
||||||
|
pub const nak = 0x15;
|
||||||
|
/// Synchronous Idle.
|
||||||
|
pub const syn = 0x16;
|
||||||
|
/// End of Transmission Block
|
||||||
|
pub const etb = 0x17;
|
||||||
|
/// Cancel.
|
||||||
|
pub const can = 0x18;
|
||||||
|
/// End of Medium.
|
||||||
|
pub const em = 0x19;
|
||||||
|
/// Substitute.
|
||||||
|
pub const sub = 0x1A;
|
||||||
|
/// Escape.
|
||||||
|
pub const esc = 0x1B;
|
||||||
|
/// File separator.
|
||||||
|
pub const fs = 0x1C;
|
||||||
|
/// Group Separator.
|
||||||
|
pub const gs = 0x1D;
|
||||||
|
/// Record Separator.
|
||||||
|
pub const rs = 0x1E;
|
||||||
|
/// Unit separator.
|
||||||
|
pub const us = 0x1F;
|
||||||
|
/// Delete.
|
||||||
|
pub const del = 0x7F;
|
||||||
|
|
||||||
pub const DEL = 0x7F;
|
/// An alias to `dc1`.
|
||||||
|
pub const xon = dc1;
|
||||||
pub const XON = 0x11;
|
/// An alias to `dc3`.
|
||||||
pub const XOFF = 0x13;
|
pub const xff = dc3;
|
||||||
};
|
};
|
||||||
|
|
||||||
const tIndex = enum(u3) {
|
const tIndex = enum(u3) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user