0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4273: the EBCDIC support is outdated

Problem:    The EBCDIC support is outdated.
Solution:   Remove the EBCDIC support.
This commit is contained in:
Bram Moolenaar
2022-01-31 14:59:41 +00:00
parent eb6c276595
commit 424bcae1fb
43 changed files with 429 additions and 1302 deletions

View File

@@ -8,14 +8,8 @@
/*
* Definitions of various common control characters.
* For EBCDIC we have to use different values.
*/
#ifndef EBCDIC
// IF_EB(ASCII_constant, EBCDIC_constant)
#define IF_EB(a, b) a
#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
#define CharOrdLow(x) ((x) - 'a')
#define CharOrdUp(x) ((x) - 'A')
@@ -77,94 +71,6 @@
#define Ctrl_HAT 30 // ^
#define Ctrl__ 31
#else
// EBCDIC
// IF_EB(ASCII_constant, EBCDIC_constant)
#define IF_EB(a, b) b
/*
* Finding the position in the alphabet is not straightforward in EBCDIC.
* There are gaps in the code table.
* 'a' + 1 == 'b', but: 'i' + 7 == 'j' and 'r' + 8 == 's'
*/
#define CharOrd__(c) ((c) < ('j' - 'a') ? (c) : ((c) < ('s' - 'a') ? (c) - 7 : (c) - 7 - 8))
#define CharOrdLow(x) (CharOrd__((x) - 'a'))
#define CharOrdUp(x) (CharOrd__((x) - 'A'))
#define CharOrd(x) (isupper(x) ? CharOrdUp(x) : CharOrdLow(x))
#define EBCDIC_CHAR_ADD_(x) ((x) < 0?'a':(x)>25?'z':"abcdefghijklmnopqrstuvwxyz"[x])
#define EBCDIC_CHAR_ADD(c,s) (isupper(c) ? toupper(EBCDIC_CHAR_ADD_(CharOrdUp(c)+(s))) : EBCDIC_CHAR_ADD_(CharOrdLow(c)+(s)))
#define R13_(c) ("abcdefghijklmnopqrstuvwxyz"[((c) + 13) % 26])
#define ROT13(c, a) (isupper(c) ? toupper(R13_(CharOrdUp(c))) : R13_(CharOrdLow(c)))
#define NUL '\000'
#define BELL '\x2f'
#define BS '\x16'
#define TAB '\x05'
#define NL '\x15'
#define NL_STR (char_u *)"\x15"
#define FF '\x0C'
#define CAR '\x0D'
#define ESC '\x27'
#define ESC_STR (char_u *)"\x27"
#define ESC_STR_nc "\x27"
#define DEL 0x07
#define DEL_STR (char_u *)"\007"
#define POUND 0xB1
#define CTRL_F_STR "\056"
#define CTRL_H_STR "\026"
#define CTRL_V_STR "\062"
#define Ctrl_AT 0x00 // @
#define Ctrl_A 0x01
#define Ctrl_B 0x02
#define Ctrl_C 0x03
#define Ctrl_D 0x37
#define Ctrl_E 0x2D
#define Ctrl_F 0x2E
#define Ctrl_G 0x2F
#define Ctrl_H 0x16
#define Ctrl_I 0x05
#define Ctrl_J 0x15
#define Ctrl_K 0x0B
#define Ctrl_L 0x0C
#define Ctrl_M 0x0D
#define Ctrl_N 0x0E
#define Ctrl_O 0x0F
#define Ctrl_P 0x10
#define Ctrl_Q 0x11
#define Ctrl_R 0x12
#define Ctrl_S 0x13
#define Ctrl_T 0x3C
#define Ctrl_U 0x3D
#define Ctrl_V 0x32
#define Ctrl_W 0x26
#define Ctrl_X 0x18
#define Ctrl_Y 0x19
#define Ctrl_Z 0x3F
// CTRL- [ Left Square Bracket == ESC
#define Ctrl_RSB 0x1D // ] Right Square Bracket
#define Ctrl_BSL 0x1C // \ BackSLash
#define Ctrl_HAT 0x1E // ^
#define Ctrl__ 0x1F
#define Ctrl_chr(x) (CtrlTable[(x)])
extern char CtrlTable[];
#define CtrlChar(x) ((x < ' ') ? CtrlCharTable[(x)] : 0)
extern char CtrlCharTable[];
#define MetaChar(x) ((x < ' ') ? MetaCharTable[(x)] : 0)
extern char MetaCharTable[];
#endif // defined EBCDIC
// TODO: EBCDIC Code page dependent (here 1047)
#define CSI 0x9b // Control Sequence Introducer
#define CSI_STR "\233"
#define DCS 0x90 // Device Control String