Skip to main content

uncurses/ansi/
c1.rs

1//! C1 control bytes (`0x80..=0x9f`).
2//!
3//! ## Category
4//!
5//! C1 controls are the 8-bit single-byte forms of terminal controls such as DCS,
6//! CSI, ST, OSC, PM, and APC.
7//!
8//! ## 7-bit versus 8-bit forms
9//!
10//! Each C1 byte has a 7-bit fallback spelling `ESC` followed by `byte - 0x40`.
11//! For example, [`CSI`] is `0x9b` while the 7-bit CSI introducer is the two-byte
12//! sequence `ESC [`.
13//!
14//! ```text
15//! 8-bit:  9B        CSI
16//! 7-bit:  1B 5B     ESC [
17//!        ─┬ ─┬
18//!        ESC final
19//! ```
20//!
21//! ## Mode interaction
22//!
23//! The byte constants do not enable any terminal mode. The tokenizer recognizes
24//! the C1 introducers directly and also recognizes their 7-bit `ESC` forms.
25
26/// Padding Character C1 control byte `0x80`.
27pub const PAD: u8 = 0x80;
28/// High Octet Preset C1 control byte `0x81`.
29pub const HOP: u8 = 0x81;
30/// Break Permitted Here C1 control byte `0x82`.
31pub const BPH: u8 = 0x82;
32/// No Break Here C1 control byte `0x83`.
33pub const NBH: u8 = 0x83;
34/// Index C1 control byte `0x84`; 7-bit spelling is `ESC D`.
35pub const IND: u8 = 0x84;
36/// Next Line C1 control byte `0x85`; 7-bit spelling is `ESC E`.
37pub const NEL: u8 = 0x85;
38/// Start of Selected Area C1 control byte `0x86`.
39pub const SSA: u8 = 0x86;
40/// End of Selected Area C1 control byte `0x87`.
41pub const ESA: u8 = 0x87;
42/// Horizontal Tab Set C1 control byte `0x88`; 7-bit spelling is `ESC H`.
43pub const HTS: u8 = 0x88;
44/// Horizontal Tab with Justify C1 control byte `0x89`.
45pub const HTJ: u8 = 0x89;
46/// Vertical Tab Set C1 control byte `0x8a`.
47pub const VTS: u8 = 0x8A;
48/// Partial Line Down C1 control byte `0x8b`.
49pub const PLD: u8 = 0x8B;
50/// Partial Line Up C1 control byte `0x8c`.
51pub const PLU: u8 = 0x8C;
52/// Reverse Index C1 control byte `0x8d`; 7-bit spelling is `ESC M`.
53pub const RI: u8 = 0x8D;
54/// Single Shift 2 C1 control byte `0x8e`; 7-bit spelling is `ESC N`.
55pub const SS2: u8 = 0x8E;
56/// Single Shift 3 C1 control byte `0x8f`; 7-bit spelling is `ESC O`.
57pub const SS3: u8 = 0x8F;
58/// Device Control String introducer byte `0x90`; 7-bit spelling is `ESC P` and terminator is [`ST`].
59pub const DCS: u8 = 0x90;
60/// Private Use 1 C1 control byte `0x91`.
61pub const PU1: u8 = 0x91;
62/// Private Use 2 C1 control byte `0x92`.
63pub const PU2: u8 = 0x92;
64/// Set Transmit State C1 control byte `0x93`.
65pub const STS: u8 = 0x93;
66/// Cancel Character C1 control byte `0x94`.
67pub const CCH: u8 = 0x94;
68/// Message Waiting C1 control byte `0x95`.
69pub const MW: u8 = 0x95;
70/// Start of Protected Area C1 control byte `0x96`.
71pub const SPA: u8 = 0x96;
72/// End of Protected Area C1 control byte `0x97`.
73pub const EPA: u8 = 0x97;
74/// Start of String introducer byte `0x98`; 7-bit spelling is `ESC X`.
75pub const SOS: u8 = 0x98;
76/// Single Graphic Character Introducer C1 control byte `0x99`.
77pub const SGCI: u8 = 0x99;
78/// Single Character Introducer C1 control byte `0x9a`.
79pub const SCI: u8 = 0x9A;
80/// Control Sequence Introducer byte `0x9b`; 7-bit spelling is `ESC [`.
81pub const CSI: u8 = 0x9B;
82/// String Terminator byte `0x9c`; 7-bit spelling is `ESC \`.
83pub const ST: u8 = 0x9C;
84/// Operating System Command introducer byte `0x9d`; 7-bit spelling is `ESC ]`.
85pub const OSC: u8 = 0x9D;
86/// Privacy Message introducer byte `0x9e`; 7-bit spelling is `ESC ^`.
87pub const PM: u8 = 0x9E;
88/// Application Program Command introducer byte `0x9f`; 7-bit spelling is `ESC _`.
89pub const APC: u8 = 0x9F;