summaryrefslogtreecommitdiff
path: root/ebcdic_tables.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-07-01 12:43:59 -0600
committerKarl Williamson <khw@cpan.org>2018-07-05 14:47:18 -0600
commitc05125c57fd7868af65366bacb6fe40c04b1c719 (patch)
treee985aa77d5abf8cf39a464fe1efb8fa8e31e67cb /ebcdic_tables.h
parentf91173ad5a2134421b5148cb6d4b0e5570fb3715 (diff)
downloadperl-c05125c57fd7868af65366bacb6fe40c04b1c719.tar.gz
regen/ebcdic.pl: Add declaration of generated tables
This adds code to declare and define the tables only under DOINIT, and otherwise to just declare them. This allows the includer to not have to deal with them at all.
Diffstat (limited to 'ebcdic_tables.h')
-rw-r--r--ebcdic_tables.h108
1 files changed, 90 insertions, 18 deletions
diff --git a/ebcdic_tables.h b/ebcdic_tables.h
index 5710cfeba0..17e734267c 100644
--- a/ebcdic_tables.h
+++ b/ebcdic_tables.h
@@ -17,7 +17,10 @@
&& '$' == 91 && '@' == 124 && '`' == 121
/* Index is ASCII platform code point; value is EBCDIC 1047 equivalent */
-EXTCONST U8 PL_a2e[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_a2e[];
+# else
+# EXTCONST U8 PL_a2e[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x15,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@@ -37,9 +40,13 @@ EXTCONST U8 PL_a2e[] = {
/*F_*/ 0x8C,0x49,0xCD,0xCE,0xCB,0xCF,0xCC,0xE1,0x70,0xDD,0xDE,0xDB,0xDC,0x8D,0x8E,0xDF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 1047 code point; value is ASCII platform equivalent */
-EXTCONST U8 PL_e2a[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_e2a[];
+# else
+# EXTCONST U8 PL_e2a[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x9D,0x0A,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@@ -59,10 +66,14 @@ EXTCONST U8 PL_e2a[] = {
/*F_*/ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xB3,0xDB,0xDC,0xD9,0xDA,0x9F
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* (Confusingly named) Index is EBCDIC 1047 I8 byte; value is
* EBCDIC 1047 UTF-EBCDIC equivalent */
-EXTCONST U8 PL_utf2e[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_utf2e[];
+# else
+# EXTCONST U8 PL_utf2e[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x15,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@@ -82,10 +93,14 @@ EXTCONST U8 PL_utf2e[] = {
/*F_*/ 0xDC,0xDD,0xDE,0xDF,0xE1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xFA,0xFB,0xFC,0xFD,0xFE
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* (Confusingly named) Index is EBCDIC 1047 UTF-EBCDIC byte; value is
* EBCDIC 1047 I8 equivalent */
-EXTCONST U8 PL_e2utf[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_e2utf[];
+# else
+# EXTCONST U8 PL_e2utf[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x9D,0x0A,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@@ -105,12 +120,16 @@ EXTCONST U8 PL_e2utf[] = {
/*F_*/ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xFB,0xFC,0xFD,0xFE,0xFF,0x9F
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 1047 UTF-EBCDIC byte; value is UTF8SKIP for start bytes
* (including for overlongs); 1 for continuation. Adapted from the shadow
* flags table in tr16. The entries marked 9 in tr16 are continuation bytes
* and are marked as length 1 here so that we can recover. */
-EXTCONST U8 PL_utf8skip[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_utf8skip[];
+# else
+# EXTCONST U8 PL_utf8skip[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -128,9 +147,13 @@ EXTCONST U8 PL_utf8skip[] = {
1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, 5,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 6, 7, 14, 1
};
+# endif
/* Index is EBCDIC 1047 code point; value is its lowercase equivalent */
-EXTCONST U8 PL_latin1_lc[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_latin1_lc[];
+# else
+# EXTCONST U8 PL_latin1_lc[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -150,11 +173,15 @@ EXTCONST U8 PL_latin1_lc[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 1047 code point; value is its uppercase equivalent.
* The 'mod' in the name means that codepoints whose uppercase is above 255 or
* longer than 1 character map to LATIN SMALL LETTER Y WITH DIARESIS */
-EXTCONST U8 PL_mod_latin1_uc[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_mod_latin1_uc[];
+# else
+# EXTCONST U8 PL_mod_latin1_uc[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -174,10 +201,14 @@ EXTCONST U8 PL_mod_latin1_uc[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 1047 code point; For A-Z, value is a-z; for a-z, value
* is A-Z; all other code points map to themselves */
-EXTCONST U8 PL_fold[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_fold[];
+# else
+# EXTCONST U8 PL_fold[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -197,11 +228,15 @@ EXTCONST U8 PL_fold[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 1047 code point; value is its other fold-pair equivalent
* (A => a; a => A, etc) in the 0-255 range. If no such equivalent, value is
* the code point itself */
-EXTCONST U8 PL_fold_latin1[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_fold_latin1[];
+# else
+# EXTCONST U8 PL_fold_latin1[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -221,6 +256,7 @@ EXTCONST U8 PL_fold_latin1[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
#endif /* EBCDIC 1047 */
@@ -230,7 +266,10 @@ EXTCONST U8 PL_fold_latin1[] = {
&& '$' == 91 && '@' == 124 && '`' == 121
/* Index is ASCII platform code point; value is EBCDIC 037 equivalent */
-EXTCONST U8 PL_a2e[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_a2e[];
+# else
+# EXTCONST U8 PL_a2e[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@@ -250,9 +289,13 @@ EXTCONST U8 PL_a2e[] = {
/*F_*/ 0x8C,0x49,0xCD,0xCE,0xCB,0xCF,0xCC,0xE1,0x70,0xDD,0xDE,0xDB,0xDC,0x8D,0x8E,0xDF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 037 code point; value is ASCII platform equivalent */
-EXTCONST U8 PL_e2a[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_e2a[];
+# else
+# EXTCONST U8 PL_e2a[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x9D,0x85,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@@ -272,10 +315,14 @@ EXTCONST U8 PL_e2a[] = {
/*F_*/ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xB3,0xDB,0xDC,0xD9,0xDA,0x9F
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* (Confusingly named) Index is EBCDIC 037 I8 byte; value is
* EBCDIC 037 UTF-EBCDIC equivalent */
-EXTCONST U8 PL_utf2e[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_utf2e[];
+# else
+# EXTCONST U8 PL_utf2e[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x37,0x2D,0x2E,0x2F,0x16,0x05,0x25,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x3C,0x3D,0x32,0x26,0x18,0x19,0x3F,0x27,0x1C,0x1D,0x1E,0x1F,
@@ -295,10 +342,14 @@ EXTCONST U8 PL_utf2e[] = {
/*F_*/ 0xDC,0xDD,0xDE,0xDF,0xE1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xFA,0xFB,0xFC,0xFD,0xFE
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* (Confusingly named) Index is EBCDIC 037 UTF-EBCDIC byte; value is
* EBCDIC 037 I8 equivalent */
-EXTCONST U8 PL_e2utf[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_e2utf[];
+# else
+# EXTCONST U8 PL_e2utf[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x9D,0x85,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F,
@@ -318,12 +369,16 @@ EXTCONST U8 PL_e2utf[] = {
/*F_*/ 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xFB,0xFC,0xFD,0xFE,0xFF,0x9F
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 037 UTF-EBCDIC byte; value is UTF8SKIP for start bytes
* (including for overlongs); 1 for continuation. Adapted from the shadow
* flags table in tr16. The entries marked 9 in tr16 are continuation bytes
* and are marked as length 1 here so that we can recover. */
-EXTCONST U8 PL_utf8skip[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_utf8skip[];
+# else
+# EXTCONST U8 PL_utf8skip[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -341,9 +396,13 @@ EXTCONST U8 PL_utf8skip[] = {
1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 5, 5, 5,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 6, 7, 14, 1
};
+# endif
/* Index is EBCDIC 037 code point; value is its lowercase equivalent */
-EXTCONST U8 PL_latin1_lc[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_latin1_lc[];
+# else
+# EXTCONST U8 PL_latin1_lc[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -363,11 +422,15 @@ EXTCONST U8 PL_latin1_lc[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 037 code point; value is its uppercase equivalent.
* The 'mod' in the name means that codepoints whose uppercase is above 255 or
* longer than 1 character map to LATIN SMALL LETTER Y WITH DIARESIS */
-EXTCONST U8 PL_mod_latin1_uc[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_mod_latin1_uc[];
+# else
+# EXTCONST U8 PL_mod_latin1_uc[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -387,10 +450,14 @@ EXTCONST U8 PL_mod_latin1_uc[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 037 code point; For A-Z, value is a-z; for a-z, value
* is A-Z; all other code points map to themselves */
-EXTCONST U8 PL_fold[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_fold[];
+# else
+# EXTCONST U8 PL_fold[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -410,11 +477,15 @@ EXTCONST U8 PL_fold[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
/* Index is EBCDIC 037 code point; value is its other fold-pair equivalent
* (A => a; a => A, etc) in the 0-255 range. If no such equivalent, value is
* the code point itself */
-EXTCONST U8 PL_fold_latin1[] = {
+# ifndef DOINIT
+# EXTCONST U8 PL_fold_latin1[];
+# else
+# EXTCONST U8 PL_fold_latin1[] = {
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
/*0_*/ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
/*1_*/ 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
@@ -434,6 +505,7 @@ EXTCONST U8 PL_fold_latin1[] = {
/*F_*/ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xDB,0xDC,0xDD,0xDE,0xFF
/*_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F*/
};
+# endif
#endif /* EBCDIC 037 */