From patchwork Thu Apr 4 23:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Erickson X-Patchwork-Id: 13618299 Received: from mail5.g24.pair.com (mail5.g24.pair.com [66.39.139.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3131F13C697 for ; Thu, 4 Apr 2024 23:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.39.139.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712273921; cv=none; b=M82DNEmJBmIPOcB+RH5/iuKFz/MA1Oei4H8+0+J2O4NZAn4GHeJqp5U8zXT7DRB+jueKQSolOY134sNYk1dbeEJ8h97XQxHywHuKUqpJexpN5ZCnugGsVUiAlg933TpGfyv1mhgNYKrBQD5mL1ET1+lCHZZ/Jym91aoyMbP/2Mc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712273921; c=relaxed/simple; bh=9yjcMyn/DaXMlefPfVET9T/1WtizLqM5/cxIDMJD5J0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kw9ggn5GYV82+sfzzoAyk72K9baf2i5XrjlUYXDfIqJqTtAAIMJZUsY/gpTC6gdZkOjkGhelwu+XbJFaFVSw107DpcDnPXHynvXiZHhKSrl8QXvZCVqx7+/vSghsRaPrURtC/Be3a2YPqNv2oYUGpob0aI35XK64l/Yvrmr5Bc0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com; spf=pass smtp.mailfrom=nuovations.com; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b=CV/Qn0yJ; arc=none smtp.client-ip=66.39.139.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nuovations.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuovations.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nuovations.com header.i=@nuovations.com header.b="CV/Qn0yJ" Received: from mail5.g24.pair.com (localhost [127.0.0.1]) by mail5.g24.pair.com (Postfix) with ESMTP id 07CD6164A8B; Thu, 4 Apr 2024 19:38:33 -0400 (EDT) Received: from localhost.localdomain (c-24-6-12-99.hsd1.ca.comcast.net [24.6.12.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail5.g24.pair.com (Postfix) with ESMTPSA id 90843124F66; Thu, 4 Apr 2024 19:38:32 -0400 (EDT) From: Grant Erickson To: ell@lists.linux.dev Cc: Marcel Holtmann Subject: [RFC PATCH v7] ell/term: Added ASCII C0 and C1 control code mnemonics. Date: Thu, 4 Apr 2024 16:38:26 -0700 Message-ID: <20240404233826.3466674-10-gerickson@nuovations.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240404233826.3466674-1-gerickson@nuovations.com> References: <20240404233826.3466674-1-gerickson@nuovations.com> Precedence: bulk X-Mailing-List: ell@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuovations.com; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=pair-202401062137; bh=lz3jdtMnj5GU+0+HAwHjlYCn0io/RmyeHdrlepoWZzA=; b=CV/Qn0yJctS8SKjfLt0I9bkpBzO7KZUBFKNyJCyScHNnUj1QQgXGQfBBASmyYKx1JSPCgIqGVAFI5f+fT3whTeL14JNyU8nhGsC9KLksmHFWYmycWHtos6QCNhiPMCUGkfTqVFSD1g0qe7aVw8gN1duLDuBe4rS+CUvKiKZ8KqWcL2rHm1aPifBL/CdnK6vpYf3K8dIaDPMSBO/FNdL7Vlc0iUHg09XlKbWaF5nRYV5sdMoM447Qay/cfPUtyLE8JI/pSqcs7GWtRXhdpvzA+4rYhvzm24zTwWXHmnyzB+/kAz0Afb4VlcUj9DLhU416r87rtHKMLypquT1r36OHqQ== X-Scanned-By: mailmunge 3.10 on 66.39.139.36 Added ASCII C0 and C1 control code mnemonics useful to anyone implementing a l_term key handler. --- ell/term.h | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/ell/term.h b/ell/term.h index 66059212b436..caf84e2b71dc 100644 --- a/ell/term.h +++ b/ell/term.h @@ -18,6 +18,150 @@ extern "C" { #endif +enum { + L_TERM_CONTROL_CODE_ASCII_C0_NUL = 0x00, + L_TERM_CONTROL_CODE_ASCII_C0_SOH = 0x01, + L_TERM_CONTROL_CODE_ASCII_C0_TC1 = L_TERM_CONTROL_CODE_ASCII_C0_SOH, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_A = L_TERM_CONTROL_CODE_ASCII_C0_SOH, + L_TERM_CONTROL_CODE_ASCII_C0_STX = 0x02, + L_TERM_CONTROL_CODE_ASCII_C0_TC2 = L_TERM_CONTROL_CODE_ASCII_C0_STX, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_B = L_TERM_CONTROL_CODE_ASCII_C0_STX, + L_TERM_CONTROL_CODE_ASCII_C0_ETX = 0x03, + L_TERM_CONTROL_CODE_ASCII_C0_TC3 = L_TERM_CONTROL_CODE_ASCII_C0_ETX, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_C = L_TERM_CONTROL_CODE_ASCII_C0_ETX, + L_TERM_CONTROL_CODE_ASCII_C0_EOT = 0x04, + L_TERM_CONTROL_CODE_ASCII_C0_TC4 = L_TERM_CONTROL_CODE_ASCII_C0_EOT, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_D = L_TERM_CONTROL_CODE_ASCII_C0_EOT, + L_TERM_CONTROL_CODE_ASCII_C0_ENQ = 0x05, + L_TERM_CONTROL_CODE_ASCII_C0_TC5 = L_TERM_CONTROL_CODE_ASCII_C0_ENQ, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_E = L_TERM_CONTROL_CODE_ASCII_C0_ENQ, + L_TERM_CONTROL_CODE_ASCII_C0_ACK = 0x06, + L_TERM_CONTROL_CODE_ASCII_C0_TC6 = L_TERM_CONTROL_CODE_ASCII_C0_ACK, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_F = L_TERM_CONTROL_CODE_ASCII_C0_ACK, + L_TERM_CONTROL_CODE_ASCII_C0_BEL = 0x07, + L_TERM_CONTROL_CODE_ASCII_C0_BS = 0x08, + L_TERM_CONTROL_CODE_ASCII_C0_FE0 = L_TERM_CONTROL_CODE_ASCII_C0_BS, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_H = L_TERM_CONTROL_CODE_ASCII_C0_BS, + L_TERM_CONTROL_CODE_ASCII_C0_HT = 0x09, + L_TERM_CONTROL_CODE_ASCII_C0_FE1 = L_TERM_CONTROL_CODE_ASCII_C0_HT, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_I = L_TERM_CONTROL_CODE_ASCII_C0_HT, + L_TERM_CONTROL_CODE_ASCII_C0_LF = 0x0A, + L_TERM_CONTROL_CODE_ASCII_C0_FE2 = L_TERM_CONTROL_CODE_ASCII_C0_LF, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_J = L_TERM_CONTROL_CODE_ASCII_C0_LF, + L_TERM_CONTROL_CODE_ASCII_C0_VT = 0x0B, + L_TERM_CONTROL_CODE_ASCII_C0_FE3 = L_TERM_CONTROL_CODE_ASCII_C0_VT, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_K = L_TERM_CONTROL_CODE_ASCII_C0_VT, + L_TERM_CONTROL_CODE_ASCII_C0_FF = 0x0C, + L_TERM_CONTROL_CODE_ASCII_C0_FE4 = L_TERM_CONTROL_CODE_ASCII_C0_FF, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_L = L_TERM_CONTROL_CODE_ASCII_C0_FF, + L_TERM_CONTROL_CODE_ASCII_C0_CR = 0x0D, + L_TERM_CONTROL_CODE_ASCII_C0_FE5 = L_TERM_CONTROL_CODE_ASCII_C0_CR, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_M = L_TERM_CONTROL_CODE_ASCII_C0_CR, + L_TERM_CONTROL_CODE_ASCII_C0_SO = 0x0E, + L_TERM_CONTROL_CODE_ASCII_C0_LS0 = L_TERM_CONTROL_CODE_ASCII_C0_SO, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_N = L_TERM_CONTROL_CODE_ASCII_C0_SO, + L_TERM_CONTROL_CODE_ASCII_C0_SI = 0x0F, + L_TERM_CONTROL_CODE_ASCII_C0_LS1 = L_TERM_CONTROL_CODE_ASCII_C0_SI, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_O = L_TERM_CONTROL_CODE_ASCII_C0_SI, + L_TERM_CONTROL_CODE_ASCII_C0_DLE = 0x10, + L_TERM_CONTROL_CODE_ASCII_C0_TC7 = L_TERM_CONTROL_CODE_ASCII_C0_DLE, + L_TERM_CONTROL_CODE_ASCII_C0_DC0 = L_TERM_CONTROL_CODE_ASCII_C0_DLE, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_P = L_TERM_CONTROL_CODE_ASCII_C0_DLE, + L_TERM_CONTROL_CODE_ASCII_C0_XON = 0x11, + L_TERM_CONTROL_CODE_ASCII_C0_DC1 = L_TERM_CONTROL_CODE_ASCII_C0_XON, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_Q = L_TERM_CONTROL_CODE_ASCII_C0_XON, + L_TERM_CONTROL_CODE_ASCII_C0_TAPE = 0x12, + L_TERM_CONTROL_CODE_ASCII_C0_DC2 = L_TERM_CONTROL_CODE_ASCII_C0_TAPE, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_R = L_TERM_CONTROL_CODE_ASCII_C0_TAPE, + L_TERM_CONTROL_CODE_ASCII_C0_XOFF = 0x13, + L_TERM_CONTROL_CODE_ASCII_C0_DC3 = L_TERM_CONTROL_CODE_ASCII_C0_XOFF, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_S = L_TERM_CONTROL_CODE_ASCII_C0_XOFF, + L_TERM_CONTROL_CODE_ASCII_C0_DC4 = 0x14, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_T = L_TERM_CONTROL_CODE_ASCII_C0_DC4, + L_TERM_CONTROL_CODE_ASCII_C0_NAK = 0x15, + L_TERM_CONTROL_CODE_ASCII_C0_TC8 = L_TERM_CONTROL_CODE_ASCII_C0_NAK, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_U = 0x15, + L_TERM_CONTROL_CODE_ASCII_C0_SYN = 0x16, + L_TERM_CONTROL_CODE_ASCII_C0_TC9 = L_TERM_CONTROL_CODE_ASCII_C0_SYN, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_V = 0x16, + L_TERM_CONTROL_CODE_ASCII_C0_ETB = 0x17, + L_TERM_CONTROL_CODE_ASCII_C0_TC10 = L_TERM_CONTROL_CODE_ASCII_C0_ETB, + L_TERM_CONTROL_CODE_ASCII_C0_CTRL_W = L_TERM_CONTROL_CODE_ASCII_C0_ETB, + L_TERM_CONTROL_CODE_ASCII_C0_CAN = 0x18, + L_TERM_CONTROL_CODE_ASCII_C0_EM = 0x19, + L_TERM_CONTROL_CODE_ASCII_C0_SUB = 0x1A, + L_TERM_CONTROL_CODE_ASCII_C0_ESC = 0x1B, + L_TERM_CONTROL_CODE_ASCII_C0_FS = 0x1C, + L_TERM_CONTROL_CODE_ASCII_C0_IS4 = L_TERM_CONTROL_CODE_ASCII_C0_FS, + L_TERM_CONTROL_CODE_ASCII_C0_GS = 0x1D, + L_TERM_CONTROL_CODE_ASCII_C0_IS3 = L_TERM_CONTROL_CODE_ASCII_C0_GS, + L_TERM_CONTROL_CODE_ASCII_C0_RS = 0x1E, + L_TERM_CONTROL_CODE_ASCII_C0_IS2 = L_TERM_CONTROL_CODE_ASCII_C0_RS, + L_TERM_CONTROL_CODE_ASCII_C0_US = 0x1F, + L_TERM_CONTROL_CODE_ASCII_C0_IS1 = L_TERM_CONTROL_CODE_ASCII_C0_US, + L_TERM_CONTROL_CODE_ASCII_C0_DEL = 0x7F, + + L_TERM_CONTROL_CODE_ASCII_C1_PAD = 0x80, + L_TERM_CONTROL_CODE_ASCII_C1_HOP = 0x81, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_A = L_TERM_CONTROL_CODE_ASCII_C1_HOP, + L_TERM_CONTROL_CODE_ASCII_C1_BPH = 0x82, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_B = L_TERM_CONTROL_CODE_ASCII_C1_BPH, + L_TERM_CONTROL_CODE_ASCII_C1_NBH = 0x83, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_C = L_TERM_CONTROL_CODE_ASCII_C1_NBH, + L_TERM_CONTROL_CODE_ASCII_C1_IND = 0x84, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_D = L_TERM_CONTROL_CODE_ASCII_C1_IND, + L_TERM_CONTROL_CODE_ASCII_C1_NEL = 0x85, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_E = L_TERM_CONTROL_CODE_ASCII_C1_NEL, + L_TERM_CONTROL_CODE_ASCII_C1_SSA = 0x86, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_F = L_TERM_CONTROL_CODE_ASCII_C1_SSA, + L_TERM_CONTROL_CODE_ASCII_C1_ESA = 0x87, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_G = L_TERM_CONTROL_CODE_ASCII_C1_ESA, + L_TERM_CONTROL_CODE_ASCII_C1_HTS = 0x88, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_H = L_TERM_CONTROL_CODE_ASCII_C1_HTS, + L_TERM_CONTROL_CODE_ASCII_C1_HTJ = 0x89, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_I = L_TERM_CONTROL_CODE_ASCII_C1_HTJ, + L_TERM_CONTROL_CODE_ASCII_C1_VTS = 0x8A, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_J = L_TERM_CONTROL_CODE_ASCII_C1_VTS, + L_TERM_CONTROL_CODE_ASCII_C1_PLD = 0x8B, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_K = L_TERM_CONTROL_CODE_ASCII_C1_PLD, + L_TERM_CONTROL_CODE_ASCII_C1_PLU = 0x8C, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_L = L_TERM_CONTROL_CODE_ASCII_C1_PLU, + L_TERM_CONTROL_CODE_ASCII_C1_RI = 0x8D, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_M = L_TERM_CONTROL_CODE_ASCII_C1_RI, + L_TERM_CONTROL_CODE_ASCII_C1_SS2 = 0x8E, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_N = L_TERM_CONTROL_CODE_ASCII_C1_SS2, + L_TERM_CONTROL_CODE_ASCII_C1_SS3 = 0x8F, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_O = L_TERM_CONTROL_CODE_ASCII_C1_SS3, + L_TERM_CONTROL_CODE_ASCII_C1_DCS = 0x90, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_P = L_TERM_CONTROL_CODE_ASCII_C1_DCS, + L_TERM_CONTROL_CODE_ASCII_C1_PU1 = 0x91, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_Q = L_TERM_CONTROL_CODE_ASCII_C1_PU1, + L_TERM_CONTROL_CODE_ASCII_C1_PU2 = 0x92, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_R = L_TERM_CONTROL_CODE_ASCII_C1_PU2, + L_TERM_CONTROL_CODE_ASCII_C1_STS = 0x93, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_S = L_TERM_CONTROL_CODE_ASCII_C1_STS, + L_TERM_CONTROL_CODE_ASCII_C1_CCH = 0x94, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_T = L_TERM_CONTROL_CODE_ASCII_C1_CCH, + L_TERM_CONTROL_CODE_ASCII_C1_MW = 0x95, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_U = L_TERM_CONTROL_CODE_ASCII_C1_MW, + L_TERM_CONTROL_CODE_ASCII_C1_SPA = 0x96, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_V = L_TERM_CONTROL_CODE_ASCII_C1_SPA, + L_TERM_CONTROL_CODE_ASCII_C1_EPA = 0x97, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_W = L_TERM_CONTROL_CODE_ASCII_C1_EPA, + L_TERM_CONTROL_CODE_ASCII_C1_SOS = 0x98, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_X = L_TERM_CONTROL_CODE_ASCII_C1_SOS, + L_TERM_CONTROL_CODE_ASCII_C1_SGC = 0x99, + L_TERM_CONTROL_CODE_ASCII_C1_SGCI = L_TERM_CONTROL_CODE_ASCII_C1_SGC, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_Y = L_TERM_CONTROL_CODE_ASCII_C1_SGC, + L_TERM_CONTROL_CODE_ASCII_C1_SCI = 0x9A, + L_TERM_CONTROL_CODE_ASCII_C1_ESC_Z = L_TERM_CONTROL_CODE_ASCII_C1_SCI, + L_TERM_CONTROL_CODE_ASCII_C1_CSI = 0x9B, + L_TERM_CONTROL_CODE_ASCII_C1_ST = 0x9C, + L_TERM_CONTROL_CODE_ASCII_C1_OSC = 0x9D, + L_TERM_CONTROL_CODE_ASCII_C1_PM = 0x9E, + L_TERM_CONTROL_CODE_ASCII_C1_APC = 0x9F; +}; + struct l_term; struct l_term *l_term_new(void);